INVITE REJECTED PJSIP

Dear all, after modifying the sip trunk to pjsip, I came across a problem with incoming calls.

Outgoing calls are ok, but the incoming DID after receiving a call I receive without authorization is rejected.

Follow the configuration screens and tests performed.

<— Received SIP request (1248 bytes) from UDP:187.60.60.75:5060 —>
INVITE sip:s@192.168.90.125:5060;line=ugnvgxf SIP/2.0
Via: SIP/2.0/UDP 187.60.60.75:5060;branch=z9hG4bK-524287-1—df82eeececb4cb47edae7f412628728a;rport
Via: SIP/2.0/UDP 187.60.60.31:5060;branch=z9hG4bK-524287-1—90f90887a8b93a4d073f688bfa71f9fd;rport=5060
Via: SIP/2.0/UDP 187.60.60.228:5070;rport=5070;branch=z9hG4bK-ydhh6e7mtpbmcj23
Max-Forwards: 68
Record-Route: sip:187.60.60.75;lr;ep;pinhole=UDP:201.29.88.176:1030;ipnt=8j0f_t479v0
Record-Route: sip:187.60.60.31;lr;ep;ipnt=8j0xjv479n5
Contact: sip:187.60.60.228:5070
To: sip:552120182173@187.60.60.75
From: 2120182172 sip:2120182172@187.60.60.75;tag=22fx3wajrj4qzuhq.o
Call-ID: Up0oyzUny2PIHeDkueuixg…
CSeq: 190 INVITE
Expires: 300
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS, UPDATE
Content-Disposition: session
Content-Type: application/sdp
User-Agent: PortaSIP
P-Asserted-Identity: 2120182172 sip:2120182172@187.60.60.75
Remote-Party-ID: 2120182172 sip:2120182172@187.60.60.75;party=calling;screen=yes
Content-Length: 191

v=0
o=PortaSIP 1282975126807495989 1 IN IP4 187.60.60.228
s=Z
t=0 0
m=audio 42864 RTP/AVP 101 0 8
c=IN IP4 187.60.60.228
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv

<— Transmitting SIP response (895 bytes) to UDP:187.60.60.75:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 187.60.60.75:5060;rport=5060;received=187.60.60.75;branch=z9hG4bK-524287-1—df82eeececb4cb47edae7f412628728a
Via: SIP/2.0/UDP 187.60.60.31:5060;rport=5060;branch=z9hG4bK-524287-1—90f90887a8b93a4d073f688bfa71f9fd
Via: SIP/2.0/UDP 187.60.60.228:5070;rport=5070;branch=z9hG4bK-ydhh6e7mtpbmcj23
Record-Route: sip:187.60.60.75:5060;lr;ep;pinhole=UDP:201.29.88.176:1030;ipnt=8j0f_t479v0
Record-Route: sip:187.60.60.31;lr;ep;ipnt=8j0xjv479n5
Call-ID: Up0oyzUny2PIHeDkueuixg…
From: “2120182172” sip:2120182172@187.60.60.75;tag=22fx3wajrj4qzuhq.o
To: sip:552120182173@187.60.60.75;tag=z9hG4bK-524287-1—df82eeececb4cb47edae7f412628728a
CSeq: 190 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1694600281/057f812f784c17fa6281e06d4409e527”,opaque=“78e79a4116c4a6db”,algorithm=MD5,qop=“auth”
Server: VitalPBX
Content-Length: 0

<— Received SIP request (697 bytes) from UDP:187.60.60.75:5060 —>
ACK sip:s@192.168.90.125:5060;line=ugnvgxf SIP/2.0
Via: SIP/2.0/UDP 187.60.60.75:5060;branch=z9hG4bK-524287-1—df82eeececb4cb47edae7f412628728a;rport
Via: SIP/2.0/UDP 187.60.60.31:5060;branch=z9hG4bK-524287-1—90f90887a8b93a4d073f688bfa71f9fd;rport=5060
Via: SIP/2.0/UDP 187.60.60.228:5070;rport=5070;branch=z9hG4bK-ydhh6e7mtpbmcj23
Max-Forwards: 68
To: sip:552120182173@187.60.60.75;tag=z9hG4bK-524287-1—df82eeececb4cb47edae7f412628728a
From: 2120182172 sip:2120182172@187.60.60.75;tag=22fx3wajrj4qzuhq.o
Call-ID: Up0oyzUny2PIHeDkueuixg…
CSeq: 190 ACK
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
User-Agent: PortaSIP
Content-Length: 0

<— Transmitting SIP request (445 bytes) to UDP:187.60.60.75:5060 —>
OPTIONS sip:552120182173@187.60.60.75:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.90.125:5060;rport;branch=z9hG4bKPj44c76035-3fcc-49bf-8fa1-12ffa85c2176
From: sip:552120182173@187.60.60.75;tag=bfe8971b-e7c5-48f1-a413-426d594f685d
To: sip:552120182173@187.60.60.75
Contact: sip:552120182173@192.168.90.125:5060
Call-ID: f54e18ed-eb4a-4272-8774-4014849b1982
CSeq: 35379 OPTIONS
Max-Forwards: 70
User-Agent: VitalPBX
Content-Length: 0

