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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user