PJSIP - Accept OPTIONS without userpart in header?


In RFC3261 #11:

   The target of the OPTIONS request is identified by the Request-URI,
   which could identify another UA or a SIP server.  If the OPTIONS is
   addressed to a proxy server, the Request-URI is set without a user
   part, similar to the way a Request-URI is set for a REGISTER request.

Currently OPTIONS-Pings get an 401 Unauthorized when the userpart is skipped (which is fine with RFC).
Is there a way to modify this behaviour in Asterisk 13+?

1 Like

Authentication occurs at a higher level than all of the modules which handle requests. If you turn on debug does it actually find the endpoint? (It’s identified based on the user portion of the From) If not then you could enable the anonymous endpoint which directs all unidentified requests to the anonymous endpoint. Otherwise there is no way to control it. I also assume you mean our behavior of how we handle incoming OPTIONS requests.

You assumed corrent :wink:
PJSIP rejects the endpoint as it can not be matched.
I will check the anonymous part. Can I add anonymous and map it to a locked down dialplan (just Hangup 21)?

Yes, it’s a normal endpoint so all of the same settings and such apply. It’s just named anonymous.

1 Like

Perfect, thank you!
I will try this.