asterisk2billing.org
http://forum.asterisk2billing.org/

billing problem not mentioned by anyone before
http://forum.asterisk2billing.org/viewtopic.php?f=16&t=2813
Page 1 of 1

Author:  macram [ Sat Nov 17, 2007 11:42 am ]
Post subject:  billing problem not mentioned by anyone before

Hello,

i am using a custom route on trixbox 2.2 ( Freepbx 2.2.1) to make calls via a2billing.

I am relying on caller id authentication

Calls are successful

But i have a problem which is that the duration( as specified in CDR) is ALWAYS either zero or one second

I noticed that as soon as the destination answers the call an INsert statement is being issued by rate engine.

I searched the forum, and upgraded accordingly to asterisk 1.2.24 and i also installed php-pcntl, but i am still experiencing the same problem

Please note that billing is correct when i directly use an a2billing sip friend.
billing is only wrong when i use a trixbox extension

any help is greatly appreciated . Please find the log below

a2billing.php: file:Class.A2Billing.php - line:1743 - [SET LANGUAGE() en]
a2billing.php: file:Class.A2Billing.php - line:635 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse+1 WHERE username='3408130834']
a2billing.php: file:Class.A2Billing.php - line:1970 - [A2Billing] SAY BALANCE : 9.90000
a2billing.php:
a2billing.php: file:Class.A2Billing.php - line:1123 - [CURRENCY : USD]
a2billing.php: file:Class.A2Billing.php - line:1428 - [AUTO SetCallerID]
a2billing.php: file:Class.A2Billing.php - line:1434 - [REQUESTED SetCallerID : 199]
a2billing.php: file:Class.A2Billing.php - line:1445 - [EXEC SetCallerID : 199]
a2billing.php: file:a2billing.php - line:169 - [CHANNEL STATUS : 6 = Line is up]
a2billing.php: file:a2billing.php - line:170 - [CREDIT : 9.90000][CREDIT MIN_CREDIT_2CALL : 0]
a2billing.php: file:Class.A2Billing.php - line:657 - 1 && && 10&& 0
a2billing.php: file:Class.A2Billing.php - line:682 - DESTINATION ::> 9613429689
a2billing.php: file:Class.A2Billing.php - line:684 - RULES APPLY ON DESTINATION ::> 9613429689
a2billing.php: file:Class.A2Billing.php - line:722 - OK - RESFINDRATE::> 1
a2billing.php: file:Class.A2Billing.php - line:744 - RES_ALL_CALCULTIMEOUT ::> 1
a2billing.php: file:Class.A2Billing.php - line:761 - TIMEOUT::> 11880 : minutes=198 - seconds=0
a2billing.php: file:Class.RateEngine.php - line:961 - app_callingcard: Dialing 'SIP/8943/9613429689|60|HRrL(11880000:61000:30000)' with timeout of '11880'.
a2billing.php:
a2billing.php: file:Class.RateEngine.php - line:986 - app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.
a2billing.php: file:Class.RateEngine.php - line:1087 - -> dialstatus : ANSWER, answered time is 0
a2billing.php:
a2billing.php: file:Class.RateEngine.php - line:1091 - [USEDRATECARD=0]
a2billing.php: file:Class.RateEngine.php - line:849 - [CC_asterisk_stop QUERY = INSERT INTO cc_call (uniqueid,sessionid,username,nasipaddress,starttime,sessiontime, calledstation, terminatecause, stoptime, calledrate, sessionbill, calledcountry, calledsub, destination, id_tariffgroup, id_tariffplan, id_ratecard, id_trunk, src, sipiax, buyrate, buycost, id_card_package_offer) VALUES ('1195304958.37', 'Local/9613429689@a2billing-1622,2', '3408130834', '', CURRENT_TIMESTAMP - INTERVAL 0 SECOND , '0', '9613429689', 'ANSWER', now(), '0.05', '-0', '', '', 'all', '1', '1', '1', '1', '199', '0', '0', '0', '0')]
a2billing.php: file:Class.RateEngine.php - line:852 - [CC_asterisk_stop 1.1: SQL: DONE : result=1]
a2billing.php: file:a2billing.php - line:309 - [a2billing account stop]
a2billing.php: file:Class.A2Billing.php - line:635 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse-1 WHERE username='3408130834']

Author:  macram [ Tue Nov 20, 2007 8:47 am ]
Post subject: 

any suggesttions please , knowing that i already upgraded to asterisk 1.2.24 and installed php-pcntl

Thanks

Author:  stavros [ Tue Nov 20, 2007 9:56 am ]
Post subject:  Re: billing problem not mentioned by anyone before

macram wrote:
I noticed that as soon as the destination answers the call an INsert statement is being issued by rate engine.
Are you saying the call continues after this point, or the callers are cut off?
macram wrote:
a2billing.php: file:Class.RateEngine.php - line:961 - app_callingcard: Dialing 'SIP/8943/9613429689|60|HRrL(11880000:61000:30000)' with timeout of '11880'.
a2billing.php: file:Class.RateEngine.php - line:1087 - -> dialstatus : ANSWER, answered time is 0
What happens between these two lines of debug is pretty much down to Asterisk alone. A2B asks it to dial a number and bridge it to the currently connected caller. Asterisk later returns control to A2B with the billable duration once the call has cleared down. It looks like your problem may possibly be with your carrier.

Author:  macram [ Tue Nov 20, 2007 1:27 pm ]
Post subject: 

Hello Stavros,

Yes the call is continuing after this point ( The point where the CDR is inserted with duration zero)

Please note that this odd behaviour is only noticed when i call from trixbox via a2billing ( using called id detection), while billing is done correctly if I use an a2billing sip friend directly to call

Regards

Author:  stavros [ Tue Nov 20, 2007 1:38 pm ]
Post subject: 

That's most odd. I've no experience with Trixbox so I can't help you any further, but I think you've established the problem is not with A2B.

Author:  vulcan [ Tue Nov 27, 2007 8:40 pm ]
Post subject: 

You should probably use the asterisk sip/iax trunk definition directly in your A2B instead of the route.

A route can have several paths/trunks, a trunk is linked to one channel when active. A2B is looking for channels that it asks asterisk to dial.

Author:  jjjooooyyyyy [ Wed Dec 19, 2007 9:17 am ]
Post subject: 

I also have the same problem.

If you have found a solution for this problem. What is the solution.

I am using the latest Trixbox 2.2.10 with the latest A2B (1.3).

Thank you in advance.

Author:  jroper [ Fri Dec 21, 2007 8:26 am ]
Post subject: 

Hi

I thought I had got this to work, but as you say, the duration is recorded in A2Billing as around 0 seconds.

The way this is done would appear to be in this post here: -

http://forum.asterisk2billing.org/viewtopic.php?t=2127

Yours

Joe

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/