Add the voicemail_greeting_number variable to set the greeting_id. Adjust skip_instructions so that it used.

This commit is contained in:
Mark Crane
2013-10-04 00:05:24 +00:00
parent a3ec931d6d
commit 1cd60afb9e
3 changed files with 20 additions and 11 deletions

View File

@@ -82,6 +82,7 @@
destination_number = session:getVariable("destination_number");
caller_id_name = session:getVariable("caller_id_name");
caller_id_number = session:getVariable("caller_id_number");
voicemail_greeting_number = session:getVariable("voicemail_greeting_number");
skip_instructions = session:getVariable("skip_instructions");
skip_greeting = session:getVariable("skip_greeting");
vm_message_ext = session:getVariable("vm_message_ext");

View File

@@ -30,15 +30,23 @@
--skip the greeting
else
if (session:ready()) then
dtmf_digits = '';
if (string.len(greeting_id) > 0) then
--play the custom greeting
session:streamFile(voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav");
session:streamFile("silence_stream://200");
else
--play the default greeting
dtmf_digits = macro(session, "person_not_available_record_message", 1, 200);
end
--set the greeting based on the voicemail_greeting_number variable
if (voicemail_greeting_number ~= nil) then
if (string.len(voicemail_greeting_number) > 0) then
greeting_id = voicemail_greeting_number;
end
end
--play the greeting
dtmf_digits = '';
if (string.len(greeting_id) > 0) then
--custom greeting
session:streamFile(voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav");
session:streamFile("silence_stream://200");
else
--default greeting
dtmf_digits = macro(session, "person_not_available_record_message", 1, 200);
end
end
end
end

View File

@@ -27,8 +27,8 @@
function record_message()
--record your message at the tone press any key or stop talking to end the recording
if (skip_greeting == "true") then
--skip the greeting
if (skip_instructions == "true") then
--skip the instructions
else
if (string.len(dtmf_digits) == 0) then
dtmf_digits = macro(session, "record_message", 1, 100);