Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Apr 07, 2020 4:13 am
VoIP Billing solution

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Callback Time is wrong calculated (no Leg) - (FIXED)
PostPosted: Fri Oct 24, 2008 10:20 pm 

Joined: Mon Oct 13, 2008 7:15 pm
Posts: 7
Hello Community,

many admins have problems with wrong calltime calculation on callback's (CID, WEB), it even can result in negative users credit ... :evil:

i use the latest stable V 1.3.4 - i have investigated this for many, many hours now ...

i came up with a solution, that works for me ... so far ...

so i will share it here :-) :

-) for leg, caller need at least 60 sec. to get a callback
around line 454 i changed:

if ($res_all_calcultimeout) {

if ($res_all_calcultimeout > 60) {

-) remove the dirty calculation (division)
around line 823 i changed:

$orig_credit = $A2B -> credit;
$A2B -> credit = $A2B->credit / 2;


$orig_credit = $A2B -> credit;
// $A2B -> credit = $A2B->credit / 2;

-) i added this code, so the rateengine can caclulate including the leg
around line 792 i added:

before this line
$A2B -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[CALLBACK]:[GET VARIABLE : CALLED=$called_party | CALLING...

i added my code
// foxxx | quick and dirty bug fix - to calculate the correct callbacktime (including the first leg)                                     
if ($RateEngine->rate_engine_findrates($A2B, $called_party, $A2B -> config["callback"]['all_callback_tariff'])) {                       
    $agi -> set_variable('RATEINITIAL', round(abs($RateEngine->ratecard_obj[0][12]),4));
    $agi -> set_variable('ANSWEREDTIME', 15); // add 15 seconds from pickup the first leg until ratecalculation

:arrow: PS: my line numbers are not exactly the same, because i hacked a lot around

Hope this helps
Greetings from Austria


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 
Hosted Voice Broadcast

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

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