asterisk2billing.org http://forum.asterisk2billing.org/ |
|
Customers suddenly getting "returning 4" message. http://forum.asterisk2billing.org/viewtopic.php?f=33&t=12560 |
Page 1 of 1 |
Author: | gromm [ Mon Jul 18, 2016 5:13 pm ] |
Post subject: | Customers suddenly getting "returning 4" message. |
Hi everyone. Just this past Friday, we started getting complaints that our customers couldn't dial long distance. Incoming calls that go through A2Billing work, local (free) outbound calls that don't go through A2Billing work, but I can neither use the A2billing long distance simulator, nor can anyone dial out. When I set A2Billing's verbosity and debug level to 4, I get the following (sensitive information redacted): -- Executing [1604NXXXXXX@kelowna:1] NoOp("SIP/XXXXXXXXXA-000004da", "Callerid: 250NXXXXXX Customer Name") in new stack -- Executing [1604NXXXXXX@kelowna:2] NoOp("SIP/XXXXXXXXXA-000004da", "CIDBlock: """) in new stack -- Executing [1604NXXXXXX@kelowna:3] Set("SIP/XXXXXXXXXA-000004da", "DYNAMIC_FEATURES=nway-start") in new stack [Jul 18 09:52:19] WARNING[5014]: ast_expr2.fl:468 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected '=', expecting $end; Input: = "1" ^ [Jul 18 09:52:19] WARNING[5014]: ast_expr2.fl:472 ast_yyerror: If you have questions, please refer to https://wiki.asterisk.org/wiki/display/ ... +Variables -- Executing [1604NXXXXXX@kelowna:4] GosubIf("SIP/XXXXXXXXXA-000004da", "?blockcid,s,2") in new stack -- Executing [1604NXXXXXX@kelowna:5] Set("SIP/XXXXXXXXXA-000004da", "CDR(userfield)=207.81.148.91") in new stack -- Executing [1604NXXXXXX@kelowna:6] Goto("SIP/XXXXXXXXXA-000004da", "a2billing,1604NXXXXXX,1") in new stack -- Goto (a2billing,1604NXXXXXX,1) -- Executing [1604NXXXXXX@a2billing:1] Set("SIP/XXXXXXXXXA-000004da", "A2BACCOUNTCODE=XXXXXXXXX") in new stack -- Executing [1604NXXXXXX@a2billing:2] MYSQL("SIP/XXXXXXXXXA-000004da", "Connect CONNID localhost a2billinguser Pdj2sjhah# mya2billing2") in new stack -- Executing [1604NXXXXXX@a2billing:3] MYSQL("SIP/XXXXXXXXXA-000004da", "Query RESULTID 1 SELECT `max_concurrent` FROM `cc_card` WHERE `username` = 'XXXXXXXXX'") in new stack -- Executing [1604NXXXXXX@a2billing:4] GotoIf("SIP/XXXXXXXXXA-000004da", "0?lbl_a2billing_0:") in new stack -- Executing [1604NXXXXXX@a2billing:5] MYSQL("SIP/XXXXXXXXXA-000004da", "Fetch vdp_tmp 2 MAXCHANNELS") in new stack -- Executing [1604NXXXXXX@a2billing:6] GotoIf("SIP/XXXXXXXXXA-000004da", "0?lbl_a2billing_0:") in new stack -- Executing [1604NXXXXXX@a2billing:7] NoOp("SIP/XXXXXXXXXA-000004da", "Maximum Channels Allowed = 1") in new stack -- Executing [1604NXXXXXX@a2billing:8] NoOp("SIP/XXXXXXXXXA-000004da", "Channels in use = 0") in new stack -- Executing [1604NXXXXXX@a2billing:9] Set("SIP/XXXXXXXXXA-000004da", "CURRENTCHANNELS=0") in new stack -- Executing [1604NXXXXXX@a2billing:10] Set("SIP/XXXXXXXXXA-000004da", "REMAININGCHANNELS=1.000000") in new stack -- Executing [1604NXXXXXX@a2billing:11] NoOp("SIP/XXXXXXXXXA-000004da", "Remaining channels available = 1.000000") in new stack -- Executing [1604NXXXXXX@a2billing:12] Set("SIP/XXXXXXXXXA-000004da", "GROUP(OUT)=XXXXXXXXX") in new stack -- Executing [1604NXXXXXX@a2billing:13] GotoIf("SIP/XXXXXXXXXA-000004da", "1?:lbl_a2billing_1") in new stack -- Executing [1604NXXXXXX@a2billing:14] NoOp("SIP/XXXXXXXXXA-000004da", "Call Allowed as channels available") in new stack -- Executing [1604NXXXXXX@a2billing:15] MYSQL("SIP/XXXXXXXXXA-000004da", "Clear 2") in new stack -- Executing [1604NXXXXXX@a2billing:16] MYSQL("SIP/XXXXXXXXXA-000004da", "Disconnect 1") in new stack -- Executing [1604NXXXXXX@a2billing:17] AGI("SIP/XXXXXXXXXA-000004da", "a2billing.php,1") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php a2billing.php,1: file:Class.A2Billing.php - line:586 - uniqueid: - A2Billing AGI internal configuration: a2billing.php,1: file:Class.A2Billing.php - line:587 - uniqueid: - Array a2billing.php,1: ( a2billing.php,1: [description] => agi-config a2billing.php,1: [asterisk_version] => 1_8 a2billing.php,1: [answer_call] => 0 a2billing.php,1: [play_audio] => 0 a2billing.php,1: [say_goodbye] => 0 a2billing.php,1: [play_menulanguage] => 0 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] => 0 a2billing.php,1: [notenoughcredit_assign_newcardnumber_cid] => 0 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] => 1 a2billing.php,1: [force_callplan_id] => a2billing.php,1: [say_balance_after_auth] => 1 a2billing.php,1: [say_balance_after_call] => 0 a2billing.php,1: [say_rateinitial] => 0 a2billing.php,1: [say_timetocall] => 1 a2billing.php,1: [auto_setcallerid] => 1 a2billing.php,1: [force_callerid] => a2billing.php,1: [cid_sanitize] => 0 a2billing.php,1: [cid_enable] => 0 a2billing.php,1: [cid_askpincode_ifnot_callerid] => 1 a2billing.php,1: [failover_lc_prefix] => 0 a2billing.php,1: [cid_auto_assign_card_to_cid] => 1 a2billing.php,1: [callerid_authentication_over_cardnumber] => 0 a2billing.php,1: [sip_iax_friends] => 0 a2billing.php,1: [sip_iax_pstn_direct_call_prefix] => 555 a2billing.php,1: [sip_iax_pstn_direct_call] => 0 a2billing.php,1: [ivr_voucher] => 0 a2billing.php,1: [ivr_voucher_prefix] => 8 a2billing.php,1: [jump_voucher_if_min_credit] => 0 a2billing.php,1: [dialcommand_param] => |60|HR a2billing.php,1: [dialcommand_param_sipiax_friend] => |35|Hit a2billing.php,1: [switchdialcommand] => 0 a2billing.php,1: [failover_recursive_limit] => 2 a2billing.php,1: [maxtime_tocall_negatif_free_route] => 5400 a2billing.php,1: [send_reminder] => 0 a2billing.php,1: [record_call] => 0 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: [callback_bill_1stleg_ifcall_notconnected] => 1 a2billing.php,1: [international_prefixes] => Array a2billing.php,1: ( a2billing.php,1: [0] => 011 a2billing.php,1: [1] => 00 a2billing.php,1: ) a2billing.php,1: a2billing.php,1: [extracharge_did] => Array a2billing.php,1: ( a2billing.php,1: [0] => 1800 a2billing.php,1: [1] => 1900 a2billing.php,1: ) a2billing.php,1: a2billing.php,1: [extracharge_fee] => Array a2billing.php,1: ( a2billing.php,1: [0] => 0 a2billing.php,1: [1] => 0 a2billing.php,1: ) a2billing.php,1: a2billing.php,1: [extracharge_buyfee] => Array a2billing.php,1: ( a2billing.php,1: [0] => 0 a2billing.php,1: [1] => 0 a2billing.php,1: ) a2billing.php,1: a2billing.php,1: [maxtime_tounlimited_calls] => 5400 a2billing.php,1: [maxtime_tofree_calls] => 5400 a2billing.php,1: [callplan_deck_minute_threshold] => a2billing.php,1: [conf_order_menulang] => en:fr:es a2billing.php,1: [disable_announcement_seconds] => 0 a2billing.php,1: [verbosity_level] => 4 a2billing.php,1: [logging_level] => 4 a2billing.php,1: [dial_balance_reservation] => 0 a2billing.php,1: [callerid_update] => 0 a2billing.php,1: [local_dialing_addcountryprefix] => 0 a2billing.php,1: [dialcommand_param_call_2did] => |35|Hit a2billing.php,1: [max_call_call_2_did] => 3600 a2billing.php,1: [cid_auto_create_card] => 0 a2billing.php,1: [cid_auto_create_card_len] => 10 a2billing.php,1: [cid_auto_create_card_typepaid] => POSTPAID a2billing.php,1: [cid_auto_create_card_credit] => 0 a2billing.php,1: [cid_auto_create_card_credit_limit] => 100 a2billing.php,1: [cid_auto_create_card_tariffgroup] => 1 a2billing.php,1: [busy_timeout] => 30 a2billing.php,1: [callback_reduce_balance] => 1 a2billing.php,1: [ivr_enable_locking_option] => 0 a2billing.php,1: [ivr_enable_account_information] => 0 a2billing.php,1: [ivr_enable_ivr_speeddial] => 0 a2billing.php,1: [callback_beep_to_enter_destination] => 0 a2billing.php,1: [cid_prompt_callback_confirm_phonenumber] => 0 a2billing.php,1: [lcr_mode] => 0 a2billing.php,1: [currency_cents_association] => Array a2billing.php,1: ( a2billing.php,1: [0] => usd:prepaid-cents a2billing.php,1: [1] => eur:prepaid-cents a2billing.php,1: [2] => gbp:prepaid-pence a2billing.php,1: [3] => all:credit a2billing.php,1: ) a2billing.php,1: a2billing.php,1: [logger_enable] => 1 a2billing.php,1: [log_file] => /var/log/a2billing/a2billing.log a2billing.php,1: [dialcommand_param_call_2did ] => |30|HL(3600000:61000:30000) 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: [currency_cents_association_internal] => Array a2billing.php,1: ( a2billing.php,1: [usd] => prepaid-cents a2billing.php,1: [eur] => prepaid-cents a2billing.php,1: [gbp] => prepaid-pence a2billing.php,1: [all] => credit a2billing.php,1: ) a2billing.php,1: a2billing.php,1: [file_conf_enter_menulang] => prepaid-menulang a2billing.php,1: [ivr_voucher_prefixe] => 8 a2billing.php,1: [cheat_on_announcement_time] => 0 a2billing.php,1: ) a2billing.php,1: a2billing.php,1: file:a2billing.php - line:117 - uniqueid: - IDCONFIG : 1 a2billing.php,1: file:a2billing.php - line:118 - uniqueid: - MODE : standard a2billing.php,1: file:a2billing.php - line:130 - uniqueid: - AGI Request: a2billing.php,1: Array a2billing.php,1: ( a2billing.php,1: [agi_request] => a2billing.php a2billing.php,1: [agi_channel] => SIP/XXXXXXXXXA-000004da a2billing.php,1: [agi_language] => en a2billing.php,1: [agi_type] => SIP a2billing.php,1: [agi_uniqueid] => 1468860739.1399 a2billing.php,1: [agi_version] => 1.8.32.3 a2billing.php,1: [agi_callerid] => 250NXXXXXX a2billing.php,1: [agi_calleridname] => Customer Name 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] => 1604NXXXXXX a2billing.php,1: [agi_rdnis] => unknown a2billing.php,1: [agi_context] => a2billing a2billing.php,1: [agi_extension] => 1604NXXXXXX a2billing.php,1: [agi_priority] => 17 a2billing.php,1: [agi_enhanced] => 0.0 a2billing.php,1: [agi_accountcode] => XXXXXXXXX a2billing.php,1: [agi_threadid] => -1296041152 a2billing.php,1: [agi_arg_1] => 1 a2billing.php,1: ) a2billing.php,1: a2billing.php,1: file:a2billing.php - line:131 - uniqueid: - [INFO : A2Billing - v2.0.14] a2billing.php,1: file:Class.A2Billing.php - line:736 - uniqueid:1468860739.1399 - get_agi_request_parameter = 250NXXXXXX ; SIP/XXXXXXXXXA-000004da ; 1468860739.1399 ; XXXXXXXXX ; 1604NXXXXXX a2billing.php,1: file:a2billing.php - line:169 - uniqueid:1468860739.1399 - [NO ANSWER CALL] a2billing.php,1: file:Class.A2Billing.php - line:2887 - uniqueid:1468860739.1399 - - Account code ::> XXXXXXXXX a2billing.php,1: file:Class.A2Billing.php - line:2904 - uniqueid:1468860739.1399 - - Retrieve account info SQL ::> 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, status, voicemail_permitted, voicemail_activated, cc_card.restriction, cc_country.countryprefix FROM cc_card LEFT JOIN cc_tariffgroup ON tariff = cc_tariffgroup.id LEFT JOIN cc_country ON cc_card.country = cc_country.countrycode WHERE username = 'XXXXXXXXX' a2billing.php,1: file:Class.A2Billing.php - line:2973 - uniqueid:1468860739.1399 - [SET CHANNEL(language) en] a2billing.php,1: file:Class.A2Billing.php - line:2977 - uniqueid:1468860739.1399 - [credit=100 :: tariff=2 :: status=1 :: isused=0 :: simultaccess=1 :: typepaid=1 :: creditlimit=100 :: language=en] a2billing.php,1: file:Class.A2Billing.php - line:768 - uniqueid:1468860739.1399 - [CARD STATUS UPDATE] a2billing.php,1: file:Class.A2Billing.php - line:777 - uniqueid:1468860739.1399 - [QUERY USING CARD UPDATE::> UPDATE cc_card SET inuse = inuse + 1, credit = credit - 0 WHERE username = 'XXXXXXXXX'] a2billing.php,1: file:Class.A2Billing.php - line:3266 - uniqueid:1468860739.1399 - [A2Billing] SAY BALANCE : 100 a2billing.php,1: a2billing.php,1: file:Class.A2Billing.php - line:2061 - uniqueid:1468860739.1399 - [CURRENCY : CAD] a2billing.php,1: file:Class.A2Billing.php - line:2071 - uniqueid:1468860739.1399 - [BEFORE: 100 SPRINTF : 100.00] a2billing.php,1: file:a2billing.php - line:181 - uniqueid:1468860739.1399 - [TRY : callingcard_ivr_authenticate] a2billing.php,1: file:Class.A2Billing.php - line:2544 - uniqueid:1468860739.1399 - [AUTO SetCallerID] a2billing.php,1: file:Class.A2Billing.php - line:2561 - uniqueid:1468860739.1399 - [REQUESTED SetCallerID : 250NXXXXXX] a2billing.php,1: file:Class.A2Billing.php - line:2574 - uniqueid:1468860739.1399 - [EXEC SetCallerID : 250NXXXXXX] a2billing.php,1: file:a2billing.php - line:194 - uniqueid:1468860739.1399 - [CHANNEL STATUS : 4 = Line is ringing] a2billing.php,1: [CREDIT : 100][CREDIT MIN_CREDIT_2CALL : 0] a2billing.php,1: file:a2billing.php - line:382 - uniqueid:1468860739.1399 - TARIFF ID->2 a2billing.php,1: file:Class.A2Billing.php - line:827 - uniqueid:1468860739.1399 - use_dnid:1 && (!in_array:) && len_dnid:(11 || len_exten:11 ) && (try_num:0) a2billing.php,1: file:Class.A2Billing.php - line:836 - uniqueid:1468860739.1399 - [USE_DNID DESTINATION ::> 1604NXXXXXX] a2billing.php,1: file:Class.A2Billing.php - line:902 - uniqueid:1468860739.1399 - [CALL 2 DID] a2billing.php,1: file:Class.A2Billing.php - line:911 - uniqueid:1468860739.1399 - SELECT cc_did.id, iduser FROM cc_did, cc_card WHERE cc_card.status=1 and cc_card.id = iduser and cc_did.activated = 1 and did = '1604NXXXXXX' AND cc_did.startingdate<= CURRENT_TIMESTAMP AND (cc_did.expirationdate > CURRENT_TIMESTAMP OR cc_did.expirationdate IS NULL OR cc_did.expirationdate = '0000-00-00 00:00:00') a2billing.php,1: file:Class.A2Billing.php - line:917 - uniqueid:1468860739.1399 - DESTINATION ::> 1604NXXXXXX a2billing.php,1: file:Class.A2Billing.php - line:924 - uniqueid:1468860739.1399 - RULES APPLY ON DESTINATION ::> 1604NXXXXXX a2billing.php,1: file:Class.A2Billing.php - line:3728 - uniqueid:1468860739.1399 - [SAVING DESTINATION FOR REDIAL: SQL: UPDATE cc_card SET redial = '1604NXXXXXX' WHERE username = 'XXXXXXXXX']:[result: 1] a2billing.php,1: file:Class.RateEngine.php - line:97 - uniqueid:1468860739.1399 - [CC_asterisk_rate-engine: (2, 1604NXXXXXX)] a2billing.php,1: file:Class.RateEngine.php - line:118 - uniqueid:1468860739.1399 - [CC_asterisk_rate-engine - CALLERID : 250NXXXXXX] a2billing.php,1: file:Class.RateEngine.php - line:179 - uniqueid:1468860739.1399 - [rate-engine: Count Total result 1] a2billing.php,1: file:Class.RateEngine.php - line:344 - uniqueid:1468860739.1399 - [CC_asterisk_rate-engine: Count Total result 0] a2billing.php,1: file:Class.RateEngine.php - line:345 - uniqueid:1468860739.1399 - [CC_asterisk_rate-engine: number_trunk 0] a2billing.php,1: file:Class.A2Billing.php - line:1041 - uniqueid:1468860739.1399 - OK - RESFINDRATE::> 1 a2billing.php,1: file:Class.RateEngine.php - line:358 - uniqueid:1468860739.1399 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT (100)] a2billing.php,1: file:Class.A2Billing.php - line:1054 - uniqueid:1468860739.1399 - RES_ALL_CALCULTIMEOUT ::> a2billing.php,1: file:a2billing.php - line:560 - uniqueid:1468860739.1399 - ANSWER fct callingcard_ivr authorize:> -1 a2billing.php,1: file:Class.A2Billing.php - line:768 - uniqueid:1468860739.1399 - [CARD STATUS UPDATE] a2billing.php,1: file:Class.A2Billing.php - line:777 - uniqueid:1468860739.1399 - [QUERY USING CARD UPDATE::> UPDATE cc_card SET inuse = inuse - 1, credit = credit + 0 WHERE username = 'XXXXXXXXX'] -- <SIP/XXXXXXXXXA-000004da>AGI Script a2billing.php completed, returning 4 == Spawn extension (a2billing, 1604NXXXXXX, 17) exited non-zero on 'SIP/XXXXXXXXXA-000004da' Also, this is an important result from our database for this call: Code: mysql> 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, status, voicemail_permitted, voicemail_activated, cc_card.restriction, cc_country.countryprefix FROM cc_card LEFT JOIN cc_tariffgroup ON tariff = cc_tariffgroup.id LEFT JOIN cc_country ON cc_card.country = cc_country.countrycode WHERE username = '1552578646'\G
*************************** 1. row *************************** credit: 0.00000 tariff: 2 activated: f inuse: 0 simultaccess: 1 typepaid: 1 creditlimit: 100 language: en removeinterprefix: 0 redial: 1604XXXXXXX enableexpire: 0 UNIX_TIMESTAMP(expirationdate): 1777481968 expiredays: 0 nbused: 214 UNIX_TIMESTAMP(firstusedate): 1462396979 UNIX_TIMESTAMP(cc_card.creationdate): 1461949448 currency: CAD lastname: User firstname: Name email: uipass: 86273p9rb7jf2bex9sfi id_campaign: -1 id: 4724 useralias: 989103469510104 status: 0 voicemail_permitted: 0 voicemail_activated: 1 restriction: 0 countryprefix: 1 |
Author: | gromm [ Mon Jul 18, 2016 5:53 pm ] |
Post subject: | Re: Customers suddenly getting "returning 4" message. |
This appears to have something to do with the calculation that determines if a call can be made with the remaining credit on a postpaid card. In the example above, I see this output: Code: a2billing.php,1: file:Class.A2Billing.php - line:1041 - uniqueid:1468860739.1399 - OK - RESFINDRATE::> 1 a2billing.php,1: file:Class.RateEngine.php - line:358 - uniqueid:1468860739.1399 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT (100)] a2billing.php,1: file:Class.A2Billing.php - line:1054 - uniqueid:1468860739.1399 - RES_ALL_CALCULTIMEOUT ::> While in a call that actually works, I see this: Code: a2billing.php,1: file:Class.A2Billing.php - line:1041 - uniqueid:1468863044.1899 - OK - RESFINDRATE::> 1 a2billing.php,1: file:Class.RateEngine.php - line:358 - uniqueid:1468863044.1899 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT (193.0776)] a2billing.php,1: file:Class.RateEngine.php - line:364 - uniqueid:1468863044.1899 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT: k=0 - res_calcultimeout:482694] a2billing.php,1: file:Class.A2Billing.php - line:1054 - uniqueid:1468863044.1899 - RES_ALL_CALCULTIMEOUT ::> 1 Both accounts have a balance owing less than the maximum balance allowed. In the case of the customer that doesn't work, their balance is currently 0. Both accounts are set to postpaid account types. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |