Asynchronous data processing during registration cause device if offline - Asterisk 18.7.1 LTS

Hi, i noticed the strange asterisk behavior when SIP devices try to register.

I have some sip devices which every time when register/re-register first send REGISTER request with expiration:0 (which means unregister) and immediately without waiting for the answer send a new REGISTER request with expiration > 0 (in my case 300).

What’s going wrong is that Asterisk somehow first proceeds the second request and then the first one and the device remains unregistered from Asterisk’s point of view.
Also, the Asterisk console says that the device is unreachable from that moment.

pjsip show contacts
do not show this device anymore.

Sometimes device manages to register, sometimes not, depending on how fast Asterisk handles these requests.
I can not attach my .pcap but i made some screenshots.

I am aware that this sip device also should not send these requests in this way but, Asterisk should handle it in the right order?
Whether there is an option for synchronous request processing?

It may be also caused by UDP transport but currently, i can not switch to TCP.
I am using PJSIP chan.

I don’t believe we guarantee any ordering for that scenario, and there is no option currently to change that.

Even if Asterisk sent the 401’s in strict order of arrival of the unauthenticated requests, you could still get this as the result of packet loss and retransmission or because of load sharing across multiple physical interfaces.

Once the 401s are reversed, the rest would follow, even with no re-ordering.

OK, i forgot to say that the same devices were working OK with my old Asterisk 15.5.0 and SIP chan.
It works without problem for the last two years.
Same hardware, same network, different asterisk: ‘Asterisk 18.7.1 PJSIP chan’ vs ‘Asterisk 15.5.0 SIP chan’

Thanks for the fast response!

Maybe it is not related to how Asterisk sends packets on the network because sometimes also happening that last 200 OK is related to register request but Asterisk CLI says that the device is unreachable from that moment.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.