<— Received SIP response (494 bytes) from UDP:187.60.60.75:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.90.125:5060;rport=1030;branch=z9hG4bKPj44c76035-3fcc-49bf-8fa1-12ffa85c2176;received=201.29.88.176
To: sip:552120182173@187.60.60.75;tag=6fwjfv6djs3ezbph
From: sip:552120182173@187.60.60.75;tag=bfe8971b-e7c5-48f1-a413-426d594f685d
Call-ID: f54e18ed-eb4a-4272-8774-4014849b1982
CSeq: 35379 OPTIONS
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Server: PortaSIP
Content-Length: 0

<— Received SIP request (1312 bytes) from UDP:187.60.60.75:5060 —>
INVITE sip:s@192.168.90.125:5060;line=ugnvgxf SIP/2.0
Via: SIP/2.0/UDP 187.60.60.75:5060;branch=z9hG4bK-524287-1—2ab11c851fe86ef1f164454c8582b1a3;rport
Via: SIP/2.0/UDP 187.60.60.30:5060;branch=z9hG4bK-524287-1—46c3d327976b100123777876407560be;rport=5060
Via: SIP/2.0/UDP 187.60.60.226:5071;rport=5071;branch=z9hG4bK-dspluyncjvak23yi
Max-Forwards: 68
Record-Route: sip:187.60.60.75;lr;ep;pinhole=UDP:201.29.88.176:1030;ipnt=8j0f_t479u0
Record-Route: sip:187.60.60.30;lr;ep;ipnt=8j02qv479l5
Contact: sip:187.60.60.226:5071
To: sip:552120182173@187.60.60.75
From: sip:5521982347502@187.60.60.75;tag=snodcmf2lfz62zgx.o
Call-ID: 308604273_117370215@10.1.0.176
CSeq: 822 INVITE
Expires: 300
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS, UPDATE
Content-Disposition: session
Content-Type: application/sdp
User-Agent: PortaSIP
P-Asserted-Identity: sip:5521982347502@187.60.60.75
Remote-Party-ID: sip:5521982347502@187.60.60.75;party=calling;screen=no
Content-Length: 274

v=0
o=PortaSIP 2940718873382934842 1 IN IP4 187.60.60.226
s=SIP Media Capabilities
t=0 0
m=audio 35258 RTP/AVP 18 8 101
c=IN IP4 187.60.60.226
a=rtpmap:18 G729/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=maxptime:150

<— Transmitting SIP response (891 bytes) to UDP:187.60.60.75:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 187.60.60.75:5060;rport=5060;received=187.60.60.75;branch=z9hG4bK-524287-1—2ab11c851fe86ef1f164454c8582b1a3
Via: SIP/2.0/UDP 187.60.60.30:5060;rport=5060;branch=z9hG4bK-524287-1—46c3d327976b100123777876407560be
Via: SIP/2.0/UDP 187.60.60.226:5071;rport=5071;branch=z9hG4bK-dspluyncjvak23yi
Record-Route: sip:187.60.60.75:5060;lr;ep;pinhole=UDP:201.29.88.176:1030;ipnt=8j0f_t479u0
Record-Route: sip:187.60.60.30;lr;ep;ipnt=8j02qv479l5
Call-ID: 308604273_117370215@10.1.0.176
From: sip:5521982347502@187.60.60.75;tag=snodcmf2lfz62zgx.o
To: sip:552120182173@187.60.60.75;tag=z9hG4bK-524287-1—2ab11c851fe86ef1f164454c8582b1a3
CSeq: 822 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1694602756/3f593d19ee4ca204fd986884ccc842cb”,opaque=“57e9c7d321b72e26”,algorithm=MD5,qop=“auth”
Server: VitalPBX
Content-Length: 0

<— Received SIP request (695 bytes) from UDP:187.60.60.75:5060 —>
ACK sip:s@192.168.90.125:5060;line=ugnvgxf SIP/2.0
Via: SIP/2.0/UDP 187.60.60.75:5060;branch=z9hG4bK-524287-1—2ab11c851fe86ef1f164454c8582b1a3;rport
Via: SIP/2.0/UDP 187.60.60.30:5060;branch=z9hG4bK-524287-1—46c3d327976b100123777876407560be;rport=5060
Via: SIP/2.0/UDP 187.60.60.226:5071;rport=5071;branch=z9hG4bK-dspluyncjvak23yi
Max-Forwards: 68
To: sip:552120182173@187.60.60.75;tag=z9hG4bK-524287-1—2ab11c851fe86ef1f164454c8582b1a3
From: sip:5521982347502@187.60.60.75;tag=snodcmf2lfz62zgx.o
Call-ID: 308604273_117370215@10.1.0.176
CSeq: 822 ACK
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
User-Agent: PortaSIP
Content-Length: 0

My Comments:

  • The Local Password (Segredo Local) isn’t required.
  • In the field “Identify By” or “Indentificar por” you must select “Auth Username” and “Username.”
  • In the codecs field, I would select “ulaw,alaw,g729”

Finally, check that your trunk is well registered in the PJSIP Reports module.

Try placing the number “552120182173” in the field “Contact User” if the incoming calls are not working after doing the above.

After battling inbound from a ringlogix trunk to a PJSIP trunk on the vitalpbx I tried the last recommendation here to place the trunk id number in the “Contact User” location and can now receive calls.

1 Like

Hello everyone, thank you all very much!

If resolved, I made the suggested changes and success, thank you for taking the time to help me.

1 Like

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