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

2004-02-19 Thread Tim Petlock
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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven
Critchfield
Sent: Wednesday, February 18, 2004 8:00 PM
To: [EMAIL PROTECTED]
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  [EMAIL PROTECTED]

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


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

2004-02-19 Thread James Golovich
Also since you are using Asterisk::AGI you can register a callback that
gets called when most of the AGI commands return error/hangup.

James

On Thu, 19 Feb 2004, Tim Petlock wrote:

 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
 

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


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

2004-02-19 Thread Nicolas Gudino
On Thu, 2004-02-19 at 19:00, Tim Petlock wrote:
 I need to do something like this because I've timed calls with a
 stopwatch and can't figure out why the records going into the CDR table
 are 20 seconds longer (or more) than the actual call time.  I understand
 that the actual call time includes the time spent entering and
 validating data but I've sat and timed it with a stopwatch and the CDR
 is always longer than reality.
 
 -Tim

Hi Tim,

In my case, the CDRs are longer because asterisk last inbetween 5 an 10
seconds to detect the hangup. You should take that into account.


-- 
Nicolas Gudino [EMAIL PROTECTED]
House Internet S.R.L.

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users