Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Mon Oct 22, 2018 8:10 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Charging for ANSWERED calls
PostPosted: Sat Jun 25, 2011 3:45 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 29
Location: Schaumburg , IL
I have many user abusing the system and making calls with 0 duration to expensive destinations.
My carriers are changing me for the calls, but a2b is showing ANSWERED with 00:00 duration and my treat.
I attempted to patch the code but without success.

This is my attempt
in Class.RateEngine.php

section: /*
* RATE ENGINE - UPDATE SYSTEM (DURATIONCALL)
* Calcul the duration allowed for the caller to this number
*/


} else {
$sessiontime = $this -> answeredtime;
$dialstatus = $this -> dialstatus;

if ($this->dialstatus == "ANSWER" && $sessiontime = 0) {
$sessiontime = $sessiontime + 1;
$this -> answeredtime = $sessiontime;
$sessiontime = $this -> answeredtime;
}

}
What I am trying to do is add 1 second to answered time when dial status is answered and call duration is 0 to trigger billing but so far without a success.

Any help would be appreciated.


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Sun Jun 26, 2011 7:03 am 
Offline

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

Have you worked out the mechanism by which you are being defrauded?

Joe


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Sun Jun 26, 2011 3:04 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 29
Location: Schaumburg , IL
Not yet, but the primary destinations are Honduras mobile and Guatemala mobile. I see 100s of these calls per week and my carriers are charging for them with duration of 1 sec. I can only guess that some of the numbers may be PPC destinations.


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Sun Jun 26, 2011 3:20 pm 
Offline

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

You are going to have to work out the method of fraud, then we can advise the best way of defending against it,

Joe


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Fri Jul 08, 2011 2:28 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 29
Location: Schaumburg , IL
Sure. the problem is that A2B is not charging for answered calls that are shorter then 1 sec..

Anyone?
I will be happy to pay for a patch that will trigger billing for 1 second on every answered call with the call duration 0.

PM me please .
I am loosing too much money.


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Fri Jul 08, 2011 3:22 pm 
Offline

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

To confirm, you are showing a call of less than one second, which is not being billed, but you are showing a disposition of answer, is that correct?

Your carrier is showing a corresponding call, and the duration for which you are only being charged for one second.

Please confirm that the amount of time you are recording and the amount of time your carrier is recording is not wildly different.

If this is the case, you can in the rate tables, set a min duration to bill, you can also set a minimum charge, providing the call is show as answered by A2Billing.

Joe


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Fri Jul 08, 2011 3:37 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 29
Location: Schaumburg , IL
Yes, Yes and Yes.

setting a minimum charge creates a problem:
Customer will see a duration 0.00 and a charge for a call in a call log.

I have try every possible setting available form admin interface and I continue to see answered calls with 0.00 duration and buy/sell 0.000 0.000

Carrier is charging for answered call a minimium billing block: 1 sec, 6 sec or 30 sec but I end-up giving it for free.


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Fri Jul 08, 2011 3:43 pm 
Offline

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

I would suggest that you do use a minimum charge, you can defend this with your customer on the basis that the call was answered, simply that rounding causes the call to be shown as 00:00 rather than 00:01.

Yours

Joe


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Fri Jul 08, 2011 6:07 pm 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 29
Location: Schaumburg , IL
I tested the minimum charge and the call is not being charged.
The log indicated answered duration 00:00 and buy/sell 0.00/0.00.

My offer stands:
I will pay for writing the patch for me to add 1 second to duration and trigger charge for the call if status is answered and duration = 0

Marcin


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls (resolved)
PostPosted: Sat Jul 09, 2011 2:20 am 
Offline

Joined: Tue Jul 20, 2010 3:42 pm
Posts: 29
Location: Schaumburg , IL
In last 24 hours I had over 3000 calls answered with duration 0 and not charged to a customer.

The problem is Asterisk reporting of agi var ANSWEREDTIME and the way the a2b is interpreting it.
This is my fix in Class.RateEngine.php around line 1300.


$answeredtime = $agi->get_variable("ANSWEREDTIME");

$zumzum = $answeredtime['data'];
if ($zumzum == 0)
$newtime = 1;
else
$newtime = $answeredtime['data'];
$this -> real_answeredtime = $this -> answeredtime = $newtime;

// $this -> real_answeredtime = $this -> answeredtime = $answeredtime['data'];
$dialstatus = $agi->get_variable("DIALSTATUS");
$this -> dialstatus = $dialstatus['data'];

Tested with A2Billing 1.9.4 (Cuprum)


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Fri Sep 05, 2014 1:31 pm 
Offline

Joined: Tue Feb 11, 2014 10:58 am
Posts: 3
Hi,

I know this is a very old thread, but my experience may help someone. I was terminating calls to Gambia and found that we were get many many thousands of calls all at 0 or 1 seconds.
To detect what was happening I checked the SIP packets using asterisk cli and type "sip set debug ip xxx.xxx.xxx.xxx" where you insert the IP of your customer instead of xxx.
When the packets come in try to see if you are sending them a SIP OK (means it connected) and then immediately they send to you a SIP BYE message. This is what was happening with me. I spent many weeks trying to debug the problem, and thousands of pounds in revenue. My clients always blamed my switch saying it was not their customer who was sending the BYE packet (although I could see it was). They also tried to say I was using an unsupported codec so when the RTP traffic / media was connected the switches couldn't interpret the media and so hung up (also false).

I had many customers all doing the same, which was because they were reselling my route and eventually somewhere at the top of the chain was someone who just wanted to get live Gamia numbers. That means they generated completely made up numbers, randomised them and then attempted to make VOIP calls to them. If the call connected they hung up and marked it as a live number. If the call didnt connect then they marked it as a dead number. Because they were only paying for 0 or 1 second per live number and not for any dead number then it was a cheap way for them to detect which numbers were live in Gambia.

The problem was so severe that the Gambian government implemented a minimum call duration charge of 60seconds in 2013 for all calls terminating into Gambia.
As soon as that came into effect and I started billing my customers 60s for every 0 or 1 s call then the calls stopped.


Top
 Profile  
 
 Post subject: Re: Charging for ANSWERED calls
PostPosted: Fri Nov 21, 2014 9:30 pm 
Offline

Joined: Fri Nov 21, 2014 9:17 pm
Posts: 1
I modified the file: "Class.RateEngine.php" to solve this problem:

at the end of "public function rate_engine_performcall" I was add:
if ($this->answeredtime==0) {$this->answeredtime=1;}

Now it looks like this
Quote:
...
elseif ($this->dialstatus == "ANSWER") {
$A2B->debug(DEBUG, $agi, __FILE__, __LINE__, "-> dialstatus : " . $this->dialstatus . ", answered time is " . $this->answeredtime . " \n");
if ($this->answeredtime==0) {$this->answeredtime=1;} //my change
$A2B->debug(DEBUG, $agi, __FILE__, __LINE__, "poprawnione: -> dialstatus : " . $this->dialstatus . ", answered time is " . $this->answeredtime . " \n"); //debug
}
$this->usedratecard = $k;
$A2B->debug(DEBUG, $agi, __FILE__, __LINE__, "[USEDRATECARD=" . $this->usedratecard . "]");

return true;
...


it works for me

Pawel


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


All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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