PJSIP Loosing Registration

Having a problem here with “Asterisk certified/16.8-cert11” and pjsip chan with real time configuration. I noticed that all endpoints after about 4 min are going offline with no reason until the next REGISTER from the application is coming in. The endpoint is configured with 150 sec qualify option.

For example one particular case:

15:03:22: REGISTER APP → ASTERISK (Asterisk is replying back with 200 OK and endpoint is shown as Avail and Not in use in the console. <Expires: 300>)
15:05:52: OPTION ASTERISK → APP (Application is replying back with 200 OK)
15:07:13: Endpoint went offline with the following status:

Endpoint:  101                                         Not in use    0 of inf
        Aor:  101                                       20
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060

it is shown as “Not in use” but without contact information. Any attempts to dial this endpoint result in an error: No route to the destination.

Couldn’t see any warning or errors in the asterisk console while this is happening. Why would asterisk remove contact information from an endpoint if that is answering successfully to the OPTIONS?

Are the endpoints on the same LAN as Asterisk?

Yes, the same network.

As I understand it, ARA is only community supported, which means that it wouldn’t be covered by a Sangoma maintenance contract. The only reason for having a cert version is that you have such a contract. As such, I’d suggest upgrading to version 16.20.0.

The same is happening with Asterisk 16.20.0

18:01:38: REGISTER APP → ASTERISK
18:04:08: OPTION ASTERISK → APP
18:05:15: Endpoint went offline

Asterisk was compiled with bundled pjproject.

PJPROJECT version currently running against: 2.10

You’d need to show an actual SIP trace. OPTIONS doesn’t remove a Contact, a Contact only goes when it is expired and not refreshed.

Attaching here some screenshots with the SIP messages:

Application: 10.1.50.231 / Asterisk: 10.1.50.72

And the OPTIONS message:

Except for that there are no other SIP messages between those 2 devices. If I’m increasing the Expire time to 600 sec, then Asterisk is removing the contact information after ~9min, so there is a gap for about less than a min until the next REGISTER is coming in. Is that happening only to me? Did I miss something in the endpoint configuration?

Qualification is actually not needed, and OPTION requests are not even part of the same SIP session. I have some older SIP devices, that even don’t answer to OPTIONS requests. You probably need to isolate the problem more thoroughly.

Theoretically, it could even be a hardware or a network problem. I remember a case where I suggested a network problem, but the customer and his expert IT consultant didn’t believe it. After months of trouble, they finally found out that two devices in the LAN had the same IP. Pretty stupid, as the Windows boxes signaled that all the time. I am just saying.

You could increase the debug level and see what gets printed. I think there are messages when the contact gets lost with some additional text.

Removing ps_contacts from the real time DB fixed the issue.