summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/dialplan/functions.lua
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-28 09:09:57 +0100
committerPeter Kozak <spag@golwen.net>2013-03-28 09:09:57 +0100
commit6c8f3e9536da2e8364de6696f8e0bb38032d067c (patch)
treec293cbcc9a5db2247370f02f9a244cd7de7d54de /misc/freeswitch/scripts/dialplan/functions.lua
parent22ba2cab06b81120d8ac3ff99815fab293566932 (diff)
vmplay dialplan function added
Diffstat (limited to 'misc/freeswitch/scripts/dialplan/functions.lua')
-rw-r--r--misc/freeswitch/scripts/dialplan/functions.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/misc/freeswitch/scripts/dialplan/functions.lua b/misc/freeswitch/scripts/dialplan/functions.lua
index 6399c5e..ce99953 100644
--- a/misc/freeswitch/scripts/dialplan/functions.lua
+++ b/misc/freeswitch/scripts/dialplan/functions.lua
@@ -102,6 +102,8 @@ function Functions.dialplan_function(self, caller, dialed_number)
result = self:voicemail_message_leave(caller, parameters[3]);
elseif fid == "vmcheck" then
result = self:voicemail_check(caller, parameters[3]);
+ elseif fid == "vmplay" then
+ result = self:voicemail_play(caller, tostring(parameters[3]) .. '-' .. tostring(parameters[4]) .. '-' .. tostring(parameters[5]) .. '-' .. tostring(parameters[6]) .. '-' .. tostring(parameters[7]));
elseif fid == "vmtg" then
result = self:call_forwarding_toggle(caller, nil, parameters[3]);
elseif fid == "acdmtg" then
@@ -777,6 +779,18 @@ function Functions.voicemail_check(self, caller, number)
end
+function Functions.voicemail_play(self, caller, uuid)
+ require 'dialplan.voicemail';
+
+ local voicemail_account = dialplan.voicemail.Voicemail:new{ log = self.log, database = self.database }:find_by_sip_account_id(caller.auth_account.id);
+
+ if voicemail_account then
+ local message = voicemail_account:message_play(caller, uuid);
+ end
+
+ return { continue = false, code = 200, phrase = 'OK', no_cdr = true }
+end
+
function Functions.acd_membership_toggle(self, caller, agent_id, phone_number)
-- Find caller's SipAccount