summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/dialplan/dtmf.lua
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 12:22:29 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 12:22:29 +0100
commit67c1a0a951403a546250ea860a3e3d199cae2fce (patch)
treef86ec6cedf081a1a57005eca1661e9bead34e4de /misc/freeswitch/scripts/dialplan/dtmf.lua
parent5d8ce5f4775ac8bc5f523964e6e36f63ff3c4683 (diff)
parent211f558a86ae30cdd5b392ab1376e1393f97e22c (diff)
Merge branch 'develop'5.1-beta6
Diffstat (limited to 'misc/freeswitch/scripts/dialplan/dtmf.lua')
-rw-r--r--misc/freeswitch/scripts/dialplan/dtmf.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/misc/freeswitch/scripts/dialplan/dtmf.lua b/misc/freeswitch/scripts/dialplan/dtmf.lua
index 4dbd35f..64f538e 100644
--- a/misc/freeswitch/scripts/dialplan/dtmf.lua
+++ b/misc/freeswitch/scripts/dialplan/dtmf.lua
@@ -17,12 +17,17 @@ function Dtmf.new(self, arg)
self.bleg = arg.bleg
self.digit_timeout = arg.digit_timeout or 5;
self.router = arg.router;
+ self.digit_duration_min = arg.digit_duration_min or 500;
return object;
end
function Dtmf.detect(self, caller, sequence, digit, duration, calee)
+ if not tonumber(duration) or duration < self.digit_duration_min then
+ return;
+ end
+
local timestamp = os.time();
if timestamp - sequence.updated > self.digit_timeout then
sequence.digits = digit;
@@ -63,6 +68,9 @@ function Dtmf.transfer(self, caller, destination, calee)
caller:execute('transfer', destination);
fapi:execute('uuid_kill', callee_uuid);
else
+ if caller.account then
+ fapi:execute('uuid_setvar_multi', callee_uuid .. ' gs_auth_account_type=' .. caller.account.class .. ';gs_auth_account_uuid=' .. caller.account.uuid);
+ end
fapi:execute('uuid_transfer', callee_uuid .. ' ' .. destination);
caller.session:hangup();
end