Hello,
it seems that there is a bug for charging the 1st leg with the callback feature in version 1.8.1
I tried to make the 1st leg charged with all-callback and cid-callback, when the destination call is answered or not... without success.
Here is an example of that with the context cid-callback. The scenario is :
1. I call a2billing with the number 0033641661111.
2. This phone number is associated to the customer card 3498117810 (with a balance of 9,532 usd)
3. a2billing calling back me
4. I enter the destination number 0033641662222 and I'm connected
5. After 19 sec I finish the call
Here are the rate list for the customer 3498117810:
Code:
PREFIX DESTINATION SR
00336 France Mobile 0.08400
00339 France OVH 0.06000
Here are the callback logs i get in the CDRs :
[img]http://www.chab.info/callback_logs.png
[/img]
As you see only the 2nd leg is charged, and when the call is not answered nothing is charged.
Here is the agi-conf2 config I have :
Code:
Bill Callback callback_bill_1stleg_ifcall_notconnected Yes
Auto Set CLID auto_setcallerid Yes
Force CLID force_callerid
CLID Sanitize cid_sanitize 0
CLID Enable cid_enable No
FailOver LCR/LCD Prefix failover_lc_prefix No
Auto CLID cid_auto_assign_card_to_cid Yes
Auto CLID Security callerid_authentication_over_cardnumber No
Below is a part of the logs for the 19 seconds call, at the end we can see that there is a problem because the rate-engine cannot find the called number of the 1st leg : CC_asterisk_rate-engine: (1, )
Why the 1st number (0033641661111) isn't identify by the rate engine for the 1st leg ? is it a bug or a bad configuration of my agi-conf ???
Thanks in advance for your help !
Quote:
a2billing.php,2,callback: file:a2billing.php - line:126 - uniqueid: - [INFO : A2Billing - Version 1.8.1 (Corylus)]
a2billing.php,2,callback: file:a2billing.php - line:1136 - uniqueid:1294910305.134 - [CALLBACK]:[TRY : callingcard_ivr_authenticate]
a2billing.php,2,callback: file:Class.A2Billing.php - line:2591 - uniqueid:1294910305.134 - - Account code ::> 3498117810
a2billing.php,2,callback: file:Class.A2Billing.php - line:2681 - uniqueid:1294910305.134 - [credit=9.53200 :: tariff=1 :: status=1 :: isused=0 :: simultaccess=1 :: typepaid=0 :: creditlimit= :: language=en]
a2billing.php,2,callback: file:Class.A2Billing.php - line:747 - uniqueid:1294910305.134 - [CARD STATUS UPDATE]
a2billing.php,2,callback: file:Class.A2Billing.php - line:756 - uniqueid:1294910305.134 - [QUERY USING CARD UPDATE::> UPDATE cc_card SET inuse=inuse+1, credit=credit-0.25 WHERE username='3498117810']
a2billing.php,2,callback: file:a2billing.php - line:1143 - uniqueid:1294910305.134 - [CALLBACK]:[Start]
a2billing.php,2,callback: file:Class.A2Billing.php - line:2264 - uniqueid:1294910305.134 - [AUTO SetCallerID]
a2billing.php,2,callback: file:Class.A2Billing.php - line:2270 - uniqueid:1294910305.134 - [REQUESTED SetCallerID : 0033641661111]
a2billing.php,2,callback: file:Class.A2Billing.php - line:2282 - uniqueid:1294910305.134 - [EXEC SetCallerID : 0033641661111]
-- <SIP/OVH-00000086> Playing 'prepaid-enter-dest.gsm' (language 'es')
a2billing.php,2,callback: file:Class.A2Billing.php - line:822 - uniqueid:1294910305.134 - RES DTMF : 0033641662222
a2billing.php,2,callback: file:Class.A2Billing.php - line:893 - uniqueid:1294910305.134 - DESTINATION ::> 0033641662222
a2billing.php,2,callback: file:Class.A2Billing.php - line:900 - uniqueid:1294910305.134 - RULES APPLY ON DESTINATION ::> 0033641662222
a2billing.php,2,callback: file:Class.RateEngine.php - line:98 - uniqueid:1294910305.134 - [CC_asterisk_rate-engine: (1, 0033641662222)]
a2billing.php,2,callback: file:Class.RateEngine.php - line:120 - uniqueid:1294910305.134 - [CC_asterisk_rate-engine - CALLERID : 0033641661111]
a2billing.php,2,callback: file:Class.RateEngine.php - line:182 - uniqueid:1294910305.134 - [rate-engine: Count Total result 1]
a2billing.php,2,callback: file:Class.RateEngine.php - line:267 - uniqueid:1294910305.134 - [CC_asterisk_rate-engine: Count Total result 1]
a2billing.php,2,callback: file:Class.RateEngine.php - line:268 - uniqueid:1294910305.134 - [CC_asterisk_rate-engine: number_trunk 1]
a2billing.php,2,callback: file:Class.A2Billing.php - line:1016 - uniqueid:1294910305.134 - OK - RESFINDRATE::> 1
a2billing.php,2,callback: file:Class.RateEngine.php - line:282 - uniqueid:1294910305.134 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT (8.532)]
a2billing.php,2,callback: file:Class.RateEngine.php - line:288 - uniqueid:1294910305.134 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT: k=0 - res_calcultimeout:6060]
a2billing.php,2,callback: file:Class.A2Billing.php - line:1028 - uniqueid:1294910305.134 - RES_ALL_CALCULTIMEOUT ::> 1
a2billing.php,2,callback: file:Class.A2Billing.php - line:1727 - uniqueid:1294910305.134 - TIMEOUT::> 6060 : minutes=101 - seconds=0
-- AGI Script Executing Application: (DIAL) Options: (SIP/OVH/0033641662222|60|HRrL(6060000:61000:30000))
-- Called OVH/0033641662222|60|HRrL(6060000:61000:30000)
-- SIP/OVH-00000087 is ringing
-- SIP/OVH-00000087 is making progress passing it to SIP/OVH-00000086
-- SIP/OVH-00000087 is ringing
-- SIP/OVH-00000087 is making progress passing it to SIP/OVH-00000086
-- SIP/OVH-00000087 answered SIP/OVH-00000086
-- Packet2Packet bridging SIP/OVH-00000086 and SIP/OVH-00000087
-- Executing [h@a2billing-callback:1] Hangup("SIP/OVH-00000086", "") in new stack
== Spawn extension (a2billing-callback, h, 1) exited non-zero on 'SIP/OVH-00000086'
a2billing.php,2,callback: file:Class.RateEngine.php - line:1265 - uniqueid:1294910305.134 - DIAL SIP/OVH/0033641662222|60|HRrL(6060000:61000:30000)
a2billing.php,2,callback: file:Class.RateEngine.php - line:1151 - uniqueid:1294910305.134 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse=inuse-1 WHERE id_trunk='2']
a2billing.php,2,callback: file:Class.RateEngine.php - line:1413 - uniqueid:1294910305.134 - -> dialstatus : ANSWER, answered time is 19
a2billing.php,2,callback:
a2billing.php,2,callback: file:Class.RateEngine.php - line:1417 - uniqueid:1294910305.134 - [USEDRATECARD=0]
a2billing.php,2,callback: file:Class.RateEngine.php - line:953 - uniqueid:1294910305.134 - :[sessiontime:19 - id_cc_package_offer:-1 - package2apply:]
a2billing.php,2,callback:
a2billing.php,2,callback:
a2billing.php,2,callback:
a2billing.php,2,callback:
a2billing.php,2,callback:
a2billing.php,2,callback:
a2billing.php,2,callback:
a2billing.php,2,callback:
a2billing.php,2,callback: file:Class.RateEngine.php - line:730 - uniqueid:1294910305.134 - [CC_RATE_ENGINE_CALCULCOST: K=0 - CALLDURATION:19 - freetimetocall_used=0]
a2billing.php,2,callback: file:Class.RateEngine.php - line:808 - uniqueid:1294910305.134 - [TEMP - CC_RATE_ENGINE_CALCULCOST: 1. COST: -0.084]:[ (60/60) * 0.084 ]
a2billing.php,2,callback: file:Class.RateEngine.php - line:893 - uniqueid:1294910305.134 - [CC_RATE_ENGINE_CALCULCOST: K=0 - BUYCOST:-0.06 - SELLING COST:-0.084]
a2billing.php,2,callback: file:Class.RateEngine.php - line:1036 - uniqueid:1294910305.134 - [CC_RATE_ENGINE_UPDATESYSTEM: usedratecard K=0 - (sessiontime=19 :: dialstatus=ANSWER :: buycost=0.06 :: cost=-0.084 : signe_cc_call=+: signe=-)]
a2billing.php,2,callback: file:Class.RateEngine.php - line:1101 - uniqueid:1294910305.134 - [CC_asterisk_stop : SQL: DONE : result=1]
a2billing.php,2,callback: file:Class.RateEngine.php - line:1102 - uniqueid:1294910305.134 - [CC_asterisk_stop : SQL: INSERT INTO cc_call (uniqueid, sessionid, card_id, nasipaddress, starttime, sessiontime, real_sessiontime, calledstation, terminatecauseid, stoptime, sessionbill, id_tariffgroup, id_tariffplan, id_ratecard, id_trunk, src, sipiax, buycost, id_card_package_offer, dnid, destination) VALUES ('1294910305.134', 'SIP/OVH-00000086', '1', '', SUBDATE(CURRENT_TIMESTAMP, INTERVAL 19 SECOND) , '19', '19', '0033641662222', 1, now() , '+0.084', '1', '3', '20', '2', '0033641661111', '0', '0.06', NULL, '', '336')]
a2billing.php,2,callback: file:Class.RateEngine.php - line:1126 - uniqueid:1294910305.134 - [CC_asterisk_stop 1.2: SQL: UPDATE cc_card SET credit= credit-0.084 , lastuse=now(), nbused=nbused+1 WHERE username='3498117810']
a2billing.php,2,callback: file:Class.RateEngine.php - line:1131 - uniqueid:1294910305.134 - UPDATE cc_trunk SET secondusedreal = secondusedreal + 19 WHERE id_trunk='2'
a2billing.php,2,callback: file:Class.RateEngine.php - line:1135 - uniqueid:1294910305.134 - UPDATE cc_tariffplan SET secondusedreal = secondusedreal + 19 WHERE id='3'
a2billing.php,2,callback: file:a2billing.php - line:1192 - uniqueid:1294910305.134 - [CALLBACK]:[a2billing end loop num_try] RateEngine->usedratecard=0
a2billing.php,2,callback: file:Class.A2Billing.php - line:747 - uniqueid:1294910305.134 - [CARD STATUS UPDATE]
a2billing.php,2,callback: file:Class.A2Billing.php - line:756 - uniqueid:1294910305.134 - [QUERY USING CARD UPDATE::> UPDATE cc_card SET inuse=inuse-1, credit=credit+0.25 WHERE username='3498117810']
a2billing.php,2,callback: file:a2billing.php - line:1551 - uniqueid:1294910305.134 - [CALLBACK 1ST LEG]:[INFO FOR THE 1ST LEG - callback_username=3498117810
a2billing.php,2,callback: file:a2billing.php - line:1552 - uniqueid:1294910305.134 - [CALLBACK 1ST LEG]:[TRY : callingcard_ivr_authenticate]
a2billing.php,2,callback: file:Class.A2Billing.php - line:2591 - uniqueid:1294910305.134 - - Account code ::> 3498117810
a2billing.php,2,callback: file:Class.A2Billing.php - line:2608 - uniqueid:1294910305.134 - - 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='3498117810'
a2billing.php,2,callback: file:Class.A2Billing.php - line:2681 - uniqueid:1294910305.134 - [credit=9.44800 :: tariff=1 :: status=1 :: isused=0 :: simultaccess=1 :: typepaid=0 :: creditlimit= :: language=en]
a2billing.php,2,callback: file:Class.A2Billing.php - line:747 - uniqueid:1294910305.134 - [CARD STATUS UPDATE]
a2billing.php,2,callback: file:Class.A2Billing.php - line:756 - uniqueid:1294910305.134 - [QUERY USING CARD UPDATE::> UPDATE cc_card SET inuse=inuse+1, credit=credit-0.25 WHERE username='3498117810']
a2billing.php,2,callback: file:a2billing.php - line:1564 - uniqueid:1294910305.134 - [CALLBACK 1ST LEG]:[MAKE BILLING FOR THE 1ST LEG - TARIFF:1;CALLED=]
a2billing.php,2,callback: file:Class.RateEngine.php - line:98 - uniqueid:1294910305.134 - [CC_asterisk_rate-engine: (1, )]
a2billing.php,2,callback: file:Class.RateEngine.php - line:120 - uniqueid:1294910305.134 - [CC_asterisk_rate-engine - CALLERID : 0033641661111]
a2billing.php,2,callback: file:a2billing.php - line:1595 - uniqueid:1294910305.134 - [CALLBACK 1ST LEG]:[ERROR - BILLING FOR THE 1ST LEG - rate_engine_findrates: CALLED= - RateEngine->usedratecard=0]
a2billing.php,2,callback: file:Class.A2Billing.php - line:747 - uniqueid:1294910305.134 - [CARD STATUS UPDATE]
a2billing.php,2,callback: file:Class.A2Billing.php - line:756 - uniqueid:1294910305.134 - [QUERY USING CARD UPDATE::> UPDATE cc_card SET inuse=inuse-1, credit=credit+0.25 WHERE username='3498117810']
-- <SIP/OVH-00000086>AGI Script a2billing.php completed, returning 0
-- Executing [h@a2billing-callback:1] Hangup("SIP/OVH-00000086", "") in new stack
== Spawn extension (a2billing-callback, h, 1) exited non-zero on 'SIP/OVH-00000086'
Debian-50-lenny-32-minimal*CLI>