[Freeswitch-users] using keypress to stop a recording.

Michael Collins msc at freeswitch.org
Fri Jun 17 00:55:46 MSD 2011


How about setting this only to #?
http://wiki.freeswitch.org/wiki/Channel_Variables#playback_terminators

-MC

On Thu, Jun 16, 2011 at 11:54 AM, Wes <wes-fs at 499x.com> wrote:

> I'm using the following script to record, and I"m hoping to take a user
> keypress to trigger the end of the recording and then play it back:
>
> (the problem is that it stops on ANY keypress, while it seems like it
> should only break on a "#" keypress)
>
> I found this example at:
> http://wiki.freeswitch.org/wiki/Mod_lua#session:recordFile
>
> local numberToCall = 1234
> local session = freeswitch.Session("sofia/xxx.xxx.xxx.xxx/"..numberToCall);
> session:set_tts_parms("flite", "kal");
> session:speak("Thank you for using my recording service, press the pound
> key to stop the recording."  );
>
> function onInput(s, type, obj)
>   if (type == "dtmf" and obj['digit'] == '#') then
>       return "break";
>   end
> end
>
> session:setInputCallback("onInput", "");
> session:recordFile("/tmp/luatest.wav");
> freeswitch.consoleLog("info", "recording stopped by user keypress \n");
> session:speak("your voicehas been recorded, i will play it for you now");
> session:streamFile("/tmp/luatest.wav");
> session:speak("that's it, goodbye.");
> freeswitch.consoleLog("info", "hanging up... \n");
> session:hangup();
>
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110616/f5484502/attachment.html 


More information about the FreeSWITCH-users mailing list