mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-03 02:23:48 +00:00
Merge pull request #1130 from moteus/delete_alias_from_cache
Fix. Delete number-alias from cache when set DND/Follome/Forward.
This commit is contained in:
@@ -128,7 +128,7 @@
|
||||
status = dbh:query(sql, function(row)
|
||||
extension_uuid = row.extension_uuid;
|
||||
extension = row.extension;
|
||||
number_alias = row.number_alias;
|
||||
number_alias = row.number_alias or '';
|
||||
accountcode = row.accountcode;
|
||||
forward_all_enabled = row.forward_all_enabled;
|
||||
forward_all_destination = row.forward_all_destination;
|
||||
@@ -256,15 +256,18 @@
|
||||
freeswitch.consoleLog("notice", "[call_forward] "..sql.."\n");
|
||||
end
|
||||
dbh:query(sql);
|
||||
end
|
||||
|
||||
--clear the cache and hangup
|
||||
if (session:ready()) then
|
||||
--clear the cache
|
||||
if (extension ~= nil) then
|
||||
api:execute("memcache", "delete directory:"..extension.."@"..domain_name);
|
||||
if #number_alias > 0 then
|
||||
api:execute("memcache", "delete directory:"..number_alias.."@"..domain_name);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- hangup
|
||||
if (session:ready()) then
|
||||
--wait for the file to be written before proceeding
|
||||
session:sleep(100);
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
end
|
||||
status = dbh:query(sql, function(row)
|
||||
extension = row.extension;
|
||||
number_alias = row.number_alias;
|
||||
number_alias = row.number_alias or '';
|
||||
accountcode = row.accountcode;
|
||||
follow_me_uuid = row.follow_me_uuid;
|
||||
--freeswitch.consoleLog("NOTICE", "[do_not_disturb] extension "..row.extension.."\n");
|
||||
@@ -145,6 +145,9 @@
|
||||
--clear the cache
|
||||
if (extension ~= nil) then
|
||||
api:execute("memcache", "delete directory:"..extension.."@"..domain_name);
|
||||
if #number_alias > 0 then
|
||||
api:execute("memcache", "delete directory:"..number_alias.."@"..domain_name);
|
||||
end
|
||||
end
|
||||
|
||||
--wait for the file to be written before proceeding
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
end
|
||||
status = dbh:query(sql, function(row)
|
||||
extension = row.extension;
|
||||
number_alias = row.number_alias;
|
||||
number_alias = row.number_alias or '';
|
||||
accountcode = row.accountcode;
|
||||
follow_me_uuid = row.follow_me_uuid;
|
||||
--freeswitch.consoleLog("NOTICE", "[call forward] extension "..row.extension.."\n");
|
||||
@@ -165,6 +165,9 @@
|
||||
--clear the cache
|
||||
if (extension ~= nil) then
|
||||
api:execute("memcache", "delete directory:"..extension.."@"..domain_name);
|
||||
if #number_alias > 0 then
|
||||
api:execute("memcache", "delete directory:"..number_alias.."@"..domain_name);
|
||||
end
|
||||
end
|
||||
|
||||
--wait for the file to be written before proceeding
|
||||
|
||||
Reference in New Issue
Block a user