Hi .<br>I had the same problem but downloaded a test script and wait for digit worked.<br>the only visible difference is that I wat nos using strict,<br><br>so I am rewriting the AGI with <br><br>use strict;<br><br>Hope this help.
<br><br><br><div><span class="gmail_quote">On 9/14/06, <b class="gmail_sendername">Joel Lansden</b> &lt;<a href="mailto:Joel@digitalparadise.net">Joel@digitalparadise.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">







<div>


<p><font size="2">Hello all,<br>
<br>
I have been trying to solve this problem <span id="st" name="st" class="st">for</span> days, with no luck.<br>
<br>
When I run an AGI script from my extensions.conf, it seems no matter what I do, the &quot;<span id="st" name="st" class="st">WAIT</span> <span id="st" name="st" class="st">FOR</span> <span id="st" name="st" class="st">DIGIT
</span>&quot; command will not work.&nbsp; The system just flies past it without waiting a single millisecond, and of course my script crashes because it doesn&#39;t have the input it needs.&nbsp; I have run 3 different versions of Asterisk in the hopes of clearing this up, and presently am on 
<a href="http://1.2.12.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">1.2.12.1</a>.<br>
<br>
My script is simple:<br>
------------------------------------------------------------------------<br>
<br>
#!/usr/bin/perl<br>
<br>
use POSIX;<br>
<br>
$| = 1;<br>
<br>
sub trim {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my @out = @_;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="st" name="st" class="st">for</span> (@out)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s/^\s+//;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s/\s+$//;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return wantarray ? @out : $out[0];<br>
}<br>
<br>
while(&lt;STDIN&gt;) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chomp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; last unless length($_);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (/^agi_(\w+)\:\s+(.*)$/) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $AGI{$1} = $2;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
}<br>
<br>
print &quot;EXEC Ringing\n&quot;;<br>
print &quot;EXEC <span id="st" name="st" class="st">Wait</span> 1\n&quot;;<br>
print &quot;EXEC Answer\n&quot;;<br>
print &quot;EXEC Festival &#39;Please enter the extension you want to call&#39;\n&quot;;<br>
$target = &quot;&quot;;<br>
<br>
print &quot;<span id="st" name="st" class="st">WAIT</span> <span id="st" name="st" class="st">FOR</span> <span id="st" name="st" class="st">DIGIT</span> 5000\n&quot;;<br>
$target .= &lt;STDIN&gt;;<br>
print &quot;<span id="st" name="st" class="st">WAIT</span> <span id="st" name="st" class="st">FOR</span> <span id="st" name="st" class="st">DIGIT</span> 5000\n&quot;;<br>
$target .= &lt;STDIN&gt;;<br>
print &quot;<span id="st" name="st" class="st">WAIT</span> <span id="st" name="st" class="st">FOR</span> <span id="st" name="st" class="st">DIGIT</span> 5000\n&quot;;<br>
$target .= &lt;STDIN&gt;;<br>
<br>
print STDERR &quot;Result was $target\n&quot;;<br>
------------------------------------------------------------------------<br>
<br>
That&#39;s all there is to it, but it won&#39;t work.<br>
<br>
Can anyone help?<br>
Thanks!!!<br>
<br>
~Joel<br>
<br>
</font>
</p>

</div>
<br>_______________________________________________<br>--Bandwidth and Colocation provided by <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://Easynews.com" target="_blank">Easynews.com</a> --<br><br>
asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> &nbsp; <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users
</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Camilo Echeverry<br><br>Your life would be very empty if you had nothing to regret.