Hello Everyone, How to configure PJSIP to reply 200 OK from upstream sip proxy on keepalive packet ?
proxy ~> Keepalive OPTIONS ~> asterisk
<~ 200 OK <~
You would need to show the OPTIONS and what is happening now.
Right now it reply 401 Unauthorized with message in log “No matching endpoint …”
on Content 0 should reply 200 OK I guess
< --- Received SIP request (376 bytes) from UDP:10.30.100.41:5060 --->
OPTIONS sip:10.30.100.27:5080 SIP/2.0
;tag92222e512215177543fc3584bac4ab8-64cb CSeq: 10 OPTIONS
User-Agent: kamailio (5.0.4 (x86_64/linux))
[Dec 3 09:40:38] NOTICE: res_pjsip/pjsip_distributor.c:659
log_failed_request: Request ‘OPTIONS’ from ‘‘
failed for ‘10.30.100.41:5060’ (callid:
email@example.com) – No matching endpoint found
< --- Transmitting SIP response (556 bytes) to UDP:10.30.100.41:5060 --->
SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP
CSeq: 10 OPTIONS
WWW-Authenticate: Digest realm=”asterisk”,nonce=”1512312038/f51da3d7bab5ef809cce1b595ca071dd”,opaque=”4d6ba4d64d09e4dc”,algorithm=md5,qop=”auth”
Server: Asterisk PBX 14.6.0
You would need to add an endpoint for it and have it match, using a
“type=identify” section matching on IP address would work. You would also need an “s” extension in the context since the OPTIONS request has not extension provided.
If understand correctly type=identify is more for sip trunk configuration ?
In chan_sip it was just reply 200 OK on keepalive packet without need define trunks.
All incoming traffic into chan_pjsip is matched to an endpoint, this includes OPTIONS. The OPTIONS request is also treated as if it were an INVITE per the RFC, which is why the extension also has to exist.
Hello Joshua, What will be example of endpoint configuration that not require authentication from specific ip ?
An endpoint doesn’t know about an IP address. The identify I previously mentioned is what associates the request to an endpoint. In the endpoint if you have no inbound authentication specified (auth option) then it won’t require authentication.
Hello Joshua, Thank you for help that worked.