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:
Digital Daz 2015-04-12 10:08:47 +00:00
parent dd8f9e9dd9
commit 572d83a828
1 changed files with 2 additions and 1 deletions

View File

@ -169,6 +169,7 @@
sql = "SELECT hostname FROM registrations ";
sql = sql .. "WHERE reg_user = '"..dialed_extension.."' ";
sql = sql .. "AND realm = '"..domain_name.."'";
sql = sql .. "AND to_timestamp(expires) > NOW()";
status = dbh_switch:query(sql, function(row)
database_hostname = row["hostname"];
end);
@ -561,4 +562,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