On Mon, Jun 10, 2019 at 06:01:19AM +0000, Nicolas Breuer wrote:
I want to do some sql operations after a 200 reply, after relaying the sip packet Is it possible or sending the sip packet is the last operation permitted ?
Hi,
Sending the SIP packet is an implicit operation that occurs after all hooks which can intercept a reply (i.e. onreply_route) have been fired. Therefore, you should be careful that your SQL operations do not block the message worker thread that is processing the reply. If you think they might be overly latent, there are some ways around that.
Aside from that, there should be no problem with executing SQL operations at the time that you intercept a 200 reply in an onreply_route. Do note, however, that the reply is not going to get relayed until all your operations are done. If what you were asking is whether there is a way to defer those SQL operations until after the reply has already been relayed, the answer is yes, but not entirely straightforwardly (have a look at the 'mqueue' and 'rtimer' modules).
-- Alex