Add the hostname cache prefix

This commit is contained in:
Mark J Crane
2025-10-20 14:29:28 -06:00
parent 9ba170b21c
commit 090d4580d6
5 changed files with 29 additions and 11 deletions

View File

@@ -25,8 +25,13 @@
--set default variables
max_tries = "3";
digit_timeout = "5000";
--create the api object
api = freeswitch.API();
--get the hostname
local hostname = api:execute("hostname", "");
--set the debug level
debug["sql"] = false;
debug["var"] = false;
@@ -230,17 +235,17 @@ if ( session:ready() ) then
--clear the cache
if (user_name ~= nil and context ~= nil) then
if (cache.support()) then
cache.del("directory:"..user_name.."@"..context);
cache.del(hostname..":directory:"..user_name.."@"..context);
if #number_alias > 0 then
cache.del("directory:"..number_alias.."@"..domain_name);
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
end
end
end
if (db_extension ~= nil and context ~= nil) then
if (cache.support()) then
cache.del("directory:"..db_extension.."@"..context);
cache.del(hostname..":directory:"..db_extension.."@"..context);
if #number_alias > 0 then
cache.del("directory:"..number_alias.."@"..domain_name);
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
end
end
end