Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Mar 29, 2024 8:00 am
Hosted Voice Broadcast


All times are UTC




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

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 1.st leg, caller need at least 60 sec. to get a callback
around line 454 i changed:

Code:
if ($res_all_calcultimeout) {


to
Code:
if ($res_all_calcultimeout > 60) {


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

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


to

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


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

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


i added my code
Code:
// foxxx | quick and dirty bug fix - to calculate the correct callbacktime (including the first leg)                                     
$RateEngine->Reinit();                                                                                                                   
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

foxxx


Top
 Profile  
 
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 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group