When I place a call from an unknown caller ID, A2B fails to authenticate the customer (That's exactly what I want for this profile), then it asks for PIN number, and after entering the Cardnumber, it goes and checks the credit of the card (so far so good), but when it pulls the information from the database, and the credit is 0, I receive the message "Sorry you have cero credits" and it doesn't asks to enter a voucher to add credit to the account with it.
pbx001*CLI>
-- Accepting AUTHENTICATED call from 216.137.100.250:
> requested format = gsm,
> requested prefs = (),
> actual format = gsm,
> host prefs = (ulaw|gsm),
> priority = mine
-- Executing DeadAGI("IAX2/test-2", "a2billing.php|4") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
a2billing.php|4: A2Billing AGI internal configuration:
a2billing.php|4: Array
a2billing.php|4: (
a2billing.php|4: [debug] => 3
a2billing.php|4: [asterisk_version] => 1_2
a2billing.php|4: [answer_call] => 1
a2billing.php|4: [play_audio] => 1
a2billing.php|4: [say_goodbye] =>
a2billing.php|4: [play_menulanguage] =>
a2billing.php|4: [force_language] =>
a2billing.php|4: [intro_prompt] =>
a2billing.php|4: [min_credit_2call] => 0.1
a2billing.php|4: [min_duration_2bill] => 0
a2billing.php|4: [notenoughcredit_cardnumber] => 1
a2billing.php|4: [notenoughcredit_assign_newcardnumber_cid] => 1
a2billing.php|4: [use_dnid] =>
a2billing.php|4: [no_auth_dnid] => Array
a2billing.php|4: (
a2billing.php|4: [0] => 2400
a2billing.php|4: [1] => 2300
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [number_try] => 3
a2billing.php|4: [force_callplan_id] =>
a2billing.php|4: [say_balance_after_auth] => 1
a2billing.php|4: [say_balance_after_call] =>
a2billing.php|4: [say_rateinitial] =>
a2billing.php|4: [say_timetocall] => 1
a2billing.php|4: [auto_setcallerid] => 1
a2billing.php|4: [force_callerid] =>
a2billing.php|4: [cid_sanitize] =>
a2billing.php|4: [cid_enable] =>
a2billing.php|4: [cid_askpincode_ifnot_callerid] => 1
a2billing.php|4: [cid_auto_assign_card_to_cid] => 1
a2billing.php|4: [cid_auto_create_card] =>
a2billing.php|4: [cid_auto_create_card_len] => 10
a2billing.php|4: [cid_auto_create_card_typepaid] => POSTPAY
a2billing.php|4: [cid_auto_create_card_credit] => 0
a2billing.php|4: [cid_auto_create_card_credit_limit] => 1000
a2billing.php|4: [cid_auto_create_card_tariffgroup] => 6
a2billing.php|4: [callerid_authentication_over_cardnumber] =>
a2billing.php|4: [sip_iax_friends] =>
a2billing.php|4: [sip_iax_pstn_direct_call_prefix] => 555
a2billing.php|4: [sip_iax_pstn_direct_call] =>
a2billing.php|4: [ivr_voucher] => 1
a2billing.php|4: [ivr_voucher_prefix] => 8
a2billing.php|4: [jump_voucher_if_min_credit] => 1
a2billing.php|4: [extracharge_did] => Array
a2billing.php|4: (
a2billing.php|4: [0] =>
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [extracharge_fee] => Array
a2billing.php|4: (
a2billing.php|4: [0] =>
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [dialcommand_param] => |60|HRrL(%timeout%:61000:30000)
a2billing.php|4: [dialcommand_param_sipiax_friend] => |60|HL(3600000:61000:30000)
a2billing.php|4: [switchdialcommand] =>
a2billing.php|4: [failover_recursive_limit] => 2
a2billing.php|4: [maxtime_tocall_negatif_free_route] => 5400
a2billing.php|4: [send_reminder] => 1
a2billing.php|4: [record_call] =>
a2billing.php|4: [monitor_formatfile] => gsm
a2billing.php|4: [agi_force_currency] =>
a2billing.php|4: [currency_association] => Array
a2billing.php|4: (
a2billing.php|4: [0] => usd:dollars
a2billing.php|4: [1] => mxn:pesos
a2billing.php|4: [2] => eur:euros
a2billing.php|4: [3] => all:credit
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [file_conf_enter_destination] => prepaid-enter-dest
a2billing.php|4: [file_conf_enter_menulang] => prepaid-menulang2
a2billing.php|4: [callback_bill_1stleg_ifcall_notconnected] => 1
a2billing.php|4: [logger_enable] => 1
a2billing.php|4: [log_file] => /tmp/a2billing.log
a2billing.php|4: [currency_association_internal] => Array
a2billing.php|4: (
a2billing.php|4: [usd] => dollars
a2billing.php|4: [mxn] => pesos
a2billing.php|4: [eur] => euros
a2billing.php|4: [all] => credit
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [ivr_voucher_prefixe] => 8
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: file:a2billing.php - line:75 - IDCONFIG : 4
a2billing.php|4: file:a2billing.php - line:76 - MODE : standard
a2billing.php|4: file:a2billing.php - line:88 - AGI Request:
a2billing.php|4: file:a2billing.php - line:89 - Array
a2billing.php|4: (
a2billing.php|4: [agi_request] => a2billing.php
a2billing.php|4: [agi_channel] => IAX2/test-2
a2billing.php|4: [agi_language] => en
a2billing.php|4: [agi_type] => IAX2
a2billing.php|4: [agi_uniqueid] => 1196720794.391
a2billing.php|4: [agi_callerid] => xxx
a2billing.php|4: [agi_calleridname] => Test User
a2billing.php|4: [agi_callingpres] => 1
a2billing.php|4: [agi_callingani2] => 0
a2billing.php|4: [agi_callington] => 0
a2billing.php|4: [agi_callingtns] => 0
a2billing.php|4: [agi_dnid] => 100
a2billing.php|4: [agi_rdnis] => unknown
a2billing.php|4: [agi_context] => access_numbers
a2billing.php|4: [agi_extension] => 100
a2billing.php|4: [agi_priority] => 1
a2billing.php|4: [agi_enhanced] => 0.0
a2billing.php|4: [agi_accountcode] => TESTACCOUNT
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: file:Class.A2Billing.php - line:601 - get_agi_request_parameter = xxx ; IAX2/test-2 ; 1196720794.391 ; TESTACCOUNT ; 100
a2billing.php|4: file:a2billing.php - line:138 - [ANSWER CALL]
a2billing.php|4: file:Class.A2Billing.php - line:1668 - SELECT credit, tariff, activated, inuse, simultaccess, typepaid, creditlimit, language, removeinterprefix, redial, enabl'
a2billing.php|4: file:Class.A2Billing.php - line:1675 - PREPAID-AUTH-FAIL
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
a2billing.php|4: file:a2billing.php - line:316 - [AUTHENTICATION FAILED (cia_res:-2)]
a2billing.php|4: file:a2billing.php - line:965 - [CALLBACK 1ST LEG]:[INFO FOR THE 1ST LEG - callback_username=
a2billing.php|4: file:Class.A2Billing.php - line:1797 - Requesting DTMF, CARDNUMBER_LENGTH_MAX 15
-- Playing 'prepaid-enter-pin-number' (language 'en')
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
a2billing.php|4: file:Class.A2Billing.php - line:1799 - RES DTMF : 7251
a2billing.php|4: file:Class.A2Billing.php - line:1803 - CARDNUMBER ::> 7251
a2billing.php|4: file:Class.A2Billing.php - line:1826 - QUERY = SELECT credit, tariff, activated, inuse, simultaccess, typepaid, creditlimit, language, removeinterprefix, redia'
a2billing.php|4: Array
a2billing.php|4: (
a2billing.php|4: [0] => Array
a2billing.php|4: (
a2billing.php|4: [0] => 0.00000
a2billing.php|4: [credit] => 0.00000
a2billing.php|4: [1] => 1
a2billing.php|4: [tariff] => 1
a2billing.php|4: [2] => t
a2billing.php|4: [activated] => t
a2billing.php|4: [3] => 0
a2billing.php|4: [inuse] => 0
a2billing.php|4: [4] => 0
a2billing.php|4: [simultaccess] => 0
a2billing.php|4: [5] => 0
a2billing.php|4: [typepaid] => 0
a2billing.php|4: [6] =>
a2billing.php|4: [creditlimit] =>
a2billing.php|4: [7] => en
a2billing.php|4: [language] => en
a2billing.php|4: [8] => 0
a2billing.php|4: [removeinterprefix] => 0
a2billing.php|4: [9] =>
a2billing.php|4: [redial] =>
a2billing.php|4: [10] => 1
a2billing.php|4: [enableexpire] => 1
a2billing.php|4: [11] => 1512317045
a2billing.php|4: [UNIX_TIMESTAMP(expirationdate)] => 1512317045
a2billing.php|4: [12] => 60
a2billing.php|4: [expiredays] => 60
a2billing.php|4: [13] => 0
a2billing.php|4: [nbused] => 0
a2billing.php|4: [14] => 0
a2billing.php|4: [UNIX_TIMESTAMP(firstusedate)] => 0
a2billing.php|4: [15] => 1196697845
a2billing.php|4: [UNIX_TIMESTAMP(cc_card.creationdate)] => 1196697845
a2billing.php|4: [16] => USD
a2billing.php|4: [currency] => USD
a2billing.php|4: [17] => testuser
a2billing.php|4: [lastname] => testuser
a2billing.php|4: [18] => test
a2billing.php|4: [firstname] => test
a2billing.php|4: [19] =>
[email protected] a2billing.php|4: [email] =>
[email protected] a2billing.php|4: [20] => 2312245492
a2billing.php|4: [uipass] => 2312245492
a2billing.php|4: [21] => 14
a2billing.php|4: [id] => 14
a2billing.php|4: [22] => -1
a2billing.php|4: [id_campaign] => -1
a2billing.php|4: [23] => 14
a2billing.php|4: [24] => 8042
a2billing.php|4: [useralias] => 8042
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: file:Class.A2Billing.php - line:1898 - [SET LANGUAGE() en]
a2billing.php|4: file:Class.A2Billing.php - line:1954 - [ERROR CHECK CARD : prepaid-zero-balance (cardnumber:7251)]
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
pbx001*CLI>
a2billing.php|4: file:a2billing.php - line:997 - [CALLBACK 1ST LEG]:[ERROR - AUTHENTICATION USERNAME]
-- AGI Script a2billing.php completed, returning 0
-- Hungup 'IAX2/test-2'
Are activated, but I don't know if I'm using them properly, this is what I have in my extensions.conf
If I call a2billing.php with voucher mode, (a2billing.php|4|voucher), A2B asks right the way for a voucher number, but obviously it does not add the credit to the correct cardnumber, becasue it doesn't know it yet!