Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Mar 19, 2024 8:37 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Calling Cards application: wrong billing
PostPosted: Mon Oct 24, 2011 9:19 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hello,
I don't know what's happen into my system, where I'm using a2billing 1.9.4 all it's working properly, as we're more concentrated in wholesale traffic billing, and we really don't provide the calling cards as primary business, we just have it as a possibility for voip customers... but right now I'm looking into our CDRs, and the carrier, and I discovered that some calls, was handled via the calling cards application, the call success in the carrier CDRs, and in Asterisk CDRs, but in a2billing CDRs appear like answered, but with 0 duration, and not billed anywhere...

Why we have this behavior??


Last edited by ubunter on Sat Jan 21, 2012 9:41 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Sun Oct 30, 2011 4:36 am 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Hello,

Unless you post more details from the CDR for the same call to compare, i can not judge the case.

However, could it be that you are experiencing something similar to this :

http://sysadminman.net/blog/2011/a2bill ... fraud-2823


Regards,


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Sun Oct 30, 2011 12:30 pm 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hi Swift,
No, it's not the call transfer issue, even it was me who report this issue first, and we block the call transfer via dialcomand...

Indeed this problem, as I said, the call is being registered in a2b CDR as canceled, but in asterisk CDR the call is answered, progress, and concluded... so, when I compare a2billing CDR with asterisk CDR, the call is not the same... in asterisk the call is registered, as correct with the correct start and end time, meanwhile in a2billing it's show as canceled...

I insist, this behavior it's ONLY with the calling card application, not in the SIP& IAX progressing, it's ONLY, and exclusively in the calling cards...

Regards,


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Sun Oct 30, 2011 2:22 pm 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Hi,

Is this happening in every calling card call ?
If so, then it is possible for you to trace it out ? I mean in the Asterisk and A2B log during a test call.

Can you show us some examples from the CDR ?

Regards,


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Mon Nov 07, 2011 10:33 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hi Swift,
As I said, as we don't use significantly the calling card service, so we just suspend it, and I just got back to this issue now...

I'm testing to make the call from a local sip friend account in asterisk, to place the call through a testing DID 7777, appointed to the calling card application, then get identified via my a2billing user. I have placed the call to my mobile device, I answered the mobile during a about 10 seconds, to test, and then hanged up.

So, the Asterisk CLi trace is below, you can see all it's correct, but when I go to a2billiing call reports - CDRs, I see that call billed for one single second... and in ls /var/log/asterisk/cdr-csv I don't have the testing extension CDR, and in the log, neither that call is recorded in the a2billing user cdr??

