From f79e1f0b2ed832c668f298cf431aef547374649c Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Tue, 21 Oct 2014 19:19:04 +0000 Subject: [PATCH] Add extension number-alias support to voicemail to fix a problem when using number-alias and checking voicemail with *97. --- .../install/scripts/app/voicemail/index.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/resources/install/scripts/app/voicemail/index.lua b/resources/install/scripts/app/voicemail/index.lua index 41b68cfc3b..a7ceba2f9e 100644 --- a/resources/install/scripts/app/voicemail/index.lua +++ b/resources/install/scripts/app/voicemail/index.lua @@ -122,6 +122,11 @@ domain_uuid = string.lower(domain_uuid); end + --if voicemail_id is non numeric then get the number-alias + if tonumber(voicemail_id) == nil then + voicemail_id = api:execute("user_data", voicemail_id .. "@" .. domain_name .. " attr number-alias"); + end + --set the voicemail_dir voicemail_dir = voicemail_dir.."/default/"..domain_name; if (debug["info"]) then @@ -231,6 +236,7 @@ else check_password(voicemail_id, password_tries); end + --send to the main menu timeouts = 0; main_menu(); @@ -239,6 +245,7 @@ --leave a message if (voicemail_action == "save") then + --check the voicemail quota if (vm_disk_quota) then --get voicemail message seconds @@ -251,13 +258,11 @@ status = dbh:query(sql, function(row) message_sum = row["message_sum"]; end); - if (message_sum ~= '') then - if (tonumber(vm_disk_quota) <= tonumber(message_sum)) then - --play message mailbox full - session:execute("playback", sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-mailbox_full.wav") - --set the voicemail_uuid to nil to prevent saving the voicemail - voicemail_uuid = nil; - end + if (tonumber(vm_disk_quota) <= tonumber(message_sum)) then + --play message mailbox full + session:execute("playback", sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-mailbox_full.wav") + --set the voicemail_uuid to nil to prevent saving the voicemail + voicemail_uuid = nil; end end