With async_task_data() I got it working like this: ``` event_route [tcp:closed] { # Handle TCP connection close # Delete possible leftover registration if ($conid) { async_task_data("clean_location", "$conid"); }
route [clean_location] { sql_query_async("sip_proxy_cache", "DELETE FROM location WHERE server_id=0 AND connection_id=$async(data)"); }