[Freeswitch-users] jitter buffer effecting input callback in lua

Michael Jerris mike at jerris.com
Sun Jan 3 17:29:40 PST 2010


There is no reason I can think of that would cause this.  Have you  
tried different phones to eliminate if it is an issue just with one  
type of phone?  Please open a bug on jira.freeswitch.org with a  
minimal script example to reproduce and details of the devices it has  
been reproduced with.

Mike

On Jan 3, 2010, at 3:31 PM, Tom Carlson <tom at tomcarlson.com> wrote:

> I have a very simple lua script (shown below my message)
>
> 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.
>
> 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.
>
> The log shows no problems.
>
> How can I activate the jitter buffer, and still detect dtmf events?
>
> Thanks for your help.
>
> Tom
>
> --  
> ---------------------------------------------------------------------
> function key_press(session, input_type, data, args)
>   if input_type == "dtmf" then
>     freeswitch.consoleLog("info", "Key pressed: " .. data["digit"])
>     return "break"
>   end
> end
>
> session:setVariable("jitterbuffer_msec", "200");
> if session:ready() then
>   session:answer();
>   while (session:ready() == true) do
>     session:setAutoHangup(false);
>     session:sleep(1000);
>
>     session:streamFile("/usr/local/freeswitch/sounds/en/us/callie/ 
> voicemail/8000/vm-record_message.wav");
>
>     session:setInputCallback("key_press", "");
>     session:recordFile("/tmp/blah.wav", 5000, 10, 10); -- pressing  
> key ends the recording
>     session:streamFile("/tmp/blah.wav");
>   end
> end
> --   
> --- 
> --- 
> --- 
> --- 
> --- 
> --- 
> --- 
> --- 
> --- 
> --- 
> --------------------------------------------------------------------
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch- 
> users
> http://www.freeswitch.org




More information about the FreeSWITCH-users mailing list