ok, tried that, but it didn'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...
Can anyone confirm this?
Thanks.
On 6/16/2011 4:32 PM, Michael Collins wrote:
It's just a channel variable. Set it prior to calling
the Lua script or use
session:setVariable("playback_terminators","#")
-MC
On Thu, Jun 16, 2011 at 2:29 PM, Wes <wes-fs@499x.com>
wrote:
I'm writing a lua
script, that link you mention doesn't seem like something
I can do in LUA...
the problem is in this function:
function onInput(s, type, obj)
if (type == "dtmf" and obj['digit'] == '#') then
return "break";
end
end
which seems to break on any keypress, so the check for #
doesn't work as expected.
is there a different way to do this with a lua script?
Ideally, I'd like to do more than just break, I'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.
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();
_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list