|
|
楼主 |
发表于 2011-11-13 04:51:16
|
显示全部楼层
Integrating FreePBX with A2Billing
Please note that if using Asterisk 1.6 or later the pipe (|) symbols below need changing to commas (,)
There are several reasons you may want to integrate FreePBX and A2Billing. Whether you’re just using FreePBX to setup trunks for your a2billing calling card system or you use FreePBX and want to route the outbound calls via a2billing to do least cost routing.
There are 2 things you need to do to integrate the two. The first is to add the following to extensions_custom.conf
/etc/asterisk/extensions_custom.conf
[a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,DeadAGI(a2billing.php|1)
exten => _X.,n,Hangup
[a2billing-callback]
exten => _X.,1,DeadAGI(a2billing.php|1|callback)
exten => _X.,n,Hangup
[a2billing-cid-callback]
exten => _X.,1,Wait(1)
exten => _X.,n,DeadAGI(a2billing.php|1|cid-callback)
exten => _X.,n,Hangup
[a2billing-all-callback]
exten => _X.,1,DeadAGI(a2billing.php|1|all-callback|1) ;last parameter is the callback area code
exten => _X.,n,Hangup
[a2billing-predictivedialer]
exten => _X.,1,DeadAGI(a2billing.php|1|predictivedialer)
exten => _X.,n,Hangup
[a2billing-did]
exten => _X.,1,DeadAGI(a2billing.php|1|did)
exten => _X.,2,Hangup
[a2billing-voucher]
exten => _X.,1,DeadAGI(a2billing.php|1|voucher)
;exten => _X.,1,AGI(a2billing.php|1|voucher|1) ; will add 44 in front of the callerID for the CID authentication
exten => _X.,n,Hangup
[a2billing-sip]
exten => _X.,1,DeadAGI(a2billing.php|2)
exten => _X.,n,Hangup
The number after the a2billing.php| is the agi-conf in the a2billing.conf file that the call is passed to. This allows you to have different settings for certain types of calls such as whether the caller can chose the a2billing language or whether their balance is read to them. You will need to restart Asterisk or ‘reload sip’ to get the changes above to take effect.
You might not need all of the contexts above but it won’t hurt to put them in there.
The second thing to do is create the following Custom Destinations in FreePBX -
Custom Destination: a2billing,${EXTEN},1 Description: a2billing
Custom Destination: a2billing-callback,${EXTEN},1 Description: a2billing-callback
Custom Destination: a2billing-cid-callback,${EXTEN},1 Description: a2billing-cid-callback
Custom Destination: a2billing-did,${EXTEN},1 Description: a2billing-did
Custom Destination: a2billing-sip,${EXTEN},1 Description: a2billing-sip
Again, you might not need all of those or you might need extra ones but you get the idea.
So you should end up with something like this -

These destinations can then be used in Inbound Routes, IVRs, etc in FreePBX to pass the call to A2Billing
|
|