Hey, that Lua code looks awfully familiar! (I wrote some of that on a snowy day in hotel room in Wisconsin...)<br><br>Okay, I think I see what you're trying to do. You just want to have the person press 1 to continue. Do you want something different to happen if the person presses a key other than 1? Just checking.<br>
<br>Also, I don't see any flushDigits in your script. Try adding this before your PAGD:<br>session:execute('flush_dtmf');<br><br>Try again, report back, etc.<br>-MC<br><br><div class="gmail_quote">On Fri, Jun 24, 2011 at 2:06 PM, Wes <span dir="ltr"><<a href="mailto:wes-fs@499x.com" target="_blank">wes-fs@499x.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I put flushDigits right before playAndGetDigits, but it is still<br>
queueing up keypresses... if I type more than one key, weird things<br>
start happening in my loop. (the one that prompts for 1 - play back<br>
recording, 2=submit recording, 3 = rerecord)... sometimes I get the<br>
message "invalid response" followed a few seconds by "your recording has<br>
been submitted", and I've not typed anything in between.<br>
<br>
incidentally, if I press a digit while playAndGetDigits is still<br>
speaking, it takes a few seconds for it to stop talking and act on the<br>
keypress... ... it just doesn't seem very responsive.... which is why<br>
I'm testing extra keypresses... because if users don't immediately get a<br>
response, they tend to press the key again.<br>
<div><br>
script here:<br>
<a href="http://pastebin.freeswitch.org/16584" target="_blank">http://pastebin.freeswitch.org/16584</a><br>
<br>
<br>
<br>
</div><div><div></div><div>On 6/24/2011 3:17 PM, Anthony Minessale wrote:<br>
> session:flushDigits() right before you collect DTMF and you will never<br>
> get any old dtmf<br>
><br>
><br>
> On Fri, Jun 24, 2011 at 2:51 PM, Wes<<a href="mailto:wes-fs@499x.com" target="_blank">wes-fs@499x.com</a>> wrote:<br>
>> I'm writing an ivr script in lua, and using playAndGetDigits in a couple<br>
>> different places. Both places just take a single digit to continue on.<br>
>> If the user presses 2 digits, it seems as if the second digit is being<br>
>> queued and it's being processed in the next call to playAndGetDigits.<br>
>> Often the extra digit is invalid, so when it tells the user to press a<br>
>> certain key, it follows immediately with the message "invalid key", due<br>
>> to the extra key being in the "queue"...<br>
>><br>
>> is this anything I can protect against? I found a flush_dtmf, but it<br>
>> is not very documented:<br>
>> <a href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_flush_dtmf" target="_blank">http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_flush_dtmf</a><br>
>><br>
>> and I also found this:<br>
>> <a href="http://wiki.freeswitch.org/wiki/Session_flushDigits" target="_blank">http://wiki.freeswitch.org/wiki/Session_flushDigits</a><br>
>><br>
>> but calling it before and after playAndGetDigits didn't *seem* to<br>
>> help... should it?<br>
>><br>
>> script here:<br>
>> <a href="http://pastebin.freeswitch.org/16584" target="_blank">http://pastebin.freeswitch.org/16584</a><br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Join us at ClueCon 2011, Aug 9-11, Chicago<br>
>> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
>><br>
>> FreeSWITCH-users mailing list<br>
>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>><br>
><br>
><br>
<br>
_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br>