[SR-Users] Manipulate sip header on an in-dialog negative reply

Alex Balashov abalashov at evaristesys.com
Sat Dec 15 19:38:33 CET 2018


Hi,

We had the same problem. As you noted, this is due to a race where the
initial INVITE is processed by a different worker thread than the
re-INVITE.

We solved this by introducing a (very!) small asynchronous delay in
handling all reinvites, around 30 ms or so. That was lazy and probably
could be improved by using 'table' or 'dialog' variables to track
whether the reinvite received is the first reinvite for a given dialog,
and only delay it then. 

Regardless, a litany of features is available to make this easy:

https://kamailio.org/docs/modules/5.2.x/modules/async.html#async.f.async_sleep
https://kamailio.org/docs/modules/5.2.x/modules/rtimer.html
https://kamailio.org/docs/modules/5.2.x/modules/mqueue.html

Though I take no pleasure in saying it, this is probably the most
fruitful solution.

-- Alex

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list