Voicemail to sms notification (#2205)

Requires that you have fusionpbx-apps/sms

Doesn’t impact anything if you don’t have it. Must be enabled with
default_setting voicemail_to_sms

Everything is disabled by default and the fields in voicemail_edit.php
are hidden by default.
This commit is contained in:
Chris Black
2016-11-30 16:26:39 -07:00
committed by FusionPBX
parent 848a8f9b8e
commit 1431a8a3fb
5 changed files with 161 additions and 0 deletions
@@ -158,6 +158,19 @@
end
end
end
if (settings['voicemail']['voicemail_to_sms'] ~= nil) then
if (settings['voicemail']['voicemail_to_sms']['boolean'] ~= nil) then
voicemail_to_sms = settings['voicemail']['voicemail_to_sms']['boolean'];
else
voicemail_to_sms = false;
end
end
if (settings['voicemail']['voicemail_to_sms'] ~= nil) then
if (settings['voicemail']['voicemail_to_sms_did']['text'] ~= nil) then
voicemail_to_sms_did = settings['voicemail']['voicemail_to_sms_did']['text'];
end
end
if (not temp_dir) or (#temp_dir == 0) then
if (settings['server'] ~= nil) then
if (settings['server']['temp'] ~= nil) then
@@ -241,6 +254,7 @@
require "app.voicemail.resources.functions.listen_to_recording";
require "app.voicemail.resources.functions.message_waiting";
require "app.voicemail.resources.functions.send_email";
require "app.voicemail.resources.functions.send_sms";
require "app.voicemail.resources.functions.delete_recording";
require "app.voicemail.resources.functions.message_saved";
require "app.voicemail.resources.functions.return_call";
@@ -509,6 +523,9 @@
--send the email with the voicemail recording attached
if (tonumber(message_length) > 2) then
send_email(voicemail_id_copy, voicemail_message_uuid);
if (voicemail_to_sms) then
send_sms(voicemail_id_copy, voicemail_message_uuid);
end
end
end --for