xml_handler directory.lua is now tolerant when no memcache available, fix a nil variable

This commit is contained in:
luis daniel lucio quiroz
2014-11-27 14:43:28 +00:00
parent d7180a79f3
commit fb02f54a6a

View File

@@ -62,15 +62,16 @@
--all other directory actions: sip_auth, user_call
--except for the action: group_call
if (user == nil) then
user = "";
end
--get the cache
if (trim(api:execute("module_exists", "mod_memcache")) == "true") then
if (user == nil) then
user = "";
end
if (domain_name) then
XML_STRING = trim(api:execute("memcache", "get directory:" .. user .. "@" .. domain_name));
end
if (XML_STRING == "-ERR NOT FOUND") then
if (XML_STRING == "-ERR NOT FOUND") or (XML_STRING == "-ERR CONNECTION FAILURE") then
source = "database";
continue = true;
else
@@ -525,4 +526,4 @@
--send the xml to the console
if (debug["xml_string"]) then
freeswitch.consoleLog("notice", "[xml_handler] XML_STRING: \n" .. XML_STRING .. "\n");
end
end