[asterisk-users] AGI perl script set timeout within script?
    JR Richardson 
    jmr.richardson at gmail.com
       
    Thu Jan  7 17:27:55 CST 2010
    
    
  
Hi All,
I'm running an AGI, calling a perl script the does number lookups to a
remote server.  I would like to put a timeout in the script.  The
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.
Here is my clean script:
***********************************************************
#!/usr/bin/perl
$|=1;
#####################    Modules to Use       ###############
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
my %input = $AGI->ReadParse();
# Set variables according to supplied arguments
$number = $ARGV[0];
$AGI->exec("agi","agi://agi.server.com/script.agi?user=username&number=$number");
***********************************************************
Any assistance will be appreciated.
Thanks.
JR
-- 
JR Richardson
Engineering for the Masses
    
    
More information about the asterisk-users
mailing list