diff options
author | Peter Kozak <spag@golwen.net> | 2013-04-08 16:01:52 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-04-08 16:01:52 +0200 |
commit | 8d8bf48aa95f979da8f67d274b66d5c207b8b667 (patch) | |
tree | d3941d8f9337dc8bd3e82dfa059d0300699ce9d1 /misc/freeswitch/scripts/dialplan | |
parent | 1b5cd43bcabd516f98117a16d44d2a7f1bf70600 (diff) |
dtmf test
Diffstat (limited to 'misc/freeswitch/scripts/dialplan')
-rw-r--r-- | misc/freeswitch/scripts/dialplan/functions.lua | 17 |
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 |