I have a very simple lua script (shown below my message)<br><br>This script plays a greeting, lets the caller record a message, detecting when caller is done by sensing a keypress.  It then plays the message back to the caller.  <br>
<br>This works perfectly, except the audio quality of the recorded message is less than I had hoped.  To try to fix this, I have added a line to activate the jitter buffer.  This single line keeps the script from detecting the dtmf tones that end the recording, so the script just stays locked in record mode forever, until you hang up.<br>
<br>The log shows no problems.<br><br>How can I activate the jitter buffer, and still detect dtmf events?<br><br>Thanks for your help.<br><br>Tom<br><br>-- ---------------------------------------------------------------------<br>
function key_press(session, input_type, data, args)<br>  if input_type == &quot;dtmf&quot; then<br>    freeswitch.consoleLog(&quot;info&quot;, &quot;Key pressed: &quot; .. data[&quot;digit&quot;])<br>    return &quot;break&quot;<br>
  end<br>end<br><br>session:setVariable(&quot;jitterbuffer_msec&quot;, &quot;200&quot;);<br>if session:ready() then<br>  session:answer();<br>  while (session:ready() == true) do<br>    session:setAutoHangup(false);<br>    session:sleep(1000);<br>
<br>    session:streamFile(&quot;/usr/local/freeswitch/sounds/en/us/callie/voicemail/8000/vm-record_message.wav&quot;);   <br>   <br>    session:setInputCallback(&quot;key_press&quot;, &quot;&quot;);<br>    session:recordFile(&quot;/tmp/blah.wav&quot;, 5000, 10, 10); -- pressing key ends the recording<br>
    session:streamFile(&quot;/tmp/blah.wav&quot;); <br>  end<br>end<br>--  --------------------------------------------------------------------------------------------------<br><br><br>