Fix. Delete number-alias from cache when set DND/Follome/Forward.

This commit is contained in:
Alexey Melnichuk
2015-08-26 13:44:34 +04:00
parent 9f1385dd80
commit 9ad23e65b5
3 changed files with 15 additions and 6 deletions

View File

@@ -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);