mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-01 21:49:20 +00:00
[voicemail] Add option whether to delete or keep message after forwarding (#5985)
* [voicemail] Add option whether to delete or save message after forwarding * Fix recording playback phrase doesn't exist
This commit is contained in:
@@ -29,9 +29,6 @@
|
||||
--flush dtmf digits from the input buffer
|
||||
session:flushDigits();
|
||||
|
||||
--save the voicemail message
|
||||
message_saved(voicemail_id, uuid);
|
||||
|
||||
--request the forward_voicemail_id
|
||||
if (session:ready()) then
|
||||
dtmf_digits = '';
|
||||
@@ -168,4 +165,16 @@
|
||||
--send the email with the voicemail recording attached
|
||||
send_email(forward_voicemail_id, voicemail_message_uuid);
|
||||
|
||||
session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-message_forwarded.wav");
|
||||
|
||||
--delete or save the message
|
||||
local action = session:playAndGetDigits(1, 1, max_tries, digit_timeout, "#", "phrase:voicemail_post_forward_action:1:2", "", "^[1-2]$");
|
||||
if (action == "1") then
|
||||
delete_recording(voicemail_id, uuid);
|
||||
message_waiting(voicemail_id, domain_uuid);
|
||||
else
|
||||
message_saved(voicemail_id, uuid);
|
||||
session:execute("playback", "phrase:voicemail_ack:saved");
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
--process the dtmf
|
||||
if (session:ready()) then
|
||||
if (dtmf_digits == "1") then
|
||||
listen_to_recording(message_number, uuid, created_epoch, caller_id_name, caller_id_number, message_status);
|
||||
return listen_to_recording(message_number, uuid, created_epoch, caller_id_name, caller_id_number, message_status);
|
||||
elseif (dtmf_digits == "2") then
|
||||
message_saved(voicemail_id, uuid);
|
||||
session:execute("playback", "phrase:voicemail_ack:saved");
|
||||
@@ -217,7 +217,6 @@
|
||||
elseif (dtmf_digits == "8") then
|
||||
forward_to_extension(voicemail_id, uuid);
|
||||
dtmf_digits = '';
|
||||
session:execute("playback", "phrase:voicemail_ack:saved");
|
||||
elseif (dtmf_digits == "9") then
|
||||
send_email(voicemail_id, uuid);
|
||||
dtmf_digits = '';
|
||||
|
||||
Reference in New Issue
Block a user