[Asterisk-Users] ASTCC error on free calls

Trevor G. Hammonds trevor at skyhost.net
Sat Feb 5 19:35:01 MST 2005


Karl H. Putz wrote on Saturday, 5 February 2005 11:45 AM:

> The problem is a "division by zero" issue in the astcc.agi @ line 538
> (I have made a few mods so my line #'s may not be exactly the same). 
> The line reads  
> 
> $maxmins = int(($credit - $adjconn) / $adjcost);
> 
> you may want to change the script to something like:
> 
> if ($adjcost < 1) {
> 	$maxmins = <some time limit in minutes you want to impose on a free
> 	call>; } else { $maxmins = int(($credit - $adjconn) / $adjcost); }

That did the trick!  Thank you, Karl!

> I set $maxmins = $credit on my system and that will give 1 minute per
> penny of account balance as the max duration of the call but will not
> charge any duration related fees against the account.  Any connection
> fees would still be assessed at call termination, though.   

Good idea.  I did this as well.  

		Sincerely,
		Trevor Hammonds




More information about the asterisk-users mailing list