Dialplan.

Posted: by Unknown in
0

The extensions.conf is the Asterisk dialplan. Calls that interact with the billing software need to be handled inside of one or many a2billing related contexts.The calls that reachthe context are processed using the a2billing.php AGI script.The a2billing.php script can be invoked in many different modes (standard, did, voucher, callback, etc).

In the example, the first context [a2billing] handles all the calls from our VoIP clients. When a call arrives, any extension number _X.(2 digits or more) reaches the script a2billing.php.The second context [did], will be used to route calls back to the users. Calls to the clients (DID) are handled inside of the [did] context. The script a2billing.php in did mode is responsible of routing the call back to one of our users.

Dialplan.
-Rename the extensions.conf file (Location: /etc/asterisk/extensions.conf) to extensions.conf.old.
[root@a2billing mahmouda]# mv /etc/asterisk/extensions.conf /etc/asterisk/extensions.conf.old 
-Create a new " extensions.conf " empty file and insert the following lines into the file.

[a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup

[a2billing-did]
exten => _X.,1,deadAGI(a2billing.php,1,did)
exten => _X.,2,Hangup

[a2billing-callback]
exten => _X.,1,deadAGI(a2billing.php,1,callback)
exten => _X.,n,Hangup

[a2billing-cid-callback]
exten => _X.,1,deadAGI(a2billing.php,1,cid-callback,34) ;last parameter is the callback area code
exten => _X.,n,Hangup

[a2billing-all-callback]
exten => _X.,1,deadAGI(a2billing.php,1,all-callback,34) ;last parameter is the callback area code
exten => _X.,n,Hangup
 
[a2billing-voucher]
exten => _X.,1,deadAGI(a2billing.php,1,voucher)
exten => _X.,n,Hangup

[custom-a2billing-did]
exten => _X.,1,deadAGI(a2billing.php,1,did)
exten => _X.,2,Hangup

[custom-a2billing]
exten => _X.,1,deadAGI(a2billing.php,1)
exten => _X.,n,Hangup

-Reload the asterisk configuration. 
[root@a2billing mahmouda]#asterisk -rx "core reload"