mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-10 10:38:22 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user