I'm trying to setup a system where we'll compensate users a small per minute fee (i.e. give them credit) for their US toll-free calls. This isn't working so far however.
At first it completely broke. There is a maxtime_tocall_negatif_free_route parameter in a2billing.conf but it is being ignored by the rate_engine_calcultimeout function because of:
$rateinitial = round(abs($this -> ratecard_obj[$K][12]),4);
if ($rateinitial<=0){
$this -> ratecard_obj[$K]['timeout']= $A2B->agiconfig['maxtime_tocall_negatif_free_route'];
The first statement abs's rateinitial so it cannot be negative, so it returns with an insanely high timeout which makes Asterisk break.
After first this problem (removed the abs) calls worked but there's apparently other abs's in the rating engine because calls are rated positive instead of negative.
Here's my question:
What is the purpose of the abs's being there? do they serve an actual real function or can they safely be removed? my guess is they can just be removed but I wonder if they were put in place to fix a known issue - or just nobody thought about negative cost calls?
Would love an answer from someone in the know (Areski?).
Thanks!