<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Yes, that is your example modified a bit!<br>
    <br>
    I did not pastebin the latest version, but I did have it in there.&nbsp;
    anyway, it seems to be working better now when I tested it again.<br>
    <br>
    My intention is to detect a human, so that if I get a voicemail
    system, it won't end up recording.<br>
    <br>
    Is there a difference between:<br>
    <br>
    session:execute('flush_dtmf');<br>
    and<br>
    session:flushDigits()<br>
    <br>
    ?<br>
    <br>
    <br>
    On 6/24/2011 6:13 PM, Michael Collins wrote:
    <blockquote
      cite="mid:BANLkTikvF7pxRqZw+_Dh=EWfmSKRqB-CwA@mail.gmail.com"
      type="cite">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">&lt;<a moz-do-not-send="true"
            href="mailto:wes-fs@499x.com" target="_blank">wes-fs@499x.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          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. &nbsp;(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 moz-do-not-send="true"
              href="http://pastebin.freeswitch.org/16584"
              target="_blank">http://pastebin.freeswitch.org/16584</a><br>
            <br>
            <br>
            <br>
          </div>
          <div>
            <div>On 6/24/2011 3:17 PM, Anthony Minessale wrote:<br>
              &gt; session:flushDigits() right before you collect DTMF
              and you will never<br>
              &gt; get any old dtmf<br>
              &gt;<br>
              &gt;<br>
              &gt; On Fri, Jun 24, 2011 at 2:51 PM, Wes&lt;<a
                moz-do-not-send="true" href="mailto:wes-fs@499x.com"
                target="_blank">wes-fs@499x.com</a>&gt; &nbsp;wrote:<br>
              &gt;&gt; I'm writing an ivr script in lua, and using
              playAndGetDigits in a couple<br>
              &gt;&gt; different places. &nbsp;Both places just take a single
              digit to continue on.<br>
              &gt;&gt; If the user presses 2 digits, it seems as if the
              second digit is being<br>
              &gt;&gt; queued and it's being processed in the next call
              to playAndGetDigits.<br>
              &gt;&gt; Often the extra digit is invalid, so when it
              tells the user to press a<br>
              &gt;&gt; certain key, it follows immediately with the
              message "invalid key", due<br>
              &gt;&gt; to the extra key being in the "queue"...<br>
              &gt;&gt;<br>
              &gt;&gt; is this anything I can protect against? &nbsp; I found
              a flush_dtmf, but it<br>
              &gt;&gt; is not very documented:<br>
              &gt;&gt; <a moz-do-not-send="true"
                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>
              &gt;&gt;<br>
              &gt;&gt; and I also found this:<br>
              &gt;&gt; <a moz-do-not-send="true"
                href="http://wiki.freeswitch.org/wiki/Session_flushDigits"
                target="_blank">http://wiki.freeswitch.org/wiki/Session_flushDigits</a><br>
              &gt;&gt;<br>
              &gt;&gt; but calling it before and after playAndGetDigits
              didn't *seem* to<br>
              &gt;&gt; help... should it?<br>
              &gt;&gt;<br>
              &gt;&gt; script here:<br>
              &gt;&gt; <a moz-do-not-send="true"
                href="http://pastebin.freeswitch.org/16584"
                target="_blank">http://pastebin.freeswitch.org/16584</a><br>
              &gt;&gt;<br>
              &gt;&gt;<br>
              &gt;&gt;<br>
              &gt;&gt;<br>
              &gt;&gt; _______________________________________________<br>
              &gt;&gt; Join us at ClueCon 2011, Aug 9-11, Chicago<br>
              &gt;&gt; <a moz-do-not-send="true"
                href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
              877-7-4ACLUE<br>
              &gt;&gt;<br>
              &gt;&gt; FreeSWITCH-users mailing list<br>
              &gt;&gt; <a moz-do-not-send="true"
                href="mailto:FreeSWITCH-users@lists.freeswitch.org"
                target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
              &gt;&gt; <a moz-do-not-send="true"
                href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
                target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
              &gt;&gt; UNSUBSCRIBE:<a moz-do-not-send="true"
                href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
                target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
              &gt;&gt; <a moz-do-not-send="true"
                href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
              &gt;&gt;<br>
              &gt;<br>
              &gt;<br>
              <br>
              _______________________________________________<br>
              Join us at ClueCon 2011, Aug 9-11, Chicago<br>
              <a moz-do-not-send="true" href="http://www.cluecon.com"
                target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
              <br>
              FreeSWITCH-users mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:FreeSWITCH-users@lists.freeswitch.org"
                target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
              <a moz-do-not-send="true"
                href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
                target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
              UNSUBSCRIBE:<a moz-do-not-send="true"
                href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
                target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
              <a moz-do-not-send="true" href="http://www.freeswitch.org"
                target="_blank">http://www.freeswitch.org</a><br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a> 877-7-4ACLUE

FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
    </blockquote>
  </body>
</html>