[Asterisk-Users] ASTCC error on free calls

Karl H. Putz karlp at fortephones.com
Sat Feb 5 12:44:33 MST 2005


Trevor,

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);
}

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.


Karl Putz

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com]On Behalf Of Trevor G.
Hammonds
Sent: Saturday, February 05, 2005 12:03 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: [Asterisk-Users] ASTCC error on free calls


I set up certain routes in my ASTCC application to be free of charge.  When
a user attempts to dial one of these numbers, the announcement plays the
prompts "This call will cost", "nothing", and then terminates the script,
dropping the call, leaving the card locked in the database as being in use.

Any ideas?

        Sincerely,
        Trevor Hammonds






More information about the asterisk-users mailing list