Local Channel not billed

Hi,

I am trying to use CallBack, the problem is A2Billing not billing leg A (the leg that calling back to the caller).
The PBX script set the lag A to Local channel and send it to a2b DeadAGI.
A2Billing showed both CDR’s, Legs A and B both are with ANSWER status but on Leg A the duration is 00:00 and not charging the account.

Following are the logs and context:

[from-callback]
exten => _0.,1,Answer
exten => _0.,2,Wait(2)
exten => _0.,3,Set(CALLERID(dnid)=${EXTEN})
exten => _0.,4,Set(CALLERID(num)=${EXTEN})
exten => _0.,5,DeadAGI(a2billing.php|1)
exten => _0.,6,Wait(2)
exten => _0.,7,Hangup

Oct 7 11:08:42] – Executing [[email protected]:1] Goto(“SIP/82.111.11.11-b785fe28”, “callback|1|1”) in new stack
[Oct 7 11:08:42] – Goto (callback,1,1)
[Oct 7 11:08:42] – Executing [[email protected]:1] Set(“SIP/82.111.11.11-b785fe28”, “CALL=0540000000”) in new stack
[Oct 7 11:08:42] – Executing [[email protected]:2] Set(“SIP/82.111.11.11-b785fe28”, “DESTINATION=opendisa.5555578.1”) in new stack
[Oct 7 11:08:42] – Executing [[email protected]:3] Set(“SIP/82.111.11.11-b785fe28”, “SLEEP=7”) in new stack
[Oct 7 11:08:42] – Executing [[email protected]:4] System(“SIP/82.111.11.11-b785fe28”, “/var/lib/asterisk/bin/callback 0540000000 opendisa.5555578.1 7 &”) in new stack
[Oct 7 11:08:42] – Executing [[email protected]:5] Hangup(“SIP/82.111.11.11-b785fe28”, “”) in new stack
[Oct 7 11:08:42] == Spawn extension (callback, 1, 5) exited non-zero on ‘SIP/82.111.11.11-b785fe28’
[Oct 7 11:08:49] == Parsing ‘/etc/asterisk/manager.conf’: [Oct 7 11:08:49] Found
[Oct 7 11:08:49] == Parsing ‘/etc/asterisk/manager_additional.conf’: [Oct 7 11:08:49] Found
[Oct 7 11:08:49] == Parsing ‘/etc/asterisk/manager_custom.conf’: [Oct 7 11:08:49] Found
[Oct 7 11:08:49] == Manager ‘admin’ logged on from 127.0.0.1
[Oct 7 11:08:49] – Executing [[email protected]:1] Answer(“Local/[email protected],2”, “”) in new stack
[Oct 7 11:08:49] > Channel Local/[email protected]-callback-737b,1 was answered.
[Oct 7 11:08:49] – Executing [[email protected]:2] Wait(“Local/[email protected],2”, “2”) in new stack
[Oct 7 11:08:49] – Executing [[email protected]:1] Answer(“Local/[email protected],1”, “”) in new stack
[Oct 7 11:08:49] – Executing [[email protected]:2] Set(“Local/[email protected],1”, “TIMEOUT(response)=10”) in new stack
[Oct 7 11:08:49] – Response timeout set to 10
[Oct 7 11:08:49] – Executing [[email protected]:3] Set(“Local/[email protected],1”, “__KEEPCID=TRUE”) in new stack
[Oct 7 11:08:49] – Executing [[email protected]:4] DISA(“Local/[email protected],1”, “no-password|from-internal”) in new stack
[Oct 7 11:08:49] == Manager ‘admin’ logged off from 127.0.0.1
[Oct 7 11:08:51] – Executing [[email protected]:3] Set(“Local/[email protected],2”, “CALLERID(dnid)=0540000000”) in new stack
[Oct 7 11:08:51] – Executing [[email protected]:4] Set(“Local/[email protected],2”, “CALLERID(num)=0540000000”) in new stack
[Oct 7 11:08:51] – Executing [[email protected]:5] DeadAGI(“Local/[email protected],2”, “a2billing.php|1”) in new stack
[Oct 7 11:08:51] – Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
[Oct 7 11:08:51] – AGI Script Executing Application: (DIAL) Options: (SIP/82.166.66.43/0540000000|60|HRriL(5400000:100000:60000))
[Oct 7 11:08:51] – Limit Data for this call:
[Oct 7 11:08:51] > timelimit = 5400000
[Oct 7 11:08:51] > play_warning = 100000
[Oct 7 11:08:51] > play_to_caller = yes
[Oct 7 11:08:51] > play_to_callee = no
[Oct 7 11:08:51] > warning_freq = 60000
[Oct 7 11:08:51] > start_sound = (null)
[Oct 7 11:08:51] > warning_sound = timeleft
[Oct 7 11:08:51] > end_sound = (null)
[Oct 7 11:08:51] – Called 82.111.11.11/0540000000
[Oct 7 11:08:52] – SIP/82.111.11.11-0930e848 is making progress passing it to Local/[email protected],2
[Oct 7 11:08:55] – SIP/82.111.11.11-0930e848 is making progress passing it to Local/[email protected],2
[Oct 7 11:08:55] – SIP/82.111.11.11-0930e848 is ringing
[Oct 7 11:08:55] – SIP/82.111.11.11-0930e848 is making progress passing it to Local/[email protected],2
[Oct 7 11:08:56] – SIP/82.111.11.11-0930e848 answered Local/[email protected],2
[Oct 7 11:08:56] – AGI Script a2billing.php completed, returning 0

Is anyone knowing about this issue?

Best Regards

What does this have to do with FreePBX?

Perhaps the A2Billing folks would be in a better position to assist?

Scott

Hi Scott

Thank you for your replay.
Yes, you are right but im trying to solved this issue from the FrePBX.
There’s line on /var/lib/asterisk/bin/callback

$channel = “Local/”.$callback_number."@from-internal";

And I tried to changed it to few variations like:

$channel = “SIP/”.$callback_number."@from-internal";
When I changed it to SIP the callback did not call back to the caller.
$channel = “Local/”.$callback_number."@from-internal/n";
When I tried to add /n the CallerID was changed to Unknown.

Maybe you have any clue about it?

Thanks,
Noy

You would need to pass it back to the a2billing context.