Hello Community,
many admins have problems with wrong calltime calculation on callback's (CID, WEB), it even can result in negative users credit ...
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 legaround 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
}
PS: my line numbers are not exactly the same, because i hacked a lot around
Hope this helps
Greetings from Austria
foxxx