First part of fix for load balancing - Prevent stale hostname being used for expired registration that has not yet been purged by freeswitch
This commit is contained in:
parent
dd8f9e9dd9
commit
572d83a828
|
|
@ -169,6 +169,7 @@
|
||||||
sql = "SELECT hostname FROM registrations ";
|
sql = "SELECT hostname FROM registrations ";
|
||||||
sql = sql .. "WHERE reg_user = '"..dialed_extension.."' ";
|
sql = sql .. "WHERE reg_user = '"..dialed_extension.."' ";
|
||||||
sql = sql .. "AND realm = '"..domain_name.."'";
|
sql = sql .. "AND realm = '"..domain_name.."'";
|
||||||
|
sql = sql .. "AND to_timestamp(expires) > NOW()";
|
||||||
status = dbh_switch:query(sql, function(row)
|
status = dbh_switch:query(sql, function(row)
|
||||||
database_hostname = row["hostname"];
|
database_hostname = row["hostname"];
|
||||||
end);
|
end);
|
||||||
|
|
@ -561,4 +562,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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue