missing space & mysql support
This commit is contained in:
parent
572d83a828
commit
deaaf0c4eb
|
|
@ -168,8 +168,12 @@
|
||||||
--get the destination hostname from the registration
|
--get the destination hostname from the registration
|
||||||
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()";
|
if (database["type"] == "mysql") then
|
||||||
|
sql = sql .. "AND expires > unix_timestamp(NOW())";
|
||||||
|
else
|
||||||
|
sql = sql .. "AND to_timestamp(expires) > NOW()";
|
||||||
|
end
|
||||||
status = dbh_switch:query(sql, function(row)
|
status = dbh_switch:query(sql, function(row)
|
||||||
database_hostname = row["hostname"];
|
database_hostname = row["hostname"];
|
||||||
end);
|
end);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue