<br><br><div class="gmail_quote">On Thu, Jun 16, 2011 at 2:52 PM, Wes <span dir="ltr">&lt;<a href="mailto:wes-fs@499x.com">wes-fs@499x.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>

  
    
  
  <div bgcolor="#ffffff" text="#000000">
    ok, tried that, but it didn&#39;t change the behavior  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.  So this must be the default behavior of how
    to stop the recording...<br>
    <br>
    Can anyone confirm this?<br>
    <br></div></blockquote><div>I can. It does indeed always stop the recording. Not sure why. However, there is a simple workaround. Instead of using setInputCallback just do this:</div><div><br></div><div>session:setVariable(&#39;playback_terminators&#39;,&#39;#&#39;);</div>
<div>session:execute(&#39;record&#39;,&#39;/tmp/foo.wav&#39;);</div><div><br></div><div>You would, though, need to setInputCallback while you are playing the followup message to the caller. BTW, if you have the FS book I did an example of this, in Lua, where the caller records something then he can listen, accept, or re-record. Check out chapter 7. FYI, download the code samples because there&#39;s a bug in the text. (Missing the session:ready() check on one or more while loops, IIRC.)</div>
<div><br></div><div>-MC </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#ffffff" text="#000000">
    Thanks.<div><div></div><div class="h5"><br>
    <br>
    <br>
    On 6/16/2011 4:32 PM, Michael Collins wrote:
    <blockquote type="cite">It&#39;s just a channel variable. Set it prior to calling
      the Lua script or use
      session:setVariable(&quot;playback_terminators&quot;,&quot;#&quot;)
      <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 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">
            <div bgcolor="#ffffff" text="#000000"> I&#39;m writing a lua
              script, that link you mention doesn&#39;t seem like something
              I can do in LUA...<br>
              <br>
              the problem is in this function:
              <div><br>
                <br>
                function onInput(s, type, obj)<br>
                  if (type == &quot;dtmf&quot; and obj[&#39;digit&#39;] == &#39;#&#39;) then<br>
                      return &quot;break&quot;;<br>
                  end<br>
                end<br>
                <br>
              </div>
              which seems to break on any keypress, so the check for #
              doesn&#39;t work as expected.<br>
              <br>
              is there a different way to do this with a lua script? 
              Ideally, I&#39;d like to do more than just break, I&#39;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.  Like
              a voicemail system, actually.
              <div>
                <div><br>
                  <br>
                  On 6/16/2011 3:55 PM, Michael Collins wrote: </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div>How about setting this only to #?
                    <div><a 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 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&#39;m
                          using the following script to record, and I&quot;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 &quot;#&quot; keypress)<br>
                          <br>
                          I found this example at:<br>
                          <a 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(&quot;sofia/xxx.xxx.xxx.xxx/&quot;..numberToCall);<br>
                          session:set_tts_parms(&quot;flite&quot;, &quot;kal&quot;);<br>
                          session:speak(&quot;Thank you for using my
                          recording service, press the pound<br>
                          key to stop the recording.&quot;  );<br>
                          <br>
                          function onInput(s, type, obj)<br>
                            if (type == &quot;dtmf&quot; and obj[&#39;digit&#39;] == &#39;#&#39;)
                          then<br>
                                return &quot;break&quot;;<br>
                            end<br>
                          end<br>
                          <br>
                          session:setInputCallback(&quot;onInput&quot;, &quot;&quot;);<br>
                          session:recordFile(&quot;/tmp/luatest.wav&quot;);<br>
                          freeswitch.consoleLog(&quot;info&quot;, &quot;recording
                          stopped by user keypress \n&quot;);<br>
                          session:speak(&quot;your voicehas been recorded, i
                          will play it for you now&quot;);<br>
                          session:streamFile(&quot;/tmp/luatest.wav&quot;);<br>
                          session:speak(&quot;that&#39;s it, goodbye.&quot;);<br>
                          freeswitch.consoleLog(&quot;info&quot;, &quot;hanging up...
                          \n&quot;);<br>
                          session:hangup();<br>
                          <br>
                          <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>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </div>
                </div>
                <pre><fieldset></fieldset>
_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE

FreeSWITCH-users mailing list
<div><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a 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 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>
          </blockquote>
        </div>
        <br>
      </div>
      <pre><fieldset></fieldset>
_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
    </blockquote>
  </div></div></div>

<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">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></blockquote></div><br>