Update do_not_disturb.lua (#2803)
Use cache function instead of directly clearing memcache.
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
require "resources.functions.config";
|
require "resources.functions.config";
|
||||||
|
|
||||||
local blf = require "resources.functions.blf"
|
local blf = require "resources.functions.blf"
|
||||||
|
local cache = require "resources.functions.cache"
|
||||||
|
|
||||||
--check if the session is ready
|
--check if the session is ready
|
||||||
if ( session:ready() ) then
|
if ( session:ready() ) then
|
||||||
@@ -203,12 +204,10 @@
|
|||||||
end);
|
end);
|
||||||
|
|
||||||
--clear the cache
|
--clear the cache
|
||||||
if (extension ~= nil) then
|
if extension and #extension > 0 and cache.support() then
|
||||||
freeswitch.consoleLog("notice", "[do_not_disturb] memcache delete directory:"..extension.."@"..domain_name);
|
cache.del("directory:"..extension.."@"..domain_name);
|
||||||
api:execute("memcache", "delete directory:"..extension.."@"..domain_name);
|
|
||||||
if #number_alias > 0 then
|
if #number_alias > 0 then
|
||||||
freeswitch.consoleLog("notice", "[do_not_disturb] memcache delete directory:"..number_alias.."@"..domain_name);
|
cache.del("directory:"..number_alias.."@"..domain_name);
|
||||||
api:execute("memcache", "delete directory:"..number_alias.."@"..domain_name);
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user