<!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">
    ok, tried that, but it didn't change the behavior&nbsp; In fact, I
    removed both the onInput function, and the call to
    session:setVariable, and the recording is still halted by *any*
    keypress on the keypad.&nbsp; So this must be the default behavior of how
    to stop the recording...<br>
    <br>
    Can anyone confirm this?<br>
    <br>
    Thanks.<br>
    <br>
    <br>
    On 6/16/2011 4:32 PM, Michael Collins wrote:
    <blockquote
      cite="mid:BANLkTikY45-Pys5+9rY48nT_+Zx+Vxfokg@mail.gmail.com"
      type="cite">It's just a channel variable. Set it prior to calling
      the Lua script or use
      session:setVariable("playback_terminators","#")
      <div><br>
      </div>
      <div>-MC<br>
        <br>
        <div class="gmail_quote">On Thu, Jun 16, 2011 at 2:29 PM, Wes <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:wes-fs@499x.com">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;">
            <div bgcolor="#ffffff" text="#000000"> I'm writing a lua
              script, that link you mention doesn't seem like something
              I can do in LUA...<br>
              <br>
              the problem is in this function:
              <div class="im"><br>
                <br>
                function onInput(s, type, obj)<br>
                &nbsp; if (type == "dtmf" and obj['digit'] == '#') then<br>
                &nbsp; &nbsp; &nbsp; return "break";<br>
                &nbsp; end<br>
                end<br>
                <br>
              </div>
              which seems to break on any keypress, so the check for #
              doesn't work as expected.<br>
              <br>
              is there a different way to do this with a lua script?&nbsp;
              Ideally, I'd like to do more than just break, I'd like the
              user to be able to review the message more than once, and
              then finally hit another key to submit it for real.&nbsp; Like
              a voicemail system, actually.
              <div>
                <div class="h5"><br>
                  <br>
                  On 6/16/2011 3:55 PM, Michael Collins wrote: </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">How about setting this only to #?
                    <div><a moz-do-not-send="true"
href="http://wiki.freeswitch.org/wiki/Channel_Variables#playback_terminators"
                        target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#playback_terminators</a></div>
                    <div><br>
                    </div>
                    <div>-MC<br>
                      <br>
                      <div class="gmail_quote">On Thu, Jun 16, 2011 at
                        11:54 AM, 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'm
                          using the following script to record, and I"m
                          hoping to take a user<br>
                          keypress to trigger the end of the recording
                          and then play it back:<br>
                          <br>
                          (the problem is that it stops on ANY keypress,
                          while it seems like it<br>
                          should only break on a "#" keypress)<br>
                          <br>
                          I found this example at:<br>
                          <a moz-do-not-send="true"
                            href="http://wiki.freeswitch.org/wiki/Mod_lua#session:recordFile"
                            target="_blank">http://wiki.freeswitch.org/wiki/Mod_lua#session:recordFile</a><br>
                          <br>
                          local numberToCall = 1234<br>
                          local session =
                          freeswitch.Session("sofia/xxx.xxx.xxx.xxx/"..numberToCall);<br>
                          session:set_tts_parms("flite", "kal");<br>
                          session:speak("Thank you for using my
                          recording service, press the pound<br>
                          key to stop the recording." &nbsp;);<br>
                          <br>
                          function onInput(s, type, obj)<br>
                          &nbsp; if (type == "dtmf" and obj['digit'] == '#')
                          then<br>
                          &nbsp; &nbsp; &nbsp; return "break";<br>
                          &nbsp; end<br>
                          end<br>
                          <br>
                          session:setInputCallback("onInput", "");<br>
                          session:recordFile("/tmp/luatest.wav");<br>
                          freeswitch.consoleLog("info", "recording
                          stopped by user keypress \n");<br>
                          session:speak("your voicehas been recorded, i
                          will play it for you now");<br>
                          session:streamFile("/tmp/luatest.wav");<br>
                          session:speak("that's it, goodbye.");<br>
                          freeswitch.consoleLog("info", "hanging up...
                          \n");<br>
                          session:hangup();<br>
                          <br>
                          <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>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </div>
                </div>
                <pre><fieldset></fieldset>
_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
<a moz-do-not-send="true" href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE

FreeSWITCH-users mailing list
<div class="im"><a moz-do-not-send="true" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<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>
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>
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</div></pre>
              </blockquote>
            </div>
            <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">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>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <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>