[Freeswitch-users] How to deal with user pressing extra keys? flush_dtmf? session::flushDigits?

Wes wes-fs at 499x.com
Mon Jun 27 21:30:39 MSD 2011


Yes, that is your example modified a bit!

I did not pastebin the latest version, but I did have it in there.  
anyway, it seems to be working better now when I tested it again.

My intention is to detect a human, so that if I get a voicemail system, 
it won't end up recording.

Is there a difference between:

session:execute('flush_dtmf');
and
session:flushDigits()

?


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


More information about the FreeSWITCH-users mailing list