Hi,
It is known that A2B have an issue with the LCR since it uses the longest prefix in the ratecard despite its route cost. Well I want to contribute to the project and also that other members confirm my findings or tell me Chris that's wrong.....
Here is what I did:
I changed the file /var/lib/asterisk/agi-bin/lib/Class.RateEngine.php (the path may be different on your asterisk installation) and I commented these lines:
Code:
//1) REMOVE THOSE THAT HAVE A SMALLER DIALPREFIX
//$max_len_prefix = strlen($result[0][7]);
//for ($i=1;$i<count($result);$i++) {
// if ( strlen($result[$i][7]) < $max_len_prefix) break;
//}
//$result = array_slice ($result, 0, $i);
First question to Areski and Joe, which are the consequences on other parts of A2B this change? as I can see there are none, correct me if I'm wrong.
Next, my testing sheet as attached image:
Prefix: the prefix on the ratecard.
Cost: the value per minute to the customer
Expected: checked with 'x' since it is the lowest value on the three ratecard.
Result: checked if the call DID use the lowest value route.
Ratecard: With three Providers A, B and C, and with different cost (H)igh, (M)edium and (L)ow.
The number that I dialed was always 15808725xxx, so I forced A2B to use the longest dialprefix, but it always used the lowest cost route.
It seems to be working just fine.
Another question... I have all these files with the same name... have two on the web side... I guess I have to make the same change there, isn't it?
/var/www/html/a2customer/lib/Class.RateEngine.php
/var/www/html/a2billing/common/lib/Class.RateEngine.php
/var/lib/asterisk/agi-bin/lib/Class.RateEngine.php
Please, do not make those changes on your production environments! please use testing A2B boxes.
So, make your own testing and tell me is it fixed? or did I scr*w it up?
Kind regards
Christian