Hello!
I have a problem. Then i create a new customer and select the SIP ACCOUNT option to 'yes', the calls from this sip account comes perfectly.
But then i create a new customer without SIP Account, and then assign the sip account from list of SIP-FRIEND a2billing says "PREPAID-AUTH-FAIL".
Here log with first sip account (created with option SIP ACCOUNT = yes)
Code:
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
a2billing.php|1: A2Billing AGI internal configuration:
a2billing.php|1: Array
a2billing.php|1: (
a2billing.php|1: [debug] => 3
a2billing.php|1: [asterisk_version] => 1_4
a2billing.php|1: [answer_call] => 1
a2billing.php|1: [play_audio] => 1
a2billing.php|1: [say_goodbye] =>
a2billing.php|1: [play_menulanguage] =>
a2billing.php|1: [force_language] =>
a2billing.php|1: [intro_prompt] =>
a2billing.php|1: [min_credit_2call] => 0
a2billing.php|1: [min_duration_2bill] => 0
a2billing.php|1: [notenoughcredit_cardnumber] =>
a2billing.php|1: [notenoughcredit_assign_newcardnumber_cid] => 1
a2billing.php|1: [use_dnid] => 1
a2billing.php|1: [no_auth_dnid] => Array
a2billing.php|1: (
a2billing.php|1: [0] => 2400
a2billing.php|1: [1] => 2300
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [number_try] => 3
a2billing.php|1: [force_callplan_id] =>
a2billing.php|1: [say_balance_after_auth] =>
a2billing.php|1: [say_balance_after_call] =>
a2billing.php|1: [say_rateinitial] =>
a2billing.php|1: [say_timetocall] =>
a2billing.php|1: [auto_setcallerid] => 1
a2billing.php|1: [force_callerid] => 3709001
a2billing.php|1: [cid_sanitize] =>
a2billing.php|1: [cid_enable] =>
a2billing.php|1: [cid_askpincode_ifnot_callerid] =>
a2billing.php|1: [cid_auto_assign_card_to_cid] => 1
a2billing.php|1: [cid_auto_create_card] =>
a2billing.php|1: [cid_auto_create_card_len] => 10
a2billing.php|1: [cid_auto_create_card_typepaid] => POSTPAY
a2billing.php|1: [cid_auto_create_card_credit] => 0
a2billing.php|1: [cid_auto_create_card_credit_limit] => 1000
a2billing.php|1: [cid_auto_create_card_tariffgroup] => 6
a2billing.php|1: [callerid_authentication_over_cardnumber] =>
a2billing.php|1: [sip_iax_friends] =>
a2billing.php|1: [sip_iax_pstn_direct_call_prefix] => 555
a2billing.php|1: [sip_iax_pstn_direct_call] =>
a2billing.php|1: [ivr_voucher] =>
a2billing.php|1: [ivr_voucher_prefix] => 8
a2billing.php|1: [jump_voucher_if_min_credit] =>
a2billing.php|1: [extracharge_did] => Array
a2billing.php|1: (
a2billing.php|1: [0] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [extracharge_fee] => Array
a2billing.php|1: (
a2billing.php|1: [0] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [extracharge_buyfee] => Array
a2billing.php|1: (
a2billing.php|1: [0] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [international_prefixes] => Array
a2billing.php|1: (
a2billing.php|1: [0] => 011
a2billing.php|1: [1] => 00
a2billing.php|1: [2] => 09
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [dialcommand_param] => |60|HRgrL(%timeout%:61000:30000)
a2billing.php|1: [dialcommand_param_sipiax_friend] => |60|HRgirL(3600000:61000:30000)
a2billing.php|1: [switchdialcommand] =>
a2billing.php|1: [failover_recursive_limit] => 2
a2billing.php|1: [maxtime_tocall_negatif_free_route] => 5400
a2billing.php|1: [send_reminder] =>
a2billing.php|1: [record_call] =>
a2billing.php|1: [monitor_formatfile] => gsm
a2billing.php|1: [agi_force_currency] =>
a2billing.php|1: [currency_association] => Array
a2billing.php|1: (
a2billing.php|1: [0] => usd:dollars
a2billing.php|1: [1] => mxn:pesos
a2billing.php|1: [2] => eur:euros
a2billing.php|1: [3] => all:credit
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [file_conf_enter_destination] => prepaid-enter-dest
a2billing.php|1: [file_conf_enter_menulang] => prepaid-menulang2
a2billing.php|1: [callback_bill_1stleg_ifcall_notconnected] =>
a2billing.php|1: [logger_enable] => 1
a2billing.php|1: [log_file] => /tmp/a2billing.log
a2billing.php|1: [currency_association_internal] => Array
a2billing.php|1: (
a2billing.php|1: [usd] => dollars
a2billing.php|1: [mxn] => pesos
a2billing.php|1: [eur] => euros
a2billing.php|1: [all] => credit
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [ivr_voucher_prefixe] => 8
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: file:a2billing.php - line:78 - IDCONFIG : 1
a2billing.php|1: file:a2billing.php - line:79 - MODE : standard
a2billing.php|1: file:a2billing.php - line:91 - AGI Request:
a2billing.php|1: file:a2billing.php - line:92 - Array
a2billing.php|1: (
a2billing.php|1: [agi_request] => a2billing.php
a2billing.php|1: [agi_channel] => SIP/2385-092bf268
a2billing.php|1: [agi_language] => en
a2billing.php|1: [agi_type] => SIP
a2billing.php|1: [agi_uniqueid] => 1243791181.9
a2billing.php|1: [agi_callerid] => 38178544
a2billing.php|1: [agi_calleridname] => test
a2billing.php|1: [agi_callingpres] => 0
a2billing.php|1: [agi_callingani2] => 0
a2billing.php|1: [agi_callington] => 0
a2billing.php|1: [agi_callingtns] => 0
a2billing.php|1: [agi_dnid] => XXXXXXXXXX
a2billing.php|1: [agi_rdnis] => unknown
a2billing.php|1: [agi_context] => a2billing
a2billing.php|1: [agi_extension] => XXXXXXXXX
a2billing.php|1: [agi_priority] => 1
a2billing.php|1: [agi_enhanced] => 0.0
a2billing.php|1: [agi_accountcode] => 2385
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: file:Class.A2Billing.php - line:621 - get_agi_request_parameter = 38178544 ; SIP/2385-092bf268 ; 1243791181.9 ; 2385 ; XXXXXXXXXX
a2billing.php|1: file:a2billing.php - line:141 - [ANSWER CALL]
a2billing.php|1: file:Class.A2Billing.php - line:1640 - SELECT credit, tariff, activated, inuse, simultaccess, typepaid, creditlimit, language, removeinterprefix, redial, enableexpire, UNIX_TIMESTAMP(expirationdate), expiredays, nbused, UNIX_TIMESTAMP(firstusedate), UNIX_TIMESTAMP(cc_card.creationdate), cc_card.currency, cc_card.lastname, cc_card.firstname, cc_card.email, cc_card.uipass, cc_card.id_campaign, cc_card.id, useralias FROM cc_card LEFT JOIN cc_tariffgroup ON tariff=cc_tariffgroup.id WHERE username='2385'
a2billing.php|1: file:Class.A2Billing.php - line:1714 - [SET CHANNEL(language) ru]
a2billing.php|1: file:Class.A2Billing.php - line:654 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse+1 WHERE username='2385']
a2billing.php|1: file:Class.A2Billing.php - line:1400 - [AUTO SetCallerID]
a2billing.php|1: file:Class.A2Billing.php - line:1404 - [EXEC SetCallerID : 3709001]
a2billing.php|1: file:a2billing.php - line:172 - [CHANNEL STATUS : 6 = Line is up]
a2billing.php|1: file:a2billing.php - line:173 - [CREDIT : 999.9722][CREDIT MIN_CREDIT_2CALL : 0]
a2billing.php|1: file:Class.A2Billing.php - line:676 - 1 && && 12&& 0
a2billing.php|1: file:Class.A2Billing.php - line:701 - DESTINATION ::> XXXXXXXXX
a2billing.php|1: file:Class.A2Billing.php - line:703 - RULES APPLY ON DESTINATION ::> XXXXXXXX
a2billing.php|1: file:Class.A2Billing.php - line:741 - OK - RESFINDRATE::> 1
a2billing.php|1: file:Class.A2Billing.php - line:763 - RES_ALL_CALCULTIMEOUT ::> 1
a2billing.php|1: file:Class.A2Billing.php - line:780 - TIMEOUT::> 540525 : minutes=9008 - seconds=45
a2billing.php|1: file:Class.RateEngine.php - line:1012 - app_callingcard: Dialing 'Local/XXXXXXXXX@provider-out/n|60|HRgrL(540525000:61000:30000)' with timeout of '540525'.
a2billing.php|1:
a2billing.php|1: file:Class.RateEngine.php - line:1037 - app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.
-- AGI Script Executing Application: (Dial) Options: (Local/XXXXXXXXX@provider-out/n|60|HRgrL(540525000:61000:30000))
Here log with second sip friend assigned to the customer from list of SIP-FRIEND
Code:
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
a2billing.php|1: A2Billing AGI internal configuration:
a2billing.php|1: Array
a2billing.php|1: (
a2billing.php|1: [debug] => 3
a2billing.php|1: [asterisk_version] => 1_4
a2billing.php|1: [answer_call] => 1
a2billing.php|1: [play_audio] => 1
a2billing.php|1: [say_goodbye] =>
a2billing.php|1: [play_menulanguage] =>
a2billing.php|1: [force_language] =>
a2billing.php|1: [intro_prompt] =>
a2billing.php|1: [min_credit_2call] => 0
a2billing.php|1: [min_duration_2bill] => 0
a2billing.php|1: [notenoughcredit_cardnumber] =>
a2billing.php|1: [notenoughcredit_assign_newcardnumber_cid] => 1
a2billing.php|1: [use_dnid] => 1
a2billing.php|1: [no_auth_dnid] => Array
a2billing.php|1: (
a2billing.php|1: [0] => 2400
a2billing.php|1: [1] => 2300
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [number_try] => 3
a2billing.php|1: [force_callplan_id] =>
a2billing.php|1: [say_balance_after_auth] =>
a2billing.php|1: [say_balance_after_call] =>
a2billing.php|1: [say_rateinitial] =>
a2billing.php|1: [say_timetocall] =>
a2billing.php|1: [auto_setcallerid] => 1
a2billing.php|1: [force_callerid] => 3709001
a2billing.php|1: [cid_sanitize] =>
a2billing.php|1: [cid_enable] =>
a2billing.php|1: [cid_askpincode_ifnot_callerid] =>
a2billing.php|1: [cid_auto_assign_card_to_cid] => 1
a2billing.php|1: [cid_auto_create_card] =>
a2billing.php|1: [cid_auto_create_card_len] => 10
a2billing.php|1: [cid_auto_create_card_typepaid] => POSTPAY
a2billing.php|1: [cid_auto_create_card_credit] => 0
a2billing.php|1: [cid_auto_create_card_credit_limit] => 1000
a2billing.php|1: [cid_auto_create_card_tariffgroup] => 6
a2billing.php|1: [callerid_authentication_over_cardnumber] =>
a2billing.php|1: [sip_iax_friends] =>
a2billing.php|1: [sip_iax_pstn_direct_call_prefix] => 555
a2billing.php|1: [sip_iax_pstn_direct_call] =>
a2billing.php|1: [ivr_voucher] =>
a2billing.php|1: [ivr_voucher_prefix] => 8
a2billing.php|1: [jump_voucher_if_min_credit] =>
a2billing.php|1: [extracharge_did] => Array
a2billing.php|1: (
a2billing.php|1: [0] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [extracharge_fee] => Array
a2billing.php|1: (
a2billing.php|1: [0] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [extracharge_buyfee] => Array
a2billing.php|1: (
a2billing.php|1: [0] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [international_prefixes] => Array
a2billing.php|1: (
a2billing.php|1: [0] => 011
a2billing.php|1: [1] => 00
a2billing.php|1: [2] => 09
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [dialcommand_param] => |60|HRgrL(%timeout%:61000:30000)
a2billing.php|1: [dialcommand_param_sipiax_friend] => |60|HRgirL(3600000:61000:30000)
a2billing.php|1: [switchdialcommand] =>
a2billing.php|1: [failover_recursive_limit] => 2
a2billing.php|1: [maxtime_tocall_negatif_free_route] => 5400
a2billing.php|1: [send_reminder] =>
a2billing.php|1: [record_call] =>
a2billing.php|1: [monitor_formatfile] => gsm
a2billing.php|1: [agi_force_currency] =>
a2billing.php|1: [currency_association] => Array
a2billing.php|1: (
a2billing.php|1: [0] => usd:dollars
a2billing.php|1: [1] => mxn:pesos
a2billing.php|1: [2] => eur:euros
a2billing.php|1: [3] => all:credit
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [file_conf_enter_destination] => prepaid-enter-dest
a2billing.php|1: [file_conf_enter_menulang] => prepaid-menulang2
a2billing.php|1: [callback_bill_1stleg_ifcall_notconnected] =>
a2billing.php|1: [logger_enable] => 1
a2billing.php|1: [log_file] => /tmp/a2billing.log
a2billing.php|1: [currency_association_internal] => Array
a2billing.php|1: (
a2billing.php|1: [usd] => dollars
a2billing.php|1: [mxn] => pesos
a2billing.php|1: [eur] => euros
a2billing.php|1: [all] => credit
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [ivr_voucher_prefixe] => 8
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: file:a2billing.php - line:78 - IDCONFIG : 1
a2billing.php|1: file:a2billing.php - line:79 - MODE : standard
a2billing.php|1: file:a2billing.php - line:91 - AGI Request:
a2billing.php|1: file:a2billing.php - line:92 - Array
a2billing.php|1: (
a2billing.php|1: [agi_request] => a2billing.php
a2billing.php|1: [agi_channel] => SIP/709-092bf268
a2billing.php|1: [agi_language] => en
a2billing.php|1: [agi_type] => SIP
a2billing.php|1: [agi_uniqueid] => 1243790973.2
a2billing.php|1: [agi_callerid] => 709
a2billing.php|1: [agi_calleridname] => test
a2billing.php|1: [agi_callingpres] => 0
a2billing.php|1: [agi_callingani2] => 0
a2billing.php|1: [agi_callington] => 0
a2billing.php|1: [agi_callingtns] => 0
a2billing.php|1: [agi_dnid] => XXXXXXXXXX
a2billing.php|1: [agi_rdnis] => unknown
a2billing.php|1: [agi_context] => a2billing
a2billing.php|1: [agi_extension] => XXXXXXXXXX
a2billing.php|1: [agi_priority] => 1
a2billing.php|1: [agi_enhanced] => 0.0
a2billing.php|1: [agi_accountcode] => 709
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: file:Class.A2Billing.php - line:621 - get_agi_request_parameter = 709 ; SIP/709-092bf268 ; 1243790973.2 ; 709 ; XXXXXXXXXX
a2billing.php|1: file:a2billing.php - line:141 - [ANSWER CALL]
a2billing.php|1: file:Class.A2Billing.php - line:1640 - SELECT credit, tariff, activated, inuse, simultaccess, typepaid, creditlimit, language, removeinterprefix, redial, enableexpire, UNIX_TIMESTAMP(expirationdate), expiredays, nbused, UNIX_TIMESTAMP(firstusedate), UNIX_TIMESTAMP(cc_card.creationdate), cc_card.currency, cc_card.lastname, cc_card.firstname, cc_card.email, cc_card.uipass, cc_card.id_campaign, cc_card.id, useralias FROM cc_card LEFT JOIN cc_tariffgroup ON tariff=cc_tariffgroup.id WHERE username='709'
a2billing.php|1: file:Class.A2Billing.php - line:1647 - [b]PREPAID-AUTH-FAIL[/b]
-- Playing 'prepaid-auth-fail' (escape_digits=#) (sample_offset 0)
a2billing.php|1: file:a2billing.php - line:319 - [AUTHENTICATION FAILED (cia_res:-2)]
== Spawn extension (a2billing, XXXXXXXXXX, 1) exited non-zero on 'SIP/709-092bf268'
Here is some columns from tables cc_card and cc_sip_buddies from mya2billing database (im using mysql)
cc_card
Quote:
id creationdate firstusedate expirationdate enableexpire expiredays username
2 2009-04-10 14:36:43 0000-00-00 00:00:00 2019-04-10 14:35:48 0 0 4631
3 2009-04-18 14:47:51 2009-04-18 14:56:15 2019-04-18 14:47:07 0 0 2385
cc_sip_buddies
Quote:
id id_cc_card name accountcode regexten amaflags callerid canreinvite type username
1 2 4631 4631 4631 billing 67629357 yes friend 4631
2 3 2385 2385 2385 billing 38178544 yes friend 2385
3 3 709 709 NULL billing NULL no friend 709
I think problem is that a2billing cant find username in table cc_card
Code:
file:Class.A2Billing.php - line:1640 - SELECT credit, tariff, activated, inuse, simultaccess, typepaid, creditlimit, language, removeinterprefix, redial, enableexpire, UNIX_TIMESTAMP(expirationdate), expiredays, nbused, UNIX_TIMESTAMP(firstusedate), UNIX_TIMESTAMP(cc_card.creationdate), cc_card.currency, cc_card.lastname, cc_card.firstname, cc_card.email, cc_card.uipass, cc_card.id_campaign, cc_card.id, useralias FROM cc_card LEFT JOIN cc_tariffgroup ON tariff=cc_tariffgroup.id WHERE username='709'
Can anyone help me with this or give some useful advise?
Thank you.