Hello experts!
I currently have a system build on top asterisk to which I would like to add a billing feature.
A2billing of course came to mind. But I'm having some trouble understanding how to integrate my current dialplan with a2billing.
What I have currently is similar to:
[2_2] exten => s,1,Set(options=) exten => s,n,Set(result=Answered) exten => s,n,Set(_dialer_phone=${dialer_phone}) exten => s,n,AMD() exten => s,n,GotoIf($[${AMDSTATUS}=MACHINE]?machine:begin) ;skipping the machine part exten => s,n(begin),Set(stage=0) exten => s,n,Background(message1) exten => s,n,Swift(${firstname}) exten => s,n,Swift(${lastname}) exten => s,n,Background(message2) exten => s,n,WaitExten(10) exten => s,n,Goto(2_2,1,1)
exten => 1,1,Set(options=${options}1) exten => 1,n,Set(result=Connected) exten => 1,n,Dial(SIP/${to_dial}@flowroute,,mG(2_2^ans^1));this is actually more complicated, but I didn't want to flood here with irrelevant code
exten => h,1,Gotoif($["${agent}"="true"]?hangup) exten => h,n,Agi("myagi.jar",<a lot of parameters>) exten => h,n(hangup),Hangup()
exten => ans,1,Goto(customer) exten => ans,n,Goto(agent) exten => ans,n(agent),Set(agent=true) exten => ans,n,ConfBridge(${dialer_phone},,dialer_user,) exten => ans,n,Hangup() exten => ans,n,StopMusicOnHold() exten => ans,n,Set(agent=false) exten => ans,n,Agi("myagi2.jar",<a lot of parameters>) exten => ans,n,ConfBridge(${dialer_phone},,dialer_user,) exten => ans,n,Hangup()
This works, any error there is just from me cutting parts of it to fit here nicely.
Now, when I was setting up a2billing I thought I would call some script at the beginning of my dial plan and again at the end, and on some other relevant event like the Dial I make. This doesn't seem to be the case. A2billing does everything internally (to my understanding) and I can't see how to implement my dial plan with a2billing.
My question is, can this be done? How can it be done?
|