xml_handler directory.lua is now tolerant when no memcache available, fix a nil variable
This commit is contained in:
@@ -62,15 +62,16 @@
|
|||||||
--all other directory actions: sip_auth, user_call
|
--all other directory actions: sip_auth, user_call
|
||||||
--except for the action: group_call
|
--except for the action: group_call
|
||||||
|
|
||||||
|
if (user == nil) then
|
||||||
|
user = "";
|
||||||
|
end
|
||||||
|
|
||||||
--get the cache
|
--get the cache
|
||||||
if (trim(api:execute("module_exists", "mod_memcache")) == "true") then
|
if (trim(api:execute("module_exists", "mod_memcache")) == "true") then
|
||||||
if (user == nil) then
|
|
||||||
user = "";
|
|
||||||
end
|
|
||||||
if (domain_name) then
|
if (domain_name) then
|
||||||
XML_STRING = trim(api:execute("memcache", "get directory:" .. user .. "@" .. domain_name));
|
XML_STRING = trim(api:execute("memcache", "get directory:" .. user .. "@" .. domain_name));
|
||||||
end
|
end
|
||||||
if (XML_STRING == "-ERR NOT FOUND") then
|
if (XML_STRING == "-ERR NOT FOUND") or (XML_STRING == "-ERR CONNECTION FAILURE") then
|
||||||
source = "database";
|
source = "database";
|
||||||
continue = true;
|
continue = true;
|
||||||
else
|
else
|
||||||
@@ -525,4 +526,4 @@
|
|||||||
--send the xml to the console
|
--send the xml to the console
|
||||||
if (debug["xml_string"]) then
|
if (debug["xml_string"]) then
|
||||||
freeswitch.consoleLog("notice", "[xml_handler] XML_STRING: \n" .. XML_STRING .. "\n");
|
freeswitch.consoleLog("notice", "[xml_handler] XML_STRING: \n" .. XML_STRING .. "\n");
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user