Phrases: Save phrases xml and delete phrases from memcache after converting to/from base64 in app_defaults.

IVR: Using phrase greetings, DTMF tones now captured and executed, but only after playback completes (uses session:variable).  Still searching for a better solution.
This commit is contained in:
Nate Jones
2015-04-28 17:24:32 +00:00
parent 8fe9a0432d
commit 3b9c777d77
3 changed files with 66 additions and 12 deletions

View File

@@ -67,6 +67,7 @@
--define the on_dtmf call back function
function on_dtmf(s, type, obj, arg)
if (type == "dtmf") then
session:setVariable("dtmf_digits", obj['digit']);
freeswitch.console_log("info", "[streamfile] dtmf digit: " .. obj['digit'] .. ", duration: " .. obj['duration'] .. "\n");
if (obj['digit'] == "*") then
return("false"); --return to previous
@@ -131,7 +132,14 @@
--stream file if exists
if (session:ready()) then
session:answer();
session:sleep(1000);
slept = session:getVariable("slept");
if (slept == nil or slept == "false") then
freeswitch.consoleLog("notice", "[ivr_menu] sleeping....\n");
session:sleep(1000);
if (slept == "false") then
session:setVariable("slept", "true");
end
end
session:setInputCallback("on_dtmf", "");
session:streamFile(file_name);
end