Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Mar 19, 2024 9:39 am
Voice Broadcast System


All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Calls are billed incorrectly
PostPosted: Wed Feb 19, 2014 8:55 am 
Offline

Joined: Wed Feb 19, 2014 8:44 am
Posts: 7
Greetings.
I have a problem somewhat similar to this, but as that topic is old, I've started a new one.

What I have, is some calls are being inserted into cc_call with zero duartion, however in cdr and asterisk log the call is being logged correctly. Here is an example:

Code:
[Nov  1 08:33:11] -- Executing [993XXXXXXXX@billing:1] NoOp("SIP/45541-0000458f", "A2Billing Start") in new stack
[Nov  1 08:33:11] -- Executing [993XXXXXXXX@billing:2] AGI("SIP/45541-0000458f", "a2billing.php|1") in new stack
[Nov  1 08:33:11] -- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
[Nov  1 08:33:11] -- AGI Script Executing Application: (DIAL) Options: (SIP/cat/993XXXXXXXX|60|iLTt(5400000:61000:30000))
[Nov  1 08:33:11] -- Called cat/993XXXXXXXX
[Nov  1 08:33:11] -- SIP/cat-00004590 is making progress passing it to SIP/45541-0000458f2
[Nov  1 08:34:04] -- SIP/cat-00004590 answered SIP/45541-0000458f
[Nov  1 08:37:30] == Spawn extension (billing, 993XXXXXXXX, 2) exited non-zero on 'SIP/45541-0000458f'


Notice the 08:37:30 time - it is when the call was ended. Then I look into cc_call table, and see that both starttime and stoptime equal to 08:37:30, despite the AGI script was launched at 08:33:11. Therefore the session duration billed as 0, and for some reason terminatecauseid is also 0, however asterisk log shows clean 16 hangup.

Don't mind the call date, I was analysing old calls and this is the first (but not the only one) wrong call I've ran into.
The number of incorrectly billed calls is surprisingly high. It was happening with the 1.9 version, and continues in 2.0

What can be the cause of this?


Top
 Profile  
 
 Post subject: Re: Calls are billed incorrectly
PostPosted: Wed Feb 19, 2014 9:55 pm 
Offline

