[OpenSIPS-Users] async and event handlers

John Quick john.quick at smartvox.co.uk
Wed Mar 20 10:55:40 EDT 2019


I have a script which employs USRLOC to save registrations and also has an
event handler defined for E_UL_CONTACT_INSERT.
It is convenient, for the required logic/business rules, that I update a
user database from within the event handler.

If the DB update were happening directly from the main route, then I would
probably use async(avp_db_query())
However, if a potentially blocking operation - such as a DB write - is done
from within the event handler, am I correct in thinking that this is much
safer and therefore does not need to be wrapped in an async() or launch()
function call?

Can you even use async() or launch() from within an event handler?

Using v2.4.4

John Quick
Smartvox Limited





More information about the Users mailing list