Make sure voicemail_id is set before using it

This commit is contained in:
FusionPBX
2023-08-29 13:33:29 -06:00
committed by GitHub
parent 3b617cb35c
commit 744ec4edaa

View File

@@ -149,15 +149,6 @@
end
end
--get the extension_uuid using the voicemail_id
extension_uuid = session:getVariable("extension_uuid");
if (extension_uuid == nil and session ~= nil and session:ready()) then
extension_uuid = api:execute("user_data", voicemail_id .. "@" .. domain_name .. " attr extension_uuid");
if (extension_uuid ~= nil) then
session:setVariable("extension_uuid", extension_uuid);
end
end
--set the voicemail_dir
voicemail_dir = voicemail_dir.."/default/"..domain_name;
if (debug["info"]) then
@@ -422,6 +413,17 @@
check_password(voicemail_id, password_tries);
end
--get the extension_uuid using the voicemail_id
if (voicemail_id ~= nil) then
extension_uuid = session:getVariable("extension_uuid");
if (extension_uuid == nil and session ~= nil and session:ready()) then
extension_uuid = api:execute("user_data", voicemail_id .. "@" .. domain_name .. " attr extension_uuid");
if (extension_uuid ~= nil) then
session:setVariable("extension_uuid", extension_uuid);
end
end
end
--send to the main menu
timeouts = 0;
if (voicemail_tutorial == "true") then