From 1a9f7737e95b29eb9f263e8ebf3719e91401ba12 Mon Sep 17 00:00:00 2001 From: Chris Black Date: Wed, 14 Sep 2016 14:28:04 -0700 Subject: [PATCH] fix the voicemail IVR with custom greeting (#1917) --- .../voicemail/resources/functions/play_greeting.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/resources/install/scripts/app/voicemail/resources/functions/play_greeting.lua b/resources/install/scripts/app/voicemail/resources/functions/play_greeting.lua index c5fdcb1dec..01381774b5 100644 --- a/resources/install/scripts/app/voicemail/resources/functions/play_greeting.lua +++ b/resources/install/scripts/app/voicemail/resources/functions/play_greeting.lua @@ -27,6 +27,10 @@ --play the greeting function play_greeting() + timeout = 100; + tries = 1; + max_timeout = 200; + --voicemail prompt if (skip_greeting == "true") then --skip the greeting @@ -82,9 +86,12 @@ --os.remove(voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"); end elseif (storage_type == "http_cache") then - session:execute("playback",storage_path.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"); + dtmf_digits = session:playAndGetDigits(min_digits, max_digits, tries, timeout, "#", voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", "", "\\d+", max_timeout); + --session:execute("playback",storage_path.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"); else - session:execute("playback",voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"); + dtmf_digits = session:playAndGetDigits(min_digits, max_digits, tries, timeout, "#", voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", "","\\d+", max_timeout); + + --session:execute("playback",voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"); end --sleep