I noticed that sql_query does not (anymore) work when called from event route:
event_route [tcp:closed] { # Handle TCP connection close
# Delete possible leftover registration if ($conid) sql_query("sip_proxy_cache", "DELETE FROM location WHERE server_id=0 AND connection_id=$conid", "result"); }
The query produces errors:
2024-05-07T11:30:14.785915+03:00 siika /usr/bin/sip-proxy[2848078]: CRITICAL: sqlops [sqlops.c:213]: sql_check_connection(): no database handle with reconnect disabled 2024-05-07T11:30:14.785978+03:00 siika /usr/bin/sip-proxy[2848078]: ERROR: sqlops [sqlops.c:232]: sql_query(): invalid connection to database 2024-05-07T11:30:14.786013+03:00 siika /usr/bin/sip-proxy[2848078]: ERROR: sqlops [sqlops.c:237]: sql_query(): with query [DELETE FROM location WHERE server_id=0 AND connection_id=7]
I added the last debug message in order to find out where the error comes from.
The same query works fine when executed from regular route.
Any ideas why the query fails from event_route?
-- Juha