From 0a2798575c101677301389cd8e5bb9979d2c9a58 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 11 Oct 2022 11:07:48 -0600 Subject: [PATCH] Remove domain_count Not needed only request domain_uuid if value is null --- .../resources/scripts/app/voicemail/index.lua | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/app/scripts/resources/scripts/app/voicemail/index.lua b/app/scripts/resources/scripts/app/voicemail/index.lua index 040c533989..24f1564da2 100644 --- a/app/scripts/resources/scripts/app/voicemail/index.lua +++ b/app/scripts/resources/scripts/app/voicemail/index.lua @@ -130,20 +130,17 @@ --get the domain_uuid domain_uuid = session:getVariable("domain_uuid"); - if (domain_count > 1) then - if (domain_uuid == nil) then - --get the domain_uuid using the domain name required for multi-tenant - if (domain_name ~= nil) then - local sql = "SELECT domain_uuid FROM v_domains "; - sql = sql .. "WHERE domain_name = :domain_name "; - local params = {domain_name = domain_name}; - if (debug["sql"]) then - freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n"); - end - dbh:query(sql, params, function(rows) - domain_uuid = rows["domain_uuid"]; - end); - end + if (domain_uuid == nil) then + if (domain_name ~= nil) then + local sql = "SELECT domain_uuid FROM v_domains "; + sql = sql .. "WHERE domain_name = :domain_name "; + local params = {domain_name = domain_name}; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n"); + end + dbh:query(sql, params, function(rows) + domain_uuid = rows["domain_uuid"]; + end); end end if (domain_uuid ~= nil) then