mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Add the hostname cache prefix
This commit is contained in:
@@ -44,6 +44,9 @@
|
|||||||
--prepare the api object
|
--prepare the api object
|
||||||
api = freeswitch.API();
|
api = freeswitch.API();
|
||||||
|
|
||||||
|
--get the hostname
|
||||||
|
local hostname = api:execute("hostname", "");
|
||||||
|
|
||||||
--define the functions
|
--define the functions
|
||||||
require "resources.functions.trim";
|
require "resources.functions.trim";
|
||||||
require "resources.functions.explode";
|
require "resources.functions.explode";
|
||||||
@@ -355,5 +358,5 @@
|
|||||||
end
|
end
|
||||||
--clear the cache
|
--clear the cache
|
||||||
if (feature_enabled ~= nil) then
|
if (feature_enabled ~= nil) then
|
||||||
cache.del("directory:"..user.."@"..host)
|
cache.del(hostname.."directory:"..user.."@"..host)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -34,6 +34,9 @@
|
|||||||
--create the api object
|
--create the api object
|
||||||
api = freeswitch.API();
|
api = freeswitch.API();
|
||||||
|
|
||||||
|
--get the hostname
|
||||||
|
local hostname = api:execute("hostname", "");
|
||||||
|
|
||||||
--includes
|
--includes
|
||||||
require "resources.functions.config";
|
require "resources.functions.config";
|
||||||
require "resources.functions.channel_utils";
|
require "resources.functions.channel_utils";
|
||||||
@@ -305,9 +308,9 @@
|
|||||||
|
|
||||||
--clear the cache
|
--clear the cache
|
||||||
if extension and #extension > 0 and cache.support() then
|
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
|
if #number_alias > 0 then
|
||||||
cache.del("directory:"..number_alias.."@"..domain_name);
|
cache.del(hostname.."directory:"..number_alias.."@"..domain_name);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,13 @@
|
|||||||
--set default variables
|
--set default variables
|
||||||
max_tries = "3";
|
max_tries = "3";
|
||||||
digit_timeout = "5000";
|
digit_timeout = "5000";
|
||||||
|
|
||||||
|
--create the api object
|
||||||
api = freeswitch.API();
|
api = freeswitch.API();
|
||||||
|
|
||||||
|
--get the hostname
|
||||||
|
local hostname = api:execute("hostname", "");
|
||||||
|
|
||||||
--set the debug level
|
--set the debug level
|
||||||
debug["sql"] = false;
|
debug["sql"] = false;
|
||||||
debug["var"] = false;
|
debug["var"] = false;
|
||||||
@@ -230,17 +235,17 @@ if ( session:ready() ) then
|
|||||||
--clear the cache
|
--clear the cache
|
||||||
if (user_name ~= nil and context ~= nil) then
|
if (user_name ~= nil and context ~= nil) then
|
||||||
if (cache.support()) then
|
if (cache.support()) then
|
||||||
cache.del("directory:"..user_name.."@"..context);
|
cache.del(hostname..":directory:"..user_name.."@"..context);
|
||||||
if #number_alias > 0 then
|
if #number_alias > 0 then
|
||||||
cache.del("directory:"..number_alias.."@"..domain_name);
|
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if (db_extension ~= nil and context ~= nil) then
|
if (db_extension ~= nil and context ~= nil) then
|
||||||
if (cache.support()) then
|
if (cache.support()) then
|
||||||
cache.del("directory:"..db_extension.."@"..context);
|
cache.del(hostname..":directory:"..db_extension.."@"..context);
|
||||||
if #number_alias > 0 then
|
if #number_alias > 0 then
|
||||||
cache.del("directory:"..number_alias.."@"..domain_name);
|
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -37,6 +37,9 @@
|
|||||||
--create the api object
|
--create the api object
|
||||||
api = freeswitch.API();
|
api = freeswitch.API();
|
||||||
|
|
||||||
|
--get the hostname
|
||||||
|
local hostname = api:execute("hostname", "");
|
||||||
|
|
||||||
--include config.lua
|
--include config.lua
|
||||||
require "resources.functions.config";
|
require "resources.functions.config";
|
||||||
|
|
||||||
@@ -262,9 +265,9 @@
|
|||||||
|
|
||||||
--clear the cache
|
--clear the cache
|
||||||
if extension and #extension > 0 and cache.support() then
|
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
|
if #number_alias > 0 then
|
||||||
cache.del("directory:"..number_alias.."@"..context);
|
cache.del(hostname..":directory:"..number_alias.."@"..context);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,10 @@
|
|||||||
--create the api object
|
--create the api object
|
||||||
api = freeswitch.API();
|
api = freeswitch.API();
|
||||||
|
|
||||||
|
--get the hostname
|
||||||
|
local hostname = api:execute("hostname", "");
|
||||||
|
|
||||||
|
--include and initialize additional objects
|
||||||
require "resources.functions.channel_utils";
|
require "resources.functions.channel_utils";
|
||||||
local log = require "resources.functions.log".follow_me
|
local log = require "resources.functions.log".follow_me
|
||||||
local cache = require "resources.functions.cache"
|
local cache = require "resources.functions.cache"
|
||||||
@@ -133,9 +137,9 @@
|
|||||||
|
|
||||||
--clear the cache
|
--clear the cache
|
||||||
if (extension ~= nil) and cache.support() then
|
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
|
if #number_alias > 0 then
|
||||||
cache.del("directory:"..number_alias.."@"..domain_name);
|
cache.del(hostname..":directory:"..number_alias.."@"..domain_name);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user