If the extension_uuid is not found then set continue to false.
This commit is contained in:
parent
c25139f312
commit
a0498d61ff
|
|
@ -508,7 +508,7 @@
|
||||||
value = trim(value);
|
value = trim(value);
|
||||||
--freeswitch.consoleLog("notice", "[directory] Key: " .. key .. " Value: " .. value .. " " ..row['extension'] .."\n");
|
--freeswitch.consoleLog("notice", "[directory] Key: " .. key .. " Value: " .. value .. " " ..row['extension'] .."\n");
|
||||||
if (string.len(value) == 0) then
|
if (string.len(value) == 0) then
|
||||||
|
--do nothing
|
||||||
else
|
else
|
||||||
if (call_group_array[value] == nil) then
|
if (call_group_array[value] == nil) then
|
||||||
call_group_array[value] = row['extension'];
|
call_group_array[value] = row['extension'];
|
||||||
|
|
@ -586,7 +586,9 @@
|
||||||
|
|
||||||
--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 (user == nil) then
|
||||||
|
user = "";
|
||||||
|
end
|
||||||
XML_STRING = trim(api:execute("memcache", "get directory:" .. user .. "@" .. domain_name));
|
XML_STRING = trim(api:execute("memcache", "get directory:" .. user .. "@" .. domain_name));
|
||||||
if (XML_STRING == "-ERR NOT FOUND") then
|
if (XML_STRING == "-ERR NOT FOUND") then
|
||||||
continue = true;
|
continue = true;
|
||||||
|
|
@ -612,6 +614,7 @@
|
||||||
dbh:query(sql, function(row)
|
dbh:query(sql, function(row)
|
||||||
--general
|
--general
|
||||||
domain_uuid = row.domain_uuid;
|
domain_uuid = row.domain_uuid;
|
||||||
|
extension_uuid = row.extension_uuid;
|
||||||
extension = row.extension;
|
extension = row.extension;
|
||||||
cidr = "";
|
cidr = "";
|
||||||
if (string.len(row.cidr) > 0) then
|
if (string.len(row.cidr) > 0) then
|
||||||
|
|
@ -674,6 +677,11 @@
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--if the extension does not exist set continue to false;
|
||||||
|
if (extension_uuid == nil) then
|
||||||
|
continue = false;
|
||||||
|
end
|
||||||
|
|
||||||
--outbound hot desking - get the extension variables
|
--outbound hot desking - get the extension variables
|
||||||
if (continue) then
|
if (continue) then
|
||||||
sql = "SELECT * FROM v_extensions WHERE dial_domain = '" .. domain_name .. "' and dial_user = '" .. user .. "' and enabled = 'true' ";
|
sql = "SELECT * FROM v_extensions WHERE dial_domain = '" .. domain_name .. "' and dial_user = '" .. user .. "' and enabled = 'true' ";
|
||||||
|
|
@ -681,7 +689,7 @@
|
||||||
freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n");
|
freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n");
|
||||||
end
|
end
|
||||||
dbh:query(sql, function(row)
|
dbh:query(sql, function(row)
|
||||||
--variables
|
--get the values from the database
|
||||||
extension_uuid = row.extension_uuid;
|
extension_uuid = row.extension_uuid;
|
||||||
domain_uuid = row.domain_uuid;
|
domain_uuid = row.domain_uuid;
|
||||||
sip_from_user = row.extension;
|
sip_from_user = row.extension;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue