<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>WAIT FOR DIGIT not working</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hello all,<BR>
<BR>
I have been trying to solve this problem for days, with no luck.<BR>
<BR>
When I run an AGI script from my extensions.conf, it seems no matter what I do, the "WAIT FOR DIGIT" command will not work. The system just flies past it without waiting a single millisecond, and of course my script crashes because it doesn't have the input it needs. I have run 3 different versions of Asterisk in the hopes of clearing this up, and presently am on 1.2.12.1.<BR>
<BR>
My script is simple:<BR>
------------------------------------------------------------------------<BR>
<BR>
#!/usr/bin/perl<BR>
<BR>
use POSIX;<BR>
<BR>
$| = 1;<BR>
<BR>
sub trim {<BR>
my @out = @_;<BR>
for (@out)<BR>
{<BR>
s/^\s+//;<BR>
s/\s+$//;<BR>
}<BR>
return wantarray ? @out : $out[0];<BR>
}<BR>
<BR>
while(<STDIN>) {<BR>
chomp;<BR>
last unless length($_);<BR>
if (/^agi_(\w+)\:\s+(.*)$/) {<BR>
$AGI{$1} = $2;<BR>
}<BR>
}<BR>
<BR>
print "EXEC Ringing\n";<BR>
print "EXEC Wait 1\n";<BR>
print "EXEC Answer\n";<BR>
print "EXEC Festival 'Please enter the extension you want to call'\n";<BR>
$target = "";<BR>
<BR>
print "WAIT FOR DIGIT 5000\n";<BR>
$target .= <STDIN>;<BR>
print "WAIT FOR DIGIT 5000\n";<BR>
$target .= <STDIN>;<BR>
print "WAIT FOR DIGIT 5000\n";<BR>
$target .= <STDIN>;<BR>
<BR>
print STDERR "Result was $target\n";<BR>
------------------------------------------------------------------------<BR>
<BR>
That's all there is to it, but it won't work.<BR>
<BR>
Can anyone help?<BR>
Thanks!!!<BR>
<BR>
~Joel<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>