Voicemail - Edit: Add controls to manage Recording Instructions and Options, Only show Alternate Greeting ID if using Default greeting.

This commit is contained in:
fusionate
2023-06-28 02:11:01 +00:00
parent 24197a88d6
commit 5ef1c225f6
6 changed files with 203 additions and 11 deletions

View File

@@ -79,6 +79,7 @@
effective_caller_id_name = session:getVariable("effective_caller_id_name");
voicemail_greeting_number = session:getVariable("voicemail_greeting_number");
skip_instructions = session:getVariable("skip_instructions");
skip_options = session:getVariable("skip_options");
skip_greeting = session:getVariable("skip_greeting");
vm_message_ext = session:getVariable("vm_message_ext");
vm_say_caller_id_number = session:getVariable("vm_say_caller_id_number");

View File

@@ -1,5 +1,5 @@
-- Part of FusionPBX
-- Copyright (C) 2013-2022 Mark J Crane <markjcrane@fusionpbx.com>
-- Copyright (C) 2013-2023 Mark J Crane <markjcrane@fusionpbx.com>
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -65,6 +65,25 @@
local message_silence_seconds = settings:get('voicemail', 'message_silence_seconds', 'numeric') or 3;
local email_queue_enabled = settings:get('email_queue', 'enabled', 'boolean') or "false";
--get recording instructions and options settings
local sql = [[SELECT voicemail_recording_instructions, voicemail_recording_options FROM v_voicemails
WHERE domain_uuid = :domain_uuid
AND voicemail_id = :voicemail_id ]];
local params = {domain_uuid = domain_uuid, voicemail_id = voicemail_id};
dbh:query(sql, params, function(row)
voicemail_recording_instructions = row.voicemail_recording_instructions;
voicemail_recording_options = row.voicemail_recording_options;
end);
--check voicemail recording instructions setting
if (skip_instructions == nil) then
if (voicemail_recording_instructions == 'true') then
skip_instructions = 'false';
elseif (voicemail_recording_instructions == 'false') then
skip_instructions = 'true';
end
end
--record your message at the tone press any key or stop talking to end the recording
if (skip_instructions == "true") then
--skip the instructions
@@ -258,9 +277,18 @@
end
end
--instructions press 1 to listen to the recording, press 2 to save the recording, press 3 to re-record
--check voicemail recording options setting
if (skip_options == nil) then
if (voicemail_recording_options == 'true') then
skip_options = 'false';
elseif (voicemail_recording_options == 'false') then
skip_options = 'true';
end
end
--options press 1 to listen to the recording, press 2 to save the recording, press 3 to re-record
if (session:ready()) then
if (skip_instructions == "true") then
if (skip_options == "true") then
--save the message
dtmf_digits = '';
session:execute("playback", "phrase:voicemail_ack:saved");