Quote:
== Using UDPTL TOS bits 184
== Using UDPTL CoS mark 5
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [7777@inbound-from-sip-pstn:1] Dial("SIP/testing-00000056", "local/7777@callingcard") in new stack
-- Called local/7777@callingcard
-- Executing [7777@callingcard:1] NoOp("Local/7777@callingcard-cbf2;2", "A2Billing Start") in new stack
-- Executing [7777@callingcard:2] AGI("Local/7777@callingcard-cbf2;2", "a2billing.php,1") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
-- Local/7777@callingcard-cbf2;1 answered SIP/testing-00000056
-- <Local/7777@callingcard-cbf2;2> Playing 'menu_en.gsm' (language 'en')
-- <Local/7777@callingcard-cbf2;2> Playing 'num_en_1.gsm' (language 'en')
-- <Local/7777@callingcard-cbf2;2> Playing 'prepaid-enter-pin-number.gsm' (language 'en')
-- Playing 'prepaid-you-have' (escape_digits=#) (sample_offset 0)
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/4.ulaw' (language 'en')
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/hundred.ulaw' (language 'en')
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/10.ulaw' (language 'en')
-- Playing 'euros' (escape_digits=#) (sample_offset 0)
-- Playing 'vm-and' (escape_digits=#) (sample_offset 0)
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/40.ulaw' (language 'en')
-- Playing 'prepaid-cents' (escape_digits=#) (sample_offset 0)
-- <Local/7777@callingcard-cbf2;2> Playing 'prepaid-enter-dest.gsm' (language 'en')
-- Playing 'prepaid-you-have' (escape_digits=#) (sample_offset 0)
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/6.ulaw' (language 'en')
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/thousand.ulaw' (language 'en')
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/1.ulaw' (language 'en')
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/hundred.ulaw' (language 'en')
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/18.ulaw' (language 'en')
-- Playing 'prepaid-minutes' (escape_digits=#) (sample_offset 0)
-- Playing 'vm-and' (escape_digits=#) (sample_offset 0)
-- <Local/7777@callingcard-cbf2;2> Playing 'digits/30.ulaw' (language 'en')
-- Playing 'prepaid-seconds' (escape_digits=#) (sample_offset 0)
-- AGI Script Executing Application: (DIAL) Options: (SIP/TrunkC/********#346*********,60,LIW(%TIMEOUT(absolute)=3600%:60000:30000))
== Using UDPTL TOS bits 184
== Using UDPTL CoS mark 5
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called SIP/TrunkC/********#346*********
-- SIP/TrunkC-00000057 is making progress passing it to Local/7777@callingcard-cbf2;2
-- Local/7777@callingcard-cbf2;2 requested special control 20, passing it to SIP/TrunkC-00000057
-- Local/7777@callingcard-cbf2;2 requested special control 20, passing it to SIP/TrunkC-00000057
-- SIP/TrunkC-00000057 is ringing
-- SIP/TrunkC-00000057 is making progress passing it to Local/7777@callingcard-cbf2;2
-- Local/7777@callingcard-cbf2;2 requested special control 20, passing it to SIP/TrunkC-00000057
-- Local/7777@callingcard-cbf2;2 requested special control 20, passing it to SIP/TrunkC-00000057
-- Local/7777@callingcard-cbf2;2 requested special control 20, passing it to SIP/TrunkC-00000057
-- Local/7777@callingcard-cbf2;2 requested special control 20, passing it to SIP/TrunkC-00000057
-- SIP/TrunkC-00000057 answered Local/7777@callingcard-cbf2;2
-- <Local/7777@callingcard-cbf2;2>AGI Script a2billing.php completed, returning 4
== Spawn extension (callingcard, 7777, 2) exited non-zero on 'Local/7777@callingcard-cbf2;2'
== Spawn extension (inbound-from-sip-pstn, 7777, 1) exited non-zero on 'SIP/testing-00000056'


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Tue Nov 08, 2011 5:43 am 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Hello ubunter ,


Quote:
-- <Local/7777@callingcard-cbf2;2>AGI Script a2billing.php completed, returning 4


The a2billing.php is returning 4 , I think in normal cases it should return -1
May be you need to enable full debug of A2B to see what is going wrong ..

Quote:
-- Executing [7777@callingcard:2] AGI("Local/7777@callingcard-cbf2;2", "a2billing.php,1") in new stack


I noticed that you are using the AGI() function ,,
As far as I know it is not stable yet and we are still required to use the DeadAgi() when calling the A2B script.

Try changing to DeadAgi() and see if it solves your issue.


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Tue Nov 08, 2011 8:46 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Quote:
The a2billing.php is returning 4 , I think in normal cases it should return -1
May be you need to enable full debug of A2B to see what is going wrong ..


In my server AGI script from a2billing is returning 4 in all cases, all calls, I mean, in voip calls, where i'm not having any billing problem... where's the issue here??


Quote:
I noticed that you are using the AGI() function ,,
As far as I know it is not stable yet and we are still required to use the DeadAgi() when calling the A2B script.

Try changing to DeadAgi() and see if it solves your issue

I'm running asterisk 1.8.7 right now, DeadAgi was deprecated in this version, and moved absolutely to Agi, there's no any other issue in service unless the calling cards billing as I said... our server it's handling 1 million minutes per day in wholesale traffic, and we're not detecting any billing error... unless in one or 2 calls per day in calling card, and it's failing...


Right now, to test and compare, I turn debug to 4 in both agi-conf1 for the calling cards, and agi-conf2 for the voip calls... I made the same call, to the same destination...attached the trace from both calls in separated files to compare...

regards,


Attachments:
callingcard-call-agiconf2.txt [23.57 KiB]
Downloaded 916 times
voipcall-agi-conf1.txt [17.53 KiB]
Downloaded 942 times
Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Tue Nov 08, 2011 3:51 pm 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Hello,

Hope you walk it with me here ..

I did not go through the whole file, i just jumped directly ot the end of the call where the CDR of A2B is written ,, the SQL statement :

First File :
Quote:
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 ('mydomain.com-1320748576.10', 'Local/7777@callingcard-67b2;2', '1', '', SUBDATE(CURRENT_TIMESTAMP, INTERVAL 1 SECOND) , '1', '1', '346*********', 1, now() , '+0.0925', '1', '17', '92652', '10', '1092', '0', '0.00096666666666667', NULL, 'unknown', '346')]


It is showing that the call took 1 sec


Second File :
Quote:
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 ('mydomain.com-1320748331.6', 'SIP/435657678-00000006', '1', '', SUBDATE(CURRENT_TIMESTAMP, INTERVAL 5 SECOND) , '5', '5', '346*********', 1, now() , '+0.0925', '1', '17', '92652', '10', '91********', '0', '0.0048333333333333', NULL, '346*********', '346')]


It is showing that the call took 5 sec

Do theses figures match your tests ?
Could you see the result of the two INSERT statements in the cc_call table ?

BTW : I use asterisk 1.8.2 in one of my servers and can still use the DeadAGI() ,,
deprecated (as I know it) means planned for future removal, but does not mean you can not use it now ,, I guess !

Regards


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Tue Nov 08, 2011 5:33 pm 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
This is precisely the problem, in voip call, the calls are billed correctly as they are, in calling cards, all calls are billed as 1 second only...


Quote:
BTW : I use asterisk 1.8.2 in one of my servers and can still use the DeadAGI() ,,
deprecated (as I know it) means planned for future removal, but does not mean you can not use it now ,, I guess !


Yes, it's true, just asterisk cli still waring, and reproducing the recommendation, I didn't test it again with deadagi, as AGi is much faster in production server for wholesale traffic, deadagi need to verify codecs, t38 availability, dtmf, meanwhile agi send the invite directly, and go with directmedia... I really didn't went back, neither effort myself to test with deadagi, but I may repeat this testing lancing a2billing calling card script with Deadagi, to verify, but no reason, or relation with this issue, I guess, or I'm mistaking??

Regards,


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Wed Nov 09, 2011 7:18 am 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Hello Ubunter,

Our ability to help you with your issue depends highly on how precise you are in describing the problem and how flexible you are in trying several options instead of arguing about them.

Your first complain (on top) was :
Quote:
but in a2billing CDRs appear like answered, but with 0 duration, and not billed anywhere...


But now you say :
Quote:
in calling cards, all calls are billed as 1 second only...


Have you checked your rates ,, if you define the rate to have zero (0) price for the BillingBlock and have a non-zero value for the connection charge, you can end up with constant billing. I am not saying this is the reason but trying to show you that many things if set the wrong way can cause the same results. And to be able to detect which is which we need to question everything.

I am not aware about the mechanism of how AGI and DeadAGI work, but there could be a difference in the environment with which they encapsulate the php code and this is reflected on the ability of the code to get certain system parameters causing unwanted behavior.

Most of the suggestions are based on speculations as we are not really sitting in front of your server and looking ourselves at the symptoms, you need to be more flexible about accepting suggestions.

Regards,


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Wed Nov 09, 2011 2:59 pm 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hi Swift,
Sorry, if I wasn't clear in describing the issue in my first mail. I mean, all calls handled with the calling card application are being recorded as 1 single second... other question is in my rate card I'm setting as minimum duration per call 60 for the first block, and 30 for the others, so in billing it's belled as 90s, but the call duration, it's registered as only 1 single second, whatever you talk...

I repeat the test, using DeadAgi, in voip call with my actual agiconf2, and in callingcard call using my previous agoconf1. The unique is asterisk is showing the woring for the deadagi as below:
Quote:
[Nov 9 17:40:41] WARNING[30868]: res_agi.c:3928 deadagi_exec: DeadAGI has been deprecated, please use AGI in all cases!


But, in both calls, as we said before, they return 4 from the a2billing script as:
Quote:
-- <SIP/****-0000157d>AGI Script a2billing.php completed, returning 4


In the voip call I see in a2billing CDR 4 seconds, which is correct, meanwhile in the calling card 1 single second, the same as before using agi, when the call was similar in 4 seconds also, so using agi or deadagi it's the same result...

About the agi and the DeadAgi, as I know, read, and understood, agi is more fastest then the deadagi, as the last one spend more time processing each call in verifying the t38 availability, codecs, re-inviting, etc... meanwhile if you're using directmedia it's more appropriate for fastest processing to use agi, for now, I just turned my voip traffic to deadagi, and let the wholesale in agi to compare, even, there's no issue in voip calls until this moment...

Regards,


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Thu Nov 10, 2011 11:16 am 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Hello Ubunter,

Do not worry about the warning regarding the DeadAgi, I am seeing it in Asterisk 1.6 and I believe it was there in 1.4 also.

Around a year ago, I came across a discussion here in this forum regarding the use of AGI or DeadAGI, and i remember Jroper commenting that he had contacted Asterisk people and what he understood from them is AGI is still "not-as-promised" . Hence he recommended sticking to DeadAgi for the A2B application. I am not aware of any update after that,, however , i was away from the forum for some time.

Unless confirmed from Asterisk that AGI totally replaces DeadAGI, I recommend using the DeadAGI to avoid any hidden effects.

I went through your log files and could not find a clue about what is causing the call period to be 1 sec ,,,

Code:
a2billing.php,1: file:Class.RateEngine.php - line:1422 - uniqueid:mydomain.com-1320748576.10 - -> dialstatus : ANSWER, answered time is 1

If you have some knowledge in php, you can refer to the Class.RateEngine.php - line:1422 and see the code before ,, may be print some variables to the log to see what is causing this wrong calculation.

Try to unify the conditions,, rates, agiconf ,, etc . It will make it easier to detect the issue.

Keep me posted.

Regards,


Top
 Profile  
 
 Post subject: Re: Calling Cards application: Calls Handed but not billed
PostPosted: Thu Nov 10, 2011 11:37 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hi Swift, glad to talk to you again,

Quote:
I believe it was there in 1.4 also.


No, in v.1.4 isn't, I used v. 1.4.26 before that I jumped to 1.8...


Quote:
Around a year ago, I came across a discussion here in this forum regarding the use of AGI or DeadAGI, and i remember Jroper commenting that he had contacted Asterisk people and what he understood from them is AGI is still "not-as-promised" . Hence he recommended sticking to DeadAgi for the A2B application. I am not aware of any update after that,, however , i was away from the forum for some time.


I remember this discussion, I read it also elsewhere... even, I got another discussion about it with people from Cisco also around the same...

Quote:
Unless confirmed from Asterisk that AGI totally replaces DeadAGI, I recommend using the DeadAGI to avoid any hidden effects.


You convinced me to turn to deadagi only for your hidden defects argument, so I turn all my context to deadagi now, to see what may happen!! Even, because yesterday I got another inconvenient which I report here: viewtopic.php?f=34&t=9294 so to avoid agi& deadagi suspect, I turn to deadagi...:)


Quote:
If you have some knowledge in php, you can refer to the Class.RateEngine.php - line:1422 and see the code before ,, may be print some variables to the log to see what is causing this wrong calculation.


I'm not greatly friend with php, but in that chaper of Class.RateEngine.php I have the default, as I never have been edited this file before... I have this:
Quote:
}
return false;
} elseif ($this->dialstatus == "ANSWER") {
$A2B -> debug( DEBUG, $agi, __FILE__, __LINE__, "-> dialstatus : ".$this->dialstatus.", answered time is ".$this->answeredtime." \n");
}


Regards,


Last edited by ubunter on Sat Jan 21, 2012 9:42 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Calling Cards application: wrong billing
PostPosted: Sun Jan 22, 2012 5:35 pm 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
a2billing.php,2: file:Class.RateEngine.php - line:736 - uniqueid:mydomain.com-1320748331.6 - [CC_RATE_ENGINE_CALCULCOST: K=0 - CALLDURATION:5 - freetimetocall_used=0 - freetimetocall_left=0]
a2billing.php,2: file:Class.RateEngine.php - line:814 - uniqueid:mydomain.com-1320748331.6 - [TEMP - CC_RATE_ENGINE_CALCULCOST: 1. COST: -0.0925]:[ (60/60) * 0.0925 ]
a2billing.php,2: file:Class.RateEngine.php - line:899 - uniqueid:mydomain.com-1320748331.6 - [CC_RATE_ENGINE_CALCULCOST: K=0 - BUYCOST:-0.0048333333333333 - SELLING COST:-0.0925]
a2billing.php,2: file:Class.RateEngine.php - line:1042 - uniqueid:mydomain.com-1320748331.6 - [CC_RATE_ENGINE_UPDATESYSTEM: usedratecard K=0 - (sessiontime=5 :: dialstatus=ANSWER :: buycost=0.0048333333333333 :: cost=-0.0925 : signe_cc_call=+: signe=-)]
a2billing.php,2: file:Class.RateEngine.php - line:1107 - uniqueid:mydomain.com-1320748331.6 - [CC_asterisk_stop : SQL: DONE : result=1]
a2billing.php,2: file:Class.RateEngine.php - line:1108 - uniqueid:mydomain.com-1320748331.6 - [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 ('mydomain.com-1320748331.6', 'SIP/435657678-00000006', '1', '', SUBDATE(CURRENT_TIMESTAMP, INTERVAL 5 SECOND) , '5', '5', '346*********', 1, now() , '+0.0925', '1', '17', '92652', '10', '91********', '0', '0.0048333333333333', NULL, '346*********', '346')]

Contrary to your post I can see the database being updated with 5 seconds of call time here not 0 as you said.


Top
 Profile  
 
 Post subject: Re: Calling Cards application: wrong billing
PostPosted: Fri Jan 27, 2012 9:28 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hello guys,
I have to come back to the calling card issue, as you said, it's the must tested feature in a2b which is not working, or failing with me at all... I just retest again, I made a call, i spoke 14 seconds, and I finish the call, in the provider the call is being billed correctly within 14 seconds, but in my a2billing admin it's showing 0 seconds, and wasn't even billed at all...

Reviewing the trace, it's true, a2billing is inserting in the DB correctly the duration, but something wrong, which is finally not billing the call as it's...

This fails it's only, and exclusively in the calling card application, as i said, we're using the voip service, and all it's fine, without any fail, even, withing wholesale and critical load...

No idea, Where, or how can i trace this, thanks for advice!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Voice Broadcast System


All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group