Remove the hostname prefix from the directory cache key

This commit is contained in:
FusionPBX
2026-03-04 11:55:42 -07:00
committed by GitHub
parent 9f56ac9e30
commit df54d9eed6
16 changed files with 46 additions and 46 deletions

View File

@@ -358,5 +358,5 @@
end
--clear the cache
if (feature_enabled ~= nil) then
cache.del(hostname..":directory:"..user.."@"..host)
cache.del("directory:"..user.."@"..host)
end

View File

@@ -161,7 +161,7 @@
-- or we do not need dial-string. In other way we have to use database.
if (continue) and (not USE_FS_PATH) then
if (cache.support() and domain_name) then
local cache_key, err = hostname .. ":directory:" .. (from_user or user) .. "@" .. domain_name
local cache_key, err = "directory:" .. (from_user or user) .. "@" .. domain_name
XML_STRING, err = cache.get(cache_key);
if debug['cache'] then
@@ -774,7 +774,7 @@
--set the cache
if cache.support() then
local cache_key = hostname .. ":directory:" .. sip_from_number .. "@" .. domain_name
local cache_key = "directory:" .. sip_from_number .. "@" .. domain_name
if debug['cache'] then
freeswitch.consoleLog("notice", "[xml_handler][directory][cache] set key: " .. cache_key .. "\n")
end
@@ -784,7 +784,7 @@
end
if sip_from_number ~= sip_from_user then
cache_key = hostname .. ":directory:" .. sip_from_user .. "@" .. domain_name
cache_key = "directory:" .. sip_from_user .. "@" .. domain_name
if debug['cache'] then
freeswitch.consoleLog("notice", "[xml_handler][directory][cache] set key: " .. cache_key .. "\n")
end

View File

@@ -308,9 +308,9 @@
--clear the cache
if extension and #extension > 0 and cache.support() then
cache.del(hostname..":directory:"..extension.."@"..domain_name);
cache.del("directory:"..extension.."@"..domain_name);
if #number_alias > 0 then
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
cache.del("directory:"..number_alias.."@"..domain_name);
end
end

View File

@@ -235,17 +235,17 @@ if ( session:ready() ) then
--clear the cache
if (user_name ~= nil and context ~= nil) then
if (cache.support()) then
cache.del(hostname..":directory:"..user_name.."@"..context);
cache.del("directory:"..user_name.."@"..context);
if #number_alias > 0 then
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
cache.del("directory:"..number_alias.."@"..domain_name);
end
end
end
if (db_extension ~= nil and context ~= nil) then
if (cache.support()) then
cache.del(hostname..":directory:"..db_extension.."@"..context);
cache.del("directory:"..db_extension.."@"..context);
if #number_alias > 0 then
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
cache.del("directory:"..number_alias.."@"..domain_name);
end
end
end

View File

@@ -265,9 +265,9 @@
--clear the cache
if extension and #extension > 0 and cache.support() then
cache.del(hostname..":directory:"..extension.."@"..context);
cache.del("directory:"..extension.."@"..context);
if #number_alias > 0 then
cache.del(hostname..":directory:"..number_alias.."@"..context);
cache.del("directory:"..number_alias.."@"..context);
end
end

View File

@@ -137,9 +137,9 @@
--clear the cache
if (extension ~= nil) and cache.support() then
cache.del(hostname..":directory:"..extension.."@"..domain_name);
cache.del("directory:"..extension.."@"..domain_name);
if #number_alias > 0 then
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
cache.del("directory:"..number_alias.."@"..domain_name);
end
end