Joined: Mon Mar 02, 2009 8:56 pm
Posts: 271
Looking at the dial command I'd say you probably don't want to be allowing transfers to happen with the tT options (http://sysadminman.net/blog/2011/a2bill ... fraud-2823) and I think the numbers in brackets should be directly after the L option as they are the call duration limits.

Not sure if either of those are causing your issue though.


Top
 Profile  
 
 Post subject: Re: Calls are billed incorrectly
PostPosted: Wed Feb 19, 2014 11:35 pm 
Offline

Joined: Wed Feb 19, 2014 8:44 am
Posts: 7
Yeah, I've read that article. The thing is, I need my users to be able to transfer sometimes, and besides time limits are working despite being specified not directly after the L option.

Regarding to my issue and transfer - there are no transfers in logs for calls in question.


Top
 Profile  
 
 Post subject: Re: Calls are billed incorrectly
PostPosted: Wed Jun 11, 2014 1:19 pm 
Offline

Joined: Wed Feb 19, 2014 8:44 am
Posts: 7
Trying to get some help on this topic again.
I have enabled all the possible debugging, and still there are no hints on why would a2billing lose some calls.
Here are examples of two calls with agi debug (a2billing debug is almost same up to the last point, so I omitted it)

This one is logged. Note that after getting result=-1 a2billing starts asking for answeredtime, answer status and so on:
Code:
[Jun  7 18:58:00] VERBOSE[10335] logger.c: AGI Rx << EXEC DIAL SIP/cat/00359XXXXXXX|60|iLTt(5400000:61000:30000)
[Jun  7 18:58:00] VERBOSE[10335] logger.c:     -- AGI Script Executing Application: (DIAL) Options: (SIP/cat/00359XXXXXXX|60|iLTt(5400000:61000:30000))
[Jun  7 18:58:00] VERBOSE[10335] logger.c:     -- Called cat/00359XXXXXXX
[Jun  7 18:58:01] VERBOSE[10335] logger.c:     -- SIP/cat-00003c22 is making progress passing it to SIP/cat-00003c21
[Jun  7 18:58:13] VERBOSE[10335] logger.c:     -- SIP/cat-00003c22 answered SIP/cat-00003c21
[Jun  7 18:58:28] VERBOSE[10335] logger.c: AGI Tx >> 200 result=-1
[Jun  7 18:58:28] VERBOSE[10335] logger.c: AGI Rx << GET VARIABLE ANSWEREDTIME
[Jun  7 18:58:28] VERBOSE[10335] logger.c: AGI Tx >> 200 result=1 (15)
[Jun  7 18:58:28] VERBOSE[10335] logger.c: AGI Rx << GET VARIABLE DIALSTATUS
[Jun  7 18:58:28] VERBOSE[10335] logger.c: AGI Tx >> 200 result=1 (ANSWER)
[Jun  7 18:58:28] VERBOSE[10335] logger.c:   a2billing.php|3: file:Class.RateEngine.php - line:1491 - uniqueid:1402156680.15421 - -> dialstatus : ANSWER, answered time
is 15
[Jun  7 18:58:28] VERBOSE[10335] logger.c: AGI Rx << HANGUP
[Jun  7 18:58:28] VERBOSE[10335] logger.c: AGI Tx >> 200 result=1
[Jun  7 18:58:28] VERBOSE[10335] logger.c:   == Spawn extension (disa, 00359XXXXXXX, 1) exited non-zero on 'SIP/cat-00003c21'


This one does not get billed. Note that after getting result=-1 a2billing just does nothing, so asterisk ends the call
Code:
[Jun  7 18:49:36] VERBOSE[6076] logger.c: AGI Rx << EXEC DIAL SIP/cat/00359XXXXXXX|60|iLTt(5400000:61000:30000)
[Jun  7 18:49:36] VERBOSE[6076] logger.c:     -- AGI Script Executing Application: (DIAL) Options: (SIP/cat/00359XXXXXXX|60|iLTt(5400000:61000:30000))
[Jun  7 18:49:36] VERBOSE[6076] logger.c:     -- Called cat/00359XXXXXXX
[Jun  7 18:49:36] VERBOSE[6076] logger.c:     -- SIP/cat-00003c20 is making progress passing it to SIP/cat-00003c1f
[Jun  7 18:49:48] VERBOSE[6076] logger.c:     -- SIP/cat-00003c20 answered SIP/cat-00003c1f
[Jun  7 18:49:59] VERBOSE[6076] logger.c: AGI Tx >> 200 result=-1
[Jun  7 18:49:59] VERBOSE[6076] logger.c:   == Spawn extension (disa, 00359XXXXXXX, 1) exited non-zero on 'SIP/cat-00003c1f'


I've read similar topics here. I don't have problems with database, I don't have problems with open files, my load is maximum 8-10 calls, so I see absolutely no reasons why would a2billing just ignore input from agi and lose the call.

Please help me if it is possible. I don't want to write additional script to sync the asterisk cdr and a2billing call records, I want to get it working as it is intended.


Top
 Profile  
 
 Post subject: Re: Calls are billed incorrectly
PostPosted: Thu Jun 12, 2014 11:21 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

I'm not comfortable with your dial command parameter, although I'm not sure whether this is the cause of your issues.

(SIP/cat/00359XXXXXXX|60|iLTt(5400000:61000:30000))

The L command limits the duration of the call, and is in the form, L(x,y,z) where x is the allowed duration, and warnings sounded 60 seconds and 30 seconds before the call is automatically disconnected.

Thus, I believe the L command should be next to the brackets, e.g. (SIP/cat/00359XXXXXXX|60|iTtL(5400000:61000:30000))

As another poster has pointed our, the T/t is dangerous, the agi runs on a channel, it may not move to another channel. so I'd remove the T's

I'd recommend you have your dial command parameter looking like this:

|60|iL(%timeout%:61000:30000)

Then test again, and see what happens now these errors are fixed.

Joe


Top
 Profile  
 
 Post subject: Re: Calls are billed incorrectly
PostPosted: Wed Jun 18, 2014 11:56 am 
Offline

Joined: Wed Feb 19, 2014 8:44 am
Posts: 7
I've changed dialplan as suggested, but still no success.
So then I've modified phpagi.php to make it log all the messages it exchanges with asterisk. And here's what I've got.

In Asterisk:
Code:
[Jun 18 14:37:16] AGI Rx << SET VARIABLE CHANNEL(language) "en"
[Jun 18 14:37:16] AGI Tx >> 200 result=1
[Jun 18 14:37:16] AGI Rx << SET CALLERID 06XXXXXXXX
[Jun 18 14:37:16] AGI Tx >> 200 result=1
[Jun 18 14:37:16] AGI Rx << CHANNEL STATUS SIP/cat-00000008
[Jun 18 14:37:16] AGI Tx >> 200 result=4
[Jun 18 14:37:16] AGI Rx << EXEC DIAL SIP/cat/0040XXXXXXXX|60|iL(5400000:61000:30000)
[Jun 18 14:37:22] AGI Tx >> 200 result=-1
[Jun 18 14:37:22]  == Spawn extension (disa, 0040XXXXXXXX, 1) exited non-zero on 'SIP/cat-00000008'

In AGI log:
Code:
18-06-2014 14:37:16 >> SET VARIABLE CHANNEL(language) "en"
18-06-2014 14:37:16 << 200 result=1
18-06-2014 14:37:16 >> SET CALLERID 06XXXXXXXX
18-06-2014 14:37:16 << 200 result=1
18-06-2014 14:37:16 >> CHANNEL STATUS SIP/cat-00000008
18-06-2014 14:37:16 << 200 result=4
18-06-2014 14:37:16 >> EXEC DIAL SIP/cat/0040XXXXXXXX|60|iL(5400000:61000:30000)
18-06-2014 14:37:22 << 200 result=-1
18-06-2014 14:37:22 >> GET VARIABLE ANSWEREDTIME
18-06-2014 14:37:22 >> GET VARIABLE DIALSTATUS
18-06-2014 14:37:22 >> HANGUP


Soooooooo............... It's not phpagi's fault (presumably), for it tries to send those messages. At least, it calls the evaluate() function. However, Asterisk does not get those messages for some reason. If there are any developers around to advise me some steps to test, I'd appreciate.


Top
 Profile  
 
 Post subject: Re: Calls are billed incorrectly
PostPosted: Sun Mar 29, 2015 5:40 am 
Offline

Joined: Sat Oct 01, 2011 4:41 am
Posts: 50
I am having Same issue, and using asterisk 13.. i don't think i had this issue till i used Originate app to force a call back (because i couldn't get it to work another way)

i am loosing alot of money in this i hope help comes soon


Top
 Profile  
 
 Post subject: Re: Calls are billed incorrectly
PostPosted: Sun Mar 29, 2015 9:26 pm 
Offline

Joined: Sat Oct 01, 2011 4:41 am
Posts: 50
I Figured out what caused my issue, I had asterisk do the call back outside of a2billing using Originate() i suppose a2billing and asterisk was confused as to what channel the session time would;d be for lol. I got the callback working in a2billing now and it all works now :mrgreen2:


Asterisk 13
freePBX 12
A2Billing v2.1.0


Top
 Profile  
 
 Post subject: Re: Calls are billed incorrectly
PostPosted: Mon Mar 30, 2015 2:32 pm 
Offline

Joined: Sat Oct 01, 2011 4:41 am
Posts: 50
:shock: It came back.. but it onlly happens on call back calls


Changing to asterisk 11 fixed my issue


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group