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
No known key found for this signature in database
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");

View File

@ -425,6 +425,14 @@
$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Used to provide an alternate id for the voicemail announcement.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_recording_instructions";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_recording_options";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_mail_to";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';

View File

@ -117,6 +117,19 @@ if ($domains_processed == 1) {
$database = new database;
$database->execute($sql);
unset($sql);
//set default value of voicemail_recording_instructions to true
$sql = "update v_voicemails set voicemail_recording_instructions = 'true' where voicemail_recording_instructions is null";
$database = new database;
$database->execute($sql);
unset($sql);
//set default value of voicemail_recording_options to true
$sql = "update v_voicemails set voicemail_recording_options = 'true' where voicemail_recording_options is null";
$database = new database;
$database->execute($sql);
unset($sql);
}
?>
?>

View File

@ -434,8 +434,8 @@ $text['label-voicemail_password']['zh-cn'] = "密码";
$text['label-voicemail_password']['ja-jp'] = "パスワード";
$text['label-voicemail_password']['ko-kr'] = "비밀번호";
$text['label-voicemail_alternate_greet_id']['en-us'] = "Alternate Greet ID";
$text['label-voicemail_alternate_greet_id']['en-gb'] = "Alternate Greet ID";
$text['label-voicemail_alternate_greet_id']['en-us'] = "Alternate Greeting ID";
$text['label-voicemail_alternate_greet_id']['en-gb'] = "Alternate Greeting ID";
$text['label-voicemail_alternate_greet_id']['ar-eg'] = "معرف الترحيب البديل";
$text['label-voicemail_alternate_greet_id']['de-at'] = "ID der alternativen Begrüßung";
$text['label-voicemail_alternate_greet_id']['de-ch'] = "ID der alternativen Begrüßung";
@ -1082,6 +1082,54 @@ $text['label-greeting']['zh-cn'] = "问候语";
$text['label-greeting']['ja-jp'] = "挨拶";
$text['label-greeting']['ko-kr'] = "인사";
$text['label-recording_instructions']['en-us'] = "Recording Instructions";
$text['label-recording_instructions']['en-gb'] = "Recording Instructions";
$text['label-recording_instructions']['ar-eg'] = "تعليمات التسجيل";
$text['label-recording_instructions']['de-at'] = "Aufnahmeanweisungen";
$text['label-recording_instructions']['de-ch'] = "Aufnahmeanweisungen";
$text['label-recording_instructions']['de-de'] = "Aufnahmeanweisungen";
$text['label-recording_instructions']['es-cl'] = "Instrucciones de grabación";
$text['label-recording_instructions']['es-mx'] = "Instrucciones de grabación";
$text['label-recording_instructions']['fr-ca'] = "Instructions d'enregistrement";
$text['label-recording_instructions']['fr-fr'] = "Instructions d'enregistrement";
$text['label-recording_instructions']['he-il'] = "הוראות הקלטה";
$text['label-recording_instructions']['it-it'] = "Istruzioni per la registrazione";
$text['label-recording_instructions']['nl-nl'] = "Opname instructies";
$text['label-recording_instructions']['pl-pl'] = "Instrukcje nagrywania";
$text['label-recording_instructions']['pt-br'] = "Instruções de gravação";
$text['label-recording_instructions']['pt-pt'] = "Instruções de gravação";
$text['label-recording_instructions']['ro-ro'] = "Instrucțiuni de înregistrare";
$text['label-recording_instructions']['ru-ru'] = "Инструкции по записи";
$text['label-recording_instructions']['sv-se'] = "Inspelningsinstruktioner";
$text['label-recording_instructions']['uk-ua'] = "Інструкції щодо запису";
$text['label-recording_instructions']['zh-cn'] = "錄音說明";
$text['label-recording_instructions']['ja-jp'] = "録音手順";
$text['label-recording_instructions']['ko-kr'] = "녹음 지침";
$text['label-recording_options']['en-us'] = "Recording Options";
$text['label-recording_options']['en-gb'] = "Recording Options";
$text['label-recording_options']['ar-eg'] = "خيارات التسجيل";
$text['label-recording_options']['de-at'] = "Aufnahmeoptionen";
$text['label-recording_options']['de-ch'] = "Aufnahmeoptionen";
$text['label-recording_options']['de-de'] = "Aufnahmeoptionen";
$text['label-recording_options']['es-cl'] = "Opciones de grabación";
$text['label-recording_options']['es-mx'] = "Opciones de grabación";
$text['label-recording_options']['fr-ca'] = "Options d'enregistrement";
$text['label-recording_options']['fr-fr'] = "Options d'enregistrement";
$text['label-recording_options']['he-il'] = "אפשרויות הקלטה";
$text['label-recording_options']['it-it'] = "Opzioni di registrazione";
$text['label-recording_options']['nl-nl'] = "Opname opties";
$text['label-recording_options']['pl-pl'] = "Opcje nagrywania";
$text['label-recording_options']['pt-br'] = "Opções de Gravação";
$text['label-recording_options']['pt-pt'] = "Opções de Gravação";
$text['label-recording_options']['ro-ro'] = "Opțiuni de înregistrare";
$text['label-recording_options']['ru-ru'] = "Параметры записи";
$text['label-recording_options']['sv-se'] = "Inspelningsalternativ";
$text['label-recording_options']['uk-ua'] = "Параметри запису";
$text['label-recording_options']['zh-cn'] = "錄音選項";
$text['label-recording_options']['ja-jp'] = "録音オプション";
$text['label-recording_options']['ko-kr'] = "녹음 옵션";
$text['label-forward_destinations']['en-us'] = "Forward Destinations";
$text['label-forward_destinations']['en-gb'] = "Forward Destinations";
$text['label-forward_destinations']['ar-eg'] = "وجهات أمامية";
@ -1876,6 +1924,54 @@ $text['description-voicemail_tutorial']['zh-cn'] = "下次语音信箱登录后
$text['description-voicemail_tutorial']['ja-jp'] = "次回ボイスメールにログインした後、ボイスメール チュートリアルを再生します。";
$text['description-voicemail_tutorial']['ko-kr'] = "다음 음성 메일 로그인 후 음성 메일 자습서를 재생합니다.";
$text['description-recording_instructions']['en-us'] = "Play recording instructions (before recording).";
$text['description-recording_instructions']['en-gb'] = "Play recording instructions (before recording).";
$text['description-recording_instructions']['ar-eg'] = "قم بتشغيل تعليمات تسجيل البريد الصوتي.";
$text['description-recording_instructions']['de-at'] = "Spielen Sie die Anweisungen zur Voicemail-Aufzeichnung ab.";
$text['description-recording_instructions']['de-ch'] = "Spielen Sie die Anweisungen zur Voicemail-Aufzeichnung ab.";
$text['description-recording_instructions']['de-de'] = "Spielen Sie die Anweisungen zur Voicemail-Aufzeichnung ab.";
$text['description-recording_instructions']['es-cl'] = "Reproduzca las instrucciones de grabación del correo de voz.";
$text['description-recording_instructions']['es-mx'] = "Reproduzca las instrucciones de grabación del correo de voz.";
$text['description-recording_instructions']['fr-ca'] = "Lisez les instructions d'enregistrement de la messagerie vocale.";
$text['description-recording_instructions']['fr-fr'] = "Lisez les instructions d'enregistrement de la messagerie vocale.";
$text['description-recording_instructions']['he-il'] = "הפעל את הוראות הקלטת הדואר הקולי.";
$text['description-recording_instructions']['it-it'] = "Riproduci le istruzioni di registrazione della segreteria telefonica.";
$text['description-recording_instructions']['nl-nl'] = "Speel de voicemail-opname-instructies af.";
$text['description-recording_instructions']['pl-pl'] = "Odtwórz instrukcje dotyczące nagrywania poczty głosowej.";
$text['description-recording_instructions']['pt-br'] = "Reproduza as instruções de gravação do correio de voz.";
$text['description-recording_instructions']['pt-pt'] = "Reproduza as instruções de gravação do correio de voz.";
$text['description-recording_instructions']['ro-ro'] = "Redați instrucțiunile de înregistrare a mesajelor vocale.";
$text['description-recording_instructions']['ru-ru'] = "Воспроизведите инструкции по записи голосовой почты.";
$text['description-recording_instructions']['sv-se'] = "Spela upp instruktionerna för röstmeddelandeinspelning.";
$text['description-recording_instructions']['uk-ua'] = "Відтворіть інструкції щодо запису голосової пошти.";
$text['description-recording_instructions']['zh-cn'] = "播放語音郵件錄音說明。";
$text['description-recording_instructions']['ja-jp'] = "ボイスメールの録音手順を再生します。";
$text['description-recording_instructions']['ko-kr'] = "음성 메일 녹음 지침을 재생합니다.";
$text['description-recording_options']['en-us'] = "Play recording options (after recording).";
$text['description-recording_options']['en-gb'] = "Play recording options (after recording).";
$text['description-recording_options']['ar-eg'] = "تشغيل خيارات التسجيل.";
$text['description-recording_options']['de-at'] = "Spielen Sie die Aufnahmeoptionen ab.";
$text['description-recording_options']['de-ch'] = "Spielen Sie die Aufnahmeoptionen ab.";
$text['description-recording_options']['de-de'] = "Spielen Sie die Aufnahmeoptionen ab.";
$text['description-recording_options']['es-cl'] = "Reproduce las opciones de grabación.";
$text['description-recording_options']['es-mx'] = "Reproduce las opciones de grabación.";
$text['description-recording_options']['fr-ca'] = "Jouez les options d'enregistrement.";
$text['description-recording_options']['fr-fr'] = "Jouez les options d'enregistrement.";
$text['description-recording_options']['he-il'] = "הפעל את אפשרויות ההקלטה.";
$text['description-recording_options']['it-it'] = "Riproduci le opzioni di registrazione.";
$text['description-recording_options']['nl-nl'] = "Speel de opname-opties af.";
$text['description-recording_options']['pl-pl'] = "Odtwórz opcje nagrywania.";
$text['description-recording_options']['pt-br'] = "Reproduza as opções de gravação.";
$text['description-recording_options']['pt-pt'] = "Reproduza as opções de gravação.";
$text['description-recording_options']['ro-ro'] = "Redați opțiunile de înregistrare.";
$text['description-recording_options']['ru-ru'] = "Воспроизведите параметры записи.";
$text['description-recording_options']['sv-se'] = "Spela upp inspelningsalternativen.";
$text['description-recording_options']['uk-ua'] = "Відтворіть параметри запису.";
$text['description-recording_options']['zh-cn'] = "播放錄音選項。";
$text['description-recording_options']['ja-jp'] = "録音オプションを再生します。";
$text['description-recording_options']['ko-kr'] = "녹음 옵션을 재생합니다.";
$text['button-toggle']['en-us'] = "Toggle";
$text['button-toggle']['en-gb'] = "Toggle";
$text['button-toggle']['ar-eg'] = "تبديل";

