OK man ... here you go, lots of extra crap, but this'll work: Mod as you like
[a2billing-sip]
exten => _X.,1,DeadAGI(a2billing.php|8|)
exten => _X.,2,Hangup
[a2billing-CC-DIAL]
exten => _X.,1,Answer
exten => _X.,2,Wait,1
exten => _X.,3,DeadAGI(a2billing.php|9|)
exten => _X.,4,Congestion
exten => _X.,5,Wait,1
exten => _X.,6,Hangup
[agi-conf8]
; this CONFIG will be for wholesale - no voice prompts
; the debug level
; 0=none, 1=low, 2=normal, 3=all
debug=1
; Manage the answer on the call
answer_call=no
; Activate application logging
; logging is optimized to write all the logs at once
logger_enable=YES
; File to log
log_file=/tmp/a2billing.log
; play the goodbye message when the user has finished.
say_goodbye=NO
; enable the menu to choose the language
; press 1 for English, pulsa 2 para el español, Pressez 3 pour Français
play_menulanguage=NO
; force the use of a language, if you dont want to use it leave the option empty
; Values : ES, EN, FR, etc... (according to the audio you have installed)
force_language=
; Introduction prompt : to specify an additional prompt to play at the beginning of the application
; parlezplus-intro_013centimes
intro_prompt=
; length of the cardnumber (number of of digits)
len_cardnumber=7
; Alias-Card length
len_aliasnumber = 7
; Voucher length
len_voucher = 7
; Minimum amount of credit to use the application
min_credit_2call=0
; this is the minimum duration in seconds of a call in order to be billed
; any call with a length less than min_duration_2bill will have a 0 cost
; useful not to charge callers for system errors when a call was answered but it actually didn't connect
min_duration_2bill=0
; if user doesn't have enough credit to call a destination, prompt him to enter another cardnumber
notenoughcredit_cardnumber=NO
; if notenoughcredit_cardnumber = YES then assign the CallerID to the new cardnumber
notenoughcredit_assign_newcardnumber_cid=YES
; if YES it will use the DNID and try to dial out, without asking for the phonenumber to call
; value : YES, NO
use_dnid=YES
; list the dnid on which you want to avoid the use of the previous option "use_dnid"
no_auth_dnid=2400,2300
;number of times the user can dial different number
number_try=3
; Play the balance to the user after the authentication (values : yes - no)
say_balance_after_auth=NO
; Play the balance to the user after the call (values : yes - no)
say_balance_after_call=NO
; Play the initial cost of the route (values : yes - no)
say_rateinitial=NO
; Play the amount of time that the user can call (values : yes - no)
say_timetocall=NO
; enable the presentation of a callerID number
auto_setcallerid=YES
; If set, and auto_setcallerid is enabled, the number is sent as CID always
force_callerid=
; If force_callerid is not set, then this ensures that CID is set to one of the ccard's configured caller IDs or blank if none available.
; NO - disable this feature, caller ID can be anything.
; CID - Caller ID must be one of the customers caller IDs
; DID - Caller ID must be one of the customers DID nos.
; BOTH - Caller ID must be one of the above two items.
cid_sanitize=NO
; enable the callerid authentication
; if this option is active the CC system will check the CID of caller
cid_enable=NO
; if the CID does not exist, you can then ask for a cardnumber from the calling party in order to authenticate the caller
cid_askpincode_ifnot_callerid=YES
; if the callerID, this option will allow the system to add it automatically and create a cardnumber to hook them up.
cid_auto_create_card=NO
; if the callerID authenticate is on, this option will allow the assign the cardnumber enter to the callerID if the callerID wasnt in the DB
cid_auto_assign_card_to_cid=YES
; If cid_auto_create_card has been set to YES, the following option will define with which parameters the card will be create
;
; billing type of the new card
; ( value : POSTPAY or PREPAY)
cid_auto_create_card_typepaid=POSTPAY
; amount of credit of the new card
cid_auto_create_card_credit=0
; if postpay, define the credit limit for the card
cid_auto_create_card_credit_limit=1000
; the tariffgroup to use for the new card (this is the ID that you can find on the admin web interface)
cid_auto_create_card_tariffgroup=6
; if we want to check the callerID over the cardnumber authentication (to guard against spoofing)
callerid_authentication_over_cardnumber=NO
; enable the option to call sip/iax friend for free (values : YES - NO)
sip_iax_friends=YES
; if SIP_IAX_FRIENDS is active, you can define a prefix for the dialed digits to call a pstn number
; values : number
sip_iax_pstn_direct_call_prefix=8
; this will enable a prompt to enter your destination number.
; if number start by sip_iax_pstn_direct_call_prefix we do directly a sip iax call, if not we do a normal call
; sip_iax_pstn_direct_call=NO changed 10/29/06
sip_iax_pstn_direct_call=YES
; Extracharge DIDs, multiple numbers and fees must be separated by comma
;extracharge_did=1800XXXXXXX,1888XXXXXXX
extracharge_did=
;extracharge_fee=0.02,0.03
extracharge_fee=
; More information about the Dial :
http://voip-info.org/wiki-Asterisk+cmd+dial
; 30 : The timeout parameter is optional. If not specifed, the Dial command will wait indefinitely, exiting only when the originating channel hangs up, or all the dialed channels return a busy or error condition. Otherwise it specifies a maximum time, in seconds, that the Dial command is to wait for a channel to answer.
2; H: Allow the caller to hang up by dialing *
; r: Generate a ringing tone for the calling party
; m: Provide Music on Hold to the calling party until the called channel answers.
; L(x[:y][:z]): Limit the call to 'x' ms, warning when 'y' ms are left, repeated every 'z' ms)
; %timeout% tag is replaced by the calculated timeout according the credit & destination rate!
dialcommand_param="|60|HL(%timeout%:60000:00000)"
; by default (3600000 = 1HOUR MAX CALL)
dialcommand_param_sipiax_friend="|30|HL(3600000:61000:30000)"
; Define the order to make the outbound call
; YES -> SIP/dialedphonenumber@gateway_ip - NO SIP/gateway_ip/dialedphonenumber
; Both should work exactly the same but i experimented one case when gateway was supporting dialedphonenumber@gateway_ip
; So in case of trouble, try it out
switchdialcommand=NO
; For free calls, limit the duration: amount in seconds
maxtime_tocall_negatif_free_route = 5400
; Send a reminder email to the user when they are under min_credit_2call
send_reminder=YES
; enable to monitor the call (to record all the conversations)
; value : YES - NO
record_call=NO
; format of the recorded monitor file
monitor_formatfile=gsm
;base currency define the default currency that you want to use to setup your system (see the file /etc/asterisk/rates.inc to know the currency code)
base_currency = USD
; Force to play the balance to the caller in a predefined currency, to use the currency set for by the customer leave this field empty
agi_force_currency =
; CURRENCY SECTION
; Define all the audio (without file extensions) that you want to play according to currency (use , to separate, ie "usd:prepaid-dollar,mxn:pesos,eur:Euro,all:credit")
currency_association = usd:prepaid-dollar,mxn:pesos,eur:euro,all:credit
; Please enter the file name you want to play when we prompt the calling party to enter the destination number
; file_conf_enter_destination = prepaid-enter-number-u-calling-1-or-011
file_conf_enter_destination = prepaid-enter-dest
; Please enter the file name you want to play when we prompt the calling party to choose the prefered language
; file_conf_enter_menulang = prepaid-menulang
file_conf_enter_menulang = prepaid-menulang2
[agi-conf9]
; this is for pre-paid calling card NOW
; the debug level
; 0=none, 1=low, 2=normal, 3=all
debug=1
; Manage the answer on the call
answer_call=yes
; Activate application logging
; logging is optimized to write all the logs at once
logger_enable=YES
; File to log
log_file=/tmp/a2billing.log
; play the goodbye message when the user has finished.
say_goodbye=NO
; enable the menu to choose the language
; press 1 for English, pulsa 2 para el español, Pressez 3 pour Français
play_menulanguage=NO
; force the use of a language, if you dont want to use it leave the option empty
; Values : ES, EN, FR, etc... (according to the audio you have installed)
force_language=
; Introduction prompt : to specify an additional prompt to play at the beginning of the application
; parlezplus-intro_013centimes
intro_prompt=
; length of the cardnumber (number of of digits)
len_cardnumber=7
; Alias-Card length
len_aliasnumber = 7
; Voucher length
len_voucher = 7
; Minimum amount of credit to use the application
min_credit_2call=0.051
; this is the minimum duration in seconds of a call in order to be billed
; any call with a length less than min_duration_2bill will have a 0 cost
; useful not to charge callers for system errors when a call was answered but it actually didn't connect
min_duration_2bill=0
; if user doesn't have enough credit to call a destination, prompt him to enter another cardnumber
notenoughcredit_cardnumber=YES
; if notenoughcredit_cardnumber = YES then assign the CallerID to the new cardnumber
notenoughcredit_assign_newcardnumber_cid=NO
; if YES it will use the DNID and try to dial out, without asking for the phonenumber to call
; value : YES, NO
use_dnid=NO
; list the dnid on which you want to avoid the use of the previous option "use_dnid"
no_auth_dnid=2400,2300
;number of times the user can dial different number
number_try=3
; Play the balance to the user after the authentication (values : yes - no)
say_balance_after_auth=YES
; Play the balance to the user after the call (values : yes - no)
say_balance_after_call=NO
; Play the initial cost of the route (values : yes - no)
say_rateinitial=NO
; Play the amount of time that the user can call (values : yes - no)
say_timetocall=YES
; enable the presentation of a callerID number
auto_setcallerid=YES
; If set, and auto_setcallerid is enabled, the number is sent as CID always
force_callerid=YES
; If force_callerid is not set, then this ensures that CID is set to one of the ccard's configured caller IDs or blank if none available.
; NO - disable this feature, caller ID can be anything.
; CID - Caller ID must be one of the customers caller IDs
; DID - Caller ID must be one of the customers DID nos.
; BOTH - Caller ID must be one of the above two items.
cid_sanitize=NO
; enable the callerid authentication
; if this option is active the CC system will check the CID of caller
cid_enable=YES
; if the CID does not exist, you can then ask for a cardnumber from the calling party in order to authenticate the caller
cid_askpincode_ifnot_callerid=YES
; if the callerID, this option will allow the system to add it automatically and create a cardnumber to hook them up.
cid_auto_create_card=NO
; if the callerID authenticate is on, this option will allow the assign the cardnumber enter to the callerID if the callerID wasnt in the DB
cid_auto_assign_card_to_cid=YES
; If cid_auto_create_card has been set to YES, the following option will define with which parameters the card will be create
;
; billing type of the new card
; ( value : POSTPAY or PREPAY)
cid_auto_create_card_typepaid=PREPAY
; amount of credit of the new card
cid_auto_create_card_credit=0
; if postpay, define the credit limit for the card
cid_auto_create_card_credit_limit=1000
; the tariffgroup to use for the new card (this is the ID that you can find on the admin web interface)
cid_auto_create_card_tariffgroup=6
; if we want to check the callerID over the cardnumber authentication (to guard against spoofing)
callerid_authentication_over_cardnumber=NO
; enable the option to call sip/iax friend for free (values : YES - NO)
sip_iax_friends=YES
; if SIP_IAX_FRIENDS is active, you can define a prefix for the dialed digits to call a pstn number
; values : number
sip_iax_pstn_direct_call_prefix=8
; this will enable a prompt to enter your destination number.
; if number start by sip_iax_pstn_direct_call_prefix we do directly a sip iax call, if not we do a normal call
; sip_iax_pstn_direct_call=NO changed 10/29/06
sip_iax_pstn_direct_call=YES
; Extracharge DIDs, multiple numbers and fees must be separated by comma
;extracharge_did=1800XXXXXXX,1888XXXXXXX
extracharge_did=
;extracharge_fee=0.02,0.03
extracharge_fee=
; More information about the Dial :
http://voip-info.org/wiki-Asterisk+cmd+dial
; 30 : The timeout parameter is optional. If not specifed, the Dial command will wait indefinitely, exiting only when the originating channel hangs up, or all the dialed channels return a busy or error condition. Otherwise it specifies a maximum time, in seconds, that the Dial command is to wait for a channel to answer.
2; H: Allow the caller to hang up by dialing *
; r: Generate a ringing tone for the calling party
; m: Provide Music on Hold to the calling party until the called channel answers.
; L(x[:y][:z]): Limit the call to 'x' ms, warning when 'y' ms are left, repeated every 'z' ms)
; %timeout% tag is replaced by the calculated timeout according the credit & destination rate!
;dialcommand_param="|60|HL(%timeout%:61000:30000)"
dialcommand_param="|60|HL(%timeout%:60000:00000)"
; by default (3600000 = 1HOUR MAX CALL)
dialcommand_param_sipiax_friend="|30|HL(3600000:6000:000000)"
; Define the order to make the outbound call
; YES -> SIP/dialedphonenumber@gateway_ip - NO SIP/gateway_ip/dialedphonenumber
; Both should work exactly the same but i experimented one case when gateway was supporting dialedphonenumber@gateway_ip
; So in case of trouble, try it out
switchdialcommand=NO
; For free calls, limit the duration: amount in seconds
maxtime_tocall_negatif_free_route = 5400
; Send a reminder email to the user when they are under min_credit_2call
send_reminder=YES
; enable to monitor the call (to record all the conversations)
; value : YES - NO
record_call=NO
; format of the recorded monitor file
monitor_formatfile=gsm
;base currency define the default currency that you want to use to setup your system (see the file /etc/asterisk/rates.inc to know the currency code)
base_currency = USD
; Force to play the balance to the caller in a predefined currency, to use the currency set for by the customer leave this field empty
agi_force_currency =
; CURRENCY SECTION
; Define all the audio (without file extensions) that you want to play according to currency (use , to separate, ie "usd:prepaid-dollar,mxn:pesos,eur:Euro,all:credit")
currency_association = usd:prepaid-dollar,mxn:pesos,eur:euro,all:credit
; Please enter the file name you want to play when we prompt the calling party to enter the destination number
; file_conf_enter_destination = prepaid-enter-number-u-calling-1-or-011
file_conf_enter_destination = prepaid-enter-dest
; Please enter the file name you want to play when we prompt the calling party to choose the prefered language
; file_conf_enter_menulang = prepaid-menulang
file_conf_enter_menulang = prepaid-menulang2