summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/freeswitch/scripts/dialplan/functions.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/misc/freeswitch/scripts/dialplan/functions.lua b/misc/freeswitch/scripts/dialplan/functions.lua
index 2edc131..0c30b86 100644
--- a/misc/freeswitch/scripts/dialplan/functions.lua
+++ b/misc/freeswitch/scripts/dialplan/functions.lua
@@ -918,14 +918,21 @@ end
function Functions.test(self, caller, name)
if tostring(name) == 'dtmf' then
+ local digits = '';
while caller:ready() do
- local digits = caller.session:read(1, 1, '', 30000, '');
- if digits == "" then
- break;
+ if digits == '' then
+ caller:playback('ivr/ivr-love_those_touch_tones.wav');
end
- caller:send_display('DTMF: ', digits);
- caller.session:say(digits, "en", "number", "pronounced");
+ digits = caller.session:read(1, 1, '', 5000, '');
self.log:devel('DTMF: ', digits);
+ caller:send_display('DTMF: ', digits);
+ if digits == '*' then
+ caller:playback('digits/star.wav');
+ elseif digits == '#' then
+ caller:playback('digits/pound.wav');
+ elseif digits ~= '' then
+ caller.session:say(digits, "en", "number", "pronounced");
+ end
end
end