; 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 reach the 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, we create two different contexts,
; 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 inward 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.
[a2billing]
include => a2billing_callingcard
include => a2billing_monitoring
include => a2billing_voucher

[a2billing_callingcard]
; CallingCard application
exten => _X.,1,NoOp(A2Billing Start)
exten => _X.,n,DeadAgi(a2billing.php,1)
exten => _X.,n,Hangup

[a2billing_voucher]
exten => _X.,1,Answer(1)
exten => _X.,n,DeadAgi(a2billing.php,1,voucher)
;exten => _X.,n,AGI(a2billing.php,1,voucher,44) ; will add 44 in front of the callerID for the CID authentication
exten => _X.,n,Hangup

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