View File

@ -102,6 +102,8 @@
$voicemail_enabled = $_POST["voicemail_enabled"] ?? 'false';
$voicemail_description = $_POST["voicemail_description"];
$voicemail_tutorial = $_POST["voicemail_tutorial"];
$voicemail_recording_instructions = $_POST["voicemail_recording_instructions"];
$voicemail_recording_options = $_POST["voicemail_recording_options"];
$voicemail_options_delete = $_POST["voicemail_options_delete"] ?? null;
$voicemail_destinations_delete = $_POST["voicemail_destinations_delete"] ?? null;
@ -165,6 +167,8 @@
$array['voicemails'][0]['voicemail_sms_to'] = $voicemail_sms_to;
$array['voicemails'][0]['voicemail_transcription_enabled'] = $voicemail_transcription_enabled;
$array['voicemails'][0]['voicemail_tutorial'] = $voicemail_tutorial;
$array['voicemails'][0]['voicemail_recording_instructions'] = $voicemail_recording_instructions;
$array['voicemails'][0]['voicemail_recording_options'] = $voicemail_recording_options;
if (permission_exists('voicemail_file')) {
$array['voicemails'][0]['voicemail_file'] = $voicemail_file;
}
@ -311,6 +315,8 @@
$voicemail_sms_to = $row["voicemail_sms_to"];
$voicemail_transcription_enabled = $row["voicemail_transcription_enabled"];
$voicemail_tutorial = $row["voicemail_tutorial"];
$voicemail_recording_instructions = $row["voicemail_recording_instructions"];
$voicemail_recording_options = $row["voicemail_recording_options"];
$voicemail_file = $row["voicemail_file"];
$voicemail_local_after_email = $row["voicemail_local_after_email"];
$voicemail_enabled = $row["voicemail_enabled"];
@ -333,6 +339,8 @@
if (empty($voicemail_enabled)) { $voicemail_enabled = 'true'; }
if (empty($voicemail_transcription_enabled)) { $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; }
if (empty($voicemail_tutorial)) { $voicemail_tutorial = 'false'; }
if (empty($voicemail_recording_instructions)) { $voicemail_recording_instructions = 'true'; }
if (empty($voicemail_recording_options)) { $voicemail_recording_options = 'true'; }
//get the greetings list
$sql = "select * from v_voicemail_greetings ";
@ -534,7 +542,7 @@
echo " ".$text['label-greeting']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='greeting_id'>\n";
echo " <select class='formfld' name='greeting_id' onchange=\"if (this.selectedIndex == 0) { $('#alternate_greeting_id').slideDown(); } else { $('#alternate_greeting_id').slideUp(); }\">\n";
echo " <option value=''>".$text['label-default']."</option>\n";
echo " <option value='0' ".(isset($greeting_id) && $greeting_id == "0" ? "selected='selected'" : null).">".$text['label-none']."</option>\n";
if (is_array($greetings) && @sizeof($greetings) != 0) {
@ -549,14 +557,52 @@
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<div id='alternate_greeting_id' ".(!isset($greeting_id) ? null : "style='display: none;'").">\n";
echo " <table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-voicemail_alternate_greet_id']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='voicemail_alternate_greet_id' maxlength='255' value='".escape($voicemail_alternate_greet_id)."'>\n";
echo " <br />\n";
echo " ".$text['description-voicemail_alternate_greet_id']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " </table>\n";
echo "</div>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-recording_instructions']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <select class='formfld' name='voicemail_recording_instructions' id='voicemail_recording_instructions'>\n";
echo " <option value='true'>".$text['label-true']."</option>\n";
echo " <option value='false' ".(!empty($voicemail_recording_instructions) && $voicemail_recording_instructions == "false" ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-recording_instructions']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-voicemail_alternate_greet_id']."\n";
echo " ".$text['label-recording_options']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='voicemail_alternate_greet_id' maxlength='255' value='".escape($voicemail_alternate_greet_id)."'>\n";
echo " <br />\n";
echo " ".$text['description-voicemail_alternate_greet_id']."\n";
echo " <select class='formfld' name='voicemail_recording_options' id='voicemail_recording_options'>\n";
echo " <option value='true'>".$text['label-true']."</option>\n";
echo " <option value='false' ".(!empty($voicemail_recording_options) && $voicemail_recording_options == "false" ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-recording_options']."\n";
echo "</td>\n";
echo "</tr>\n";