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)
|
status = dbh:query(sql, function(row)
|
||||||
extension_uuid = row.extension_uuid;
|
extension_uuid = row.extension_uuid;
|
||||||
extension = row.extension;
|
extension = row.extension;
|
||||||
number_alias = row.number_alias;
|
number_alias = row.number_alias or '';
|
||||||
accountcode = row.accountcode;
|
accountcode = row.accountcode;
|
||||||
forward_all_enabled = row.forward_all_enabled;
|
forward_all_enabled = row.forward_all_enabled;
|
||||||
forward_all_destination = row.forward_all_destination;
|
forward_all_destination = row.forward_all_destination;
|
||||||
@@ -256,15 +256,18 @@
|
|||||||
freeswitch.consoleLog("notice", "[call_forward] "..sql.."\n");
|
freeswitch.consoleLog("notice", "[call_forward] "..sql.."\n");
|
||||||
end
|
end
|
||||||
dbh:query(sql);
|
dbh:query(sql);
|
||||||
end
|
|
||||||
|
|
||||||
--clear the cache and hangup
|
|
||||||
if (session:ready()) then
|
|
||||||
--clear the cache
|
--clear the cache
|
||||||
if (extension ~= nil) then
|
if (extension ~= nil) then
|
||||||
api:execute("memcache", "delete directory:"..extension.."@"..domain_name);
|
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
|
||||||
|
end
|
||||||
|
|
||||||
|
-- hangup
|
||||||
|
if (session:ready()) then
|
||||||
--wait for the file to be written before proceeding
|
--wait for the file to be written before proceeding
|
||||||
session:sleep(100);
|
session:sleep(100);
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
end
|
end
|
||||||
status = dbh:query(sql, function(row)
|
status = dbh:query(sql, function(row)
|
||||||
extension = row.extension;
|
extension = row.extension;
|
||||||
number_alias = row.number_alias;
|
number_alias = row.number_alias or '';
|
||||||
accountcode = row.accountcode;
|
accountcode = row.accountcode;
|
||||||
follow_me_uuid = row.follow_me_uuid;
|
follow_me_uuid = row.follow_me_uuid;
|
||||||
--freeswitch.consoleLog("NOTICE", "[do_not_disturb] extension "..row.extension.."\n");
|
--freeswitch.consoleLog("NOTICE", "[do_not_disturb] extension "..row.extension.."\n");
|
||||||
@@ -145,6 +145,9 @@
|
|||||||
--clear the cache
|
--clear the cache
|
||||||
if (extension ~= nil) then
|
if (extension ~= nil) then
|
||||||
api:execute("memcache", "delete directory:"..extension.."@"..domain_name);
|
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
|
||||||
|
|
||||||
--wait for the file to be written before proceeding
|
--wait for the file to be written before proceeding
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
end
|
end
|
||||||
status = dbh:query(sql, function(row)
|
status = dbh:query(sql, function(row)
|
||||||
extension = row.extension;
|
extension = row.extension;
|
||||||
number_alias = row.number_alias;
|
number_alias = row.number_alias or '';
|
||||||
accountcode = row.accountcode;
|
accountcode = row.accountcode;
|
||||||
follow_me_uuid = row.follow_me_uuid;
|
follow_me_uuid = row.follow_me_uuid;
|
||||||
--freeswitch.consoleLog("NOTICE", "[call forward] extension "..row.extension.."\n");
|
--freeswitch.consoleLog("NOTICE", "[call forward] extension "..row.extension.."\n");
|
||||||
@@ -165,6 +165,9 @@
|
|||||||
--clear the cache
|
--clear the cache
|
||||||
if (extension ~= nil) then
|
if (extension ~= nil) then
|
||||||
api:execute("memcache", "delete directory:"..extension.."@"..domain_name);
|
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
|
||||||
|
|
||||||
--wait for the file to be written before proceeding
|
--wait for the file to be written before proceeding
|
||||||
|
|||||||
Reference in New Issue
Block a user