[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:
+12
-3
@@ -29,9 +29,6 @@
|
|||||||
--flush dtmf digits from the input buffer
|
--flush dtmf digits from the input buffer
|
||||||
session:flushDigits();
|
session:flushDigits();
|
||||||
|
|
||||||
--save the voicemail message
|
|
||||||
message_saved(voicemail_id, uuid);
|
|
||||||
|
|
||||||
--request the forward_voicemail_id
|
--request the forward_voicemail_id
|
||||||
if (session:ready()) then
|
if (session:ready()) then
|
||||||
dtmf_digits = '';
|
dtmf_digits = '';
|
||||||
@@ -168,4 +165,16 @@
|
|||||||
--send the email with the voicemail recording attached
|
--send the email with the voicemail recording attached
|
||||||
send_email(forward_voicemail_id, voicemail_message_uuid);
|
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
|
end
|
||||||
|
|||||||
+1
-2
@@ -193,7 +193,7 @@
|
|||||||
--process the dtmf
|
--process the dtmf
|
||||||
if (session:ready()) then
|
if (session:ready()) then
|
||||||
if (dtmf_digits == "1") 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
|
elseif (dtmf_digits == "2") then
|
||||||
message_saved(voicemail_id, uuid);
|
message_saved(voicemail_id, uuid);
|
||||||
session:execute("playback", "phrase:voicemail_ack:saved");
|
session:execute("playback", "phrase:voicemail_ack:saved");
|
||||||
@@ -217,7 +217,6 @@
|
|||||||
elseif (dtmf_digits == "8") then
|
elseif (dtmf_digits == "8") then
|
||||||
forward_to_extension(voicemail_id, uuid);
|
forward_to_extension(voicemail_id, uuid);
|
||||||
dtmf_digits = '';
|
dtmf_digits = '';
|
||||||
session:execute("playback", "phrase:voicemail_ack:saved");
|
|
||||||
elseif (dtmf_digits == "9") then
|
elseif (dtmf_digits == "9") then
|
||||||
send_email(voicemail_id, uuid);
|
send_email(voicemail_id, uuid);
|
||||||
dtmf_digits = '';
|
dtmf_digits = '';
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
@@ -181,4 +181,17 @@
|
|||||||
</input>
|
</input>
|
||||||
</macro>
|
</macro>
|
||||||
|
|
||||||
|
<macro name="voicemail_post_forward_action">
|
||||||
|
<input pattern="^(1):(2)$">
|
||||||
|
<match>
|
||||||
|
<action function="play-file" data="voicemail/vm-delete_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$1" method="pronounced" type="name_spelled"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-save_message.wav"/>
|
||||||
|
<action function="play-file" data="voicemail/vm-press.wav"/>
|
||||||
|
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
|
||||||
|
</match>
|
||||||
|
</input>
|
||||||
|
</macro>
|
||||||
|
|
||||||
</include>
|
</include>
|
||||||
|
|||||||
Reference in New Issue
Block a user