mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Add the hostname cache prefix
This commit is contained in:
@@ -44,6 +44,9 @@
|
||||
--prepare the api object
|
||||
api = freeswitch.API();
|
||||
|
||||
--get the hostname
|
||||
local hostname = api:execute("hostname", "");
|
||||
|
||||
--define the functions
|
||||
require "resources.functions.trim";
|
||||
require "resources.functions.explode";
|
||||
@@ -355,5 +358,5 @@
|
||||
end
|
||||
--clear the cache
|
||||
if (feature_enabled ~= nil) then
|
||||
cache.del("directory:"..user.."@"..host)
|
||||
cache.del(hostname.."directory:"..user.."@"..host)
|
||||
end
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
--create the api object
|
||||
api = freeswitch.API();
|
||||
|
||||
--get the hostname
|
||||
local hostname = api:execute("hostname", "");
|
||||
|
||||
--includes
|
||||
require "resources.functions.config";
|
||||
require "resources.functions.channel_utils";
|
||||
@@ -305,9 +308,9 @@
|
||||
|
||||
--clear the cache
|
||||
if extension and #extension > 0 and cache.support() then
|
||||
cache.del("directory:"..extension.."@"..domain_name);
|
||||
cache.del(hostname..":directory:"..extension.."@"..domain_name);
|
||||
if #number_alias > 0 then
|
||||
cache.del("directory:"..number_alias.."@"..domain_name);
|
||||
cache.del(hostname.."directory:"..number_alias.."@"..domain_name);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
--create the api object
|
||||
api = freeswitch.API();
|
||||
|
||||
--get the hostname
|
||||
local hostname = api:execute("hostname", "");
|
||||
|
||||
--include config.lua
|
||||
require "resources.functions.config";
|
||||
|
||||
@@ -262,9 +265,9 @@
|
||||
|
||||
--clear the cache
|
||||
if extension and #extension > 0 and cache.support() then
|
||||
cache.del("directory:"..extension.."@"..context);
|
||||
cache.del(hostname..":directory:"..extension.."@"..context);
|
||||
if #number_alias > 0 then
|
||||
cache.del("directory:"..number_alias.."@"..context);
|
||||
cache.del(hostname..":directory:"..number_alias.."@"..context);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -28,6 +28,10 @@
|
||||
--create the api object
|
||||
api = freeswitch.API();
|
||||
|
||||
--get the hostname
|
||||
local hostname = api:execute("hostname", "");
|
||||
|
||||
--include and initialize additional objects
|
||||
require "resources.functions.channel_utils";
|
||||
local log = require "resources.functions.log".follow_me
|
||||
local cache = require "resources.functions.cache"
|
||||
@@ -133,9 +137,9 @@
|
||||
|
||||
--clear the cache
|
||||
if (extension ~= nil) and cache.support() then
|
||||
cache.del("directory:"..extension.."@"..domain_name);
|
||||
cache.del(hostname..":directory:"..extension.."@"..domain_name);
|
||||
if #number_alias > 0 then
|
||||
cache.del("directory:"..number_alias.."@"..domain_name);
|
||||
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user