summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/dialplan
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-04-08 15:36:30 +0200
committerPeter Kozak <spag@golwen.net>2013-04-08 15:36:30 +0200
commit1b5cd43bcabd516f98117a16d44d2a7f1bf70600 (patch)
tree21ed8af297cc0e788fc2cdbcedc2c841486e9ce3 /misc/freeswitch/scripts/dialplan
parent512c7e16b8164c85e4d6f473cf10bd25e6fc9ad2 (diff)
dtmf test
Diffstat (limited to 'misc/freeswitch/scripts/dialplan')
-rw-r--r--misc/freeswitch/scripts/dialplan/functions.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/misc/freeswitch/scripts/dialplan/functions.lua b/misc/freeswitch/scripts/dialplan/functions.lua
index ce99953..2edc131 100644
--- a/misc/freeswitch/scripts/dialplan/functions.lua
+++ b/misc/freeswitch/scripts/dialplan/functions.lua
@@ -116,6 +116,8 @@ function Functions.dialplan_function(self, caller, dialed_number)
result = self:call_parking_inout(caller, parameters[3], parameters[4]);
elseif fid == "cpai" then
result = self:call_parking_inout_index(caller, parameters[3]);
+ elseif fid == "test" then
+ result = self:test(caller, parameters[3]);
end
return result or { continue = false, code = 505, phrase = 'Error executing function', no_cdr = true };
@@ -912,3 +914,20 @@ function Functions.call_parking_inout_index(self, caller, stall_index)
return { continue = false, code = 200, phrase = 'OK', no_cdr = true }
end
+
+
+function Functions.test(self, caller, name)
+ if tostring(name) == 'dtmf' then
+ while caller:ready() do
+ local digits = caller.session:read(1, 1, '', 30000, '');
+ if digits == "" then
+ break;
+ end
+ caller:send_display('DTMF: ', digits);
+ caller.session:say(digits, "en", "number", "pronounced");
+ self.log:devel('DTMF: ', digits);
+ end
+ end
+
+ return { continue = false, code = 200, phrase = 'OK', no_cdr = true }
+end