[Asterisk-Users] agi scripting in perl - dealiing withunexpected disconnects gracefully / spurious DTMF

Tim Petlock tim at petlock.net
Thu Feb 19 06:41:37 MST 2004


Thanks - that gave me the basis for a couple of google searches.
Near the top of the script I put in
$SIG{HUP} = \&exitGracefully;

and I added a subroutine that looks like this:

sub exitGracefully {
	exit(0);
}

It now kills itself off without needing to be killed and take * with it.

THANKS!!!

-Tim

-----Original Message-----
From: asterisk-users-admin at lists.digium.com
[mailto:asterisk-users-admin at lists.digium.com] On Behalf Of Steven
Critchfield
Sent: Wednesday, February 18, 2004 8:00 PM
To: asterisk-users at lists.digium.com
Subject: Re: [Asterisk-Users] agi scripting in perl - dealiing
withunexpected disconnects gracefully / spurious DTMF

On Wed, 2004-02-18 at 11:11, Tim Petlock wrote:

> If everything is entered correctly and perfectly the script works and
> the call goes through.  However, I've found that if I enter only a
> partial "calling card number" and then hang up the script will
continue
> to run with the perl process that it lives inside of taking up lots of
> processor time and for each failed call you get one of those
> disconnected processor-hungry processes.

When a user disconnects and asterisk hangs up the line, it closes it's
side of the pipes it uses to talk to AGI. If you don't handle a null
read from the pipe as a hangup, then it writes commands to asterisk and
then gets a null read back and loops hard and fast.

Maybe if I get some more time later I'll read the rest of that lengthy
post and see if there are more answers for you.
-- 
Steven Critchfield  <critch at basesys.com>

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list