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 == "dtmf" then<br> freeswitch.consoleLog("info", "Key pressed: " .. data["digit"])<br> return "break"<br>
end<br>end<br><br>session:setVariable("jitterbuffer_msec", "200");<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("/usr/local/freeswitch/sounds/en/us/callie/voicemail/8000/vm-record_message.wav"); <br> <br> session:setInputCallback("key_press", "");<br> session:recordFile("/tmp/blah.wav", 5000, 10, 10); -- pressing key ends the recording<br>
session:streamFile("/tmp/blah.wav"); <br> end<br>end<br>-- --------------------------------------------------------------------------------------------------<br><br><br>