diff options
Diffstat (limited to 'misc/freeswitch/scripts/dialplan/functions.lua')
-rw-r--r-- | misc/freeswitch/scripts/dialplan/functions.lua | 14 |
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 |