PJSIP OPTIONS

Home » Asterisk Users » PJSIP OPTIONS
Asterisk Users 8 Comments

Hello Everyone, How to configure PJSIP to reply 200 OK from upstream sip proxy on keepalive packet ?

proxy ~> Keepalive OPTIONS ~> asterisk
<~ 200 OK <~ volga629

8 thoughts on - PJSIP OPTIONS

  • 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
    Via: SIP/2.0/UDP
    10.30.100.41;branch=z9hG4bKf5eb.1ac76487000000000000000000000000.0
    To:
    From:
    ;tag92222e512215177543fc3584bac4ab8-64cb CSeq: 10 OPTIONS
    Call-ID: 66bf010933a080fe-17271@10.30.100.41
    Max-Forwards: 70
    Content-Length: 0
    User-Agent: kamailio (5.0.4 (x86_64/linux))

    [Dec 3 09:40:38] NOTICE[3511]: res_pjsip/pjsip_distributor.c:659
    log_failed_request: Request ‘OPTIONS’ from ‘
    failed for ‘10.30.100.41:5060’ (callid:
    66bf010933a080fe-17271@10.30.100.41) – 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
    10.30.100.41;rportP60;received.30.100.41;branch=z9hG4bKf5eb.1ac76487000000000000000000000000.0
    Call-ID: 66bf010933a080fe-17271@10.30.100.41
    From:
    ;tag92222e512215177543fc3584bac4ab8-64cb To:
    ;tag=z9hG4bKf5eb.1ac76487000000000000000000000000.0
    CSeq: 10 OPTIONS
    WWW-Authenticate: Digest realm=”asterisk”,nonce=”1512312038/f51da3d7bab5ef809cce1b595ca071dd”,opaque=”4d6ba4d64d09e4dc”,algorithm=md5,qop=”auth”
    Server: Asterisk PBX 14.6.0
    Content-Length: 0

    volga629

  • 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 ?

    ;[mytrunk]
    ;type=identify
    ;endpoint=mytrunk
    ;match8.51.100.1
    ;match8.51.100.2

    In chan_sip it was just reply 200 OK on keepalive packet without need define trunks.

    volga629

  • 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 ?

    volga629

  • 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.