[asterisk-users] AGI perl script set timeout within script?

David Backeberg dbackeberg at gmail.com
Thu Jan 7 18:59:24 CST 2010


On Thu, Jan 7, 2010 at 6:27 PM, JR Richardson <jmr.richardson at gmail.com> wrote:
> problem I'm running into is if the DNS server is not responding, the
> script hangs and waits for 30 seconds before returning to the Asterisk
> dialplan.  I would like a timeout of 1 second, then return.

A few things...

* stop using DNS? Problem solved.
* put nagios monitoring on your DNS server?
* put in a second DNS server, and tune your DNS timeout to a very low
value in /etc/resolv.conf (read the man page) before jumping to next
server?

Or you could use the Perl language feature, which is called 'alarm'.
Google around for some code samples.

None of these are actually specific to asterisk, as it turns out. I
don't know of any explicit asterisk method to force a timeout.



More information about the asterisk-users mailing list