diff options
author | Julian Pawlowski <julian.pawlowski@gmail.com> | 2013-01-28 14:17:52 +0100 |
---|---|---|
committer | Julian Pawlowski <julian.pawlowski@gmail.com> | 2013-01-28 14:17:52 +0100 |
commit | 8aa7de2636dcd22781b623d5c9270f5ecf8b85c2 (patch) | |
tree | 1bb5dc36fb28c96ad9be9a2357d380c2c24ee31e /misc/freeswitch/scripts/dialplan/voicemail.lua | |
parent | 39aa7132ceed3d4beab3a9b828e571bbfc67c07e (diff) | |
parent | 600574759573e48da9f5f82d4ff8a863b6830c95 (diff) |
Merge branch 'develop'5.1-beta2
Diffstat (limited to 'misc/freeswitch/scripts/dialplan/voicemail.lua')
-rw-r--r-- | misc/freeswitch/scripts/dialplan/voicemail.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/misc/freeswitch/scripts/dialplan/voicemail.lua b/misc/freeswitch/scripts/dialplan/voicemail.lua index 5d79ba3..4c96fbe 100644 --- a/misc/freeswitch/scripts/dialplan/voicemail.lua +++ b/misc/freeswitch/scripts/dialplan/voicemail.lua @@ -117,6 +117,7 @@ function Voicemail.leave(self, caller, phone_number) caller.uuid .. "'" ); caller:set_variable('voicemail_message_len', duration); + self:trigger_notification(caller); else caller:set_variable('voicemail_message_len'); end @@ -125,14 +126,11 @@ function Voicemail.leave(self, caller, phone_number) end -function Voicemail.send_notify(self, caller) - self.log:debug('VOICEMAIL_NOTIFY - account: ' .. self.record.auth_name .. ", id: " .. tostring(caller.uuid)); +function Voicemail.trigger_notification(self, caller) + local command = 'http_request.lua ' .. caller.uuid .. ' http://127.0.0.1/trigger/voicemail?sip_account_id=' .. tostring(self.id); - local file = io.popen("/opt/GS5/script/voicemail_new '" .. tostring(self.record.auth_name) .. "' '" .. tostring(caller.uuid) .. "' 2>&1"); - self.log:debug('VOICEMAIL_NOTIFY - result: ' .. tostring(file:read("*a"))); - file:close(); - - return true; + require 'common.fapi' + return common.fapi.FApi:new():execute('luarun', command); end |