Getting 401 for INVITE and call fails

Hi All,

Good day!!!

I have Asterisk 11.11.0 version,

the Registration is successful, able to see the registered users in peer list with IP.

ISSUE : when i make a call, the INVITE is getting the challenge saying 401, my SIP device gets the nonce and calculates and sends the INVITE again, still am getting 401 from Asterisk

note : the second INVITE has the nonce of 401 given by the Asterisk.

Another query is, is it a correct practice that sending a 401 for the INVITE ?

Please some one Help,

Kind Regards
SenthilK

INVITE sip:8861@open-ims.test;user=phone SIP/2.0

From: sip:8863@192.168.27.48:5060;tag=95b3e618-c0a8c86a-13c4-50029-10a-35cd229e-10a

To: sip:8861@open-ims.test;user=phone

Call-ID: 95b483a8-c0a8c86a-13c4-50029-10a-795c0500-10a

CSeq: 1 INVITE

Via: SIP/2.0/UDP 192.168.200.106:5060;branch=z9hG4bK-10a-41177-6dfb2098

P-Preferred-Identity: sip:8863@192.168.27.48;user=phone

Max-Forwards: 70

Supported: timer,replaces,join,tdialog,100rel,histinfo,path

User-Agent: ARRIS-TM504G release v.6.2.91.SIP.PC20.NOUSB SN/0015A31A7AB4

Contact: sip:8863@192.168.200.106:5060;user=phone

Session-Expires: 1800;refresher=uac

Min-SE: 90

Allow: INVITE,ACK,BYE,CANCEL,NOTIFY,PRACK,UPDATE,OPTIONS,REFER

Proxy-Authorization: Digest username=“8863”,realm=“192.168.27.216”,nonce=“7bb8f495”,uri=“sip:8861@open-ims.test;user=phone”,response=“9305274a4f26e50775ef7e3c80acd4e0”,algorithm=MD5

Route: sip:192.168.27.48:5060

Content-Type: application/sdp

Content-Length: 216

v=0

o=- 53322 53322 IN IP4 192.168.200.106

s=-

c=IN IP4 192.168.200.106

t=0 0

m=audio 53016 RTP/AVP 0

b=AS:80

b=TIAS:64000

a=ptime:20

a=sendrecv

a=rtpmap:0 PCMU/8000

a=maxprate:50

a=rtcp-xr:voip-metrics

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 192.168.200.106:5060;branch=z9hG4bK-10a-41177-6dfb2098;received=192.168.200.106

From: sip:8863@192.168.27.48:5060;tag=95b3e618-c0a8c86a-13c4-50029-10a-35cd229e-10a

To: sip:8861@open-ims.test;user=phone;tag=as05a91f5c

Call-ID: 95b483a8-c0a8c86a-13c4-50029-10a-795c0500-10a

CSeq: 1 INVITE

Server: Asterisk PBX 11.11.0

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

WWW-Authenticate: Digest algorithm=MD5, realm=“192.168.27.216”, nonce=“04f34848”

Content-Length: 0

ACK sip:8861@open-ims.test;user=phone SIP/2.0

From: sip:8863@192.168.27.48:5060;tag=95b3e618-c0a8c86a-13c4-50029-10a-35cd229e-10a

To: sip:8861@open-ims.test;user=phone;tag=as05a91f5c

Call-ID: 95b483a8-c0a8c86a-13c4-50029-10a-795c0500-10a

CSeq: 1 ACK

Via: SIP/2.0/UDP 192.168.200.106:5060;branch=z9hG4bK-10a-41177-6dfb2098

Max-Forwards: 70

User-Agent: ARRIS-TM504G release v.6.2.91.SIP.PC20.NOUSB SN/0015A31A7AB4

Contact: sip:8863@192.168.200.106:5060;user=phone

Proxy-Authorization: Digest username=“8863”,realm=“192.168.27.216”,nonce=“7bb8f495”,uri=“sip:8861@open-ims.test;user=phone”,response=“d87dece6178768a3de8426d722e71bce”,algorithm=MD5

Content-Length: 0

INVITE sip:8861@open-ims.test;user=phone SIP/2.0

From: sip:8863@192.168.27.48:5060;tag=95b3e618-c0a8c86a-13c4-50029-10a-35cd229e-10a

To: sip:8861@open-ims.test;user=phone

Call-ID: 95b483a8-c0a8c86a-13c4-50029-10a-795c0500-10a

CSeq: 2 INVITE

Via: SIP/2.0/UDP 192.168.200.106:5060;branch=z9hG4bK-10a-4119f-4fa19f3e

P-Preferred-Identity: sip:8863@open-ims.test;user=phone

Max-Forwards: 70

Supported: timer,replaces,join,tdialog,100rel,histinfo,path

User-Agent: ARRIS-TM504G release v.6.2.91.SIP.PC20.NOUSB SN/0015A31A7AB4

Contact: sip:8863@192.168.200.106:5060;user=phone

Session-Expires: 1800;refresher=uac

Min-SE: 90

Allow: INVITE,ACK,BYE,CANCEL,NOTIFY,PRACK,UPDATE,OPTIONS,REFER

Proxy-Authorization: Digest username=“8863”,realm=“192.168.27.216”,nonce=“04f34848”,uri=“sip:8861@open-ims.test;user=phone”,response=“3927d432ea052b771dce5505b936ad55”,algorithm=MD5

Route: sip:192.168.27.48:5060

Content-Type: application/sdp

Content-Length: 216

v=0

o=- 53322 53322 IN IP4 192.168.200.106

s=-

c=IN IP4 192.168.200.106

t=0 0

m=audio 53016 RTP/AVP 0

b=AS:80

b=TIAS:64000

a=ptime:20

a=sendrecv

a=rtpmap:0 PCMU/8000

a=maxprate:50

a=rtcp-xr:voip-metrics

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 192.168.200.106:5060;branch=z9hG4bK-10a-4119f-4fa19f3e;received=192.168.200.106

From: sip:8863@192.168.27.48:5060;tag=95b3e618-c0a8c86a-13c4-50029-10a-35cd229e-10a

To: sip:8861@open-ims.test;user=phone;tag=as05a91f5c

Call-ID: 95b483a8-c0a8c86a-13c4-50029-10a-795c0500-10a

CSeq: 2 INVITE

Server: Asterisk PBX 11.11.0

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

WWW-Authenticate: Digest algorithm=MD5, realm=“192.168.27.216”, nonce=“7480b97d”

Content-Length: 0

ACK sip:8861@open-ims.test;user=phone SIP/2.0

From: sip:8863@192.168.27.48:5060;tag=95b3e618-c0a8c86a-13c4-50029-10a-35cd229e-10a

To: sip:8861@open-ims.test;user=phone;tag=as05a91f5c

Call-ID: 95b483a8-c0a8c86a-13c4-50029-10a-795c0500-10a

CSeq: 2 ACK

Via: SIP/2.0/UDP 192.168.200.106:5060;branch=z9hG4bK-10a-4119f-4fa19f3e

Max-Forwards: 70

User-Agent: ARRIS-TM504G release v.6.2.91.SIP.PC20.NOUSB SN/0015A31A7AB4

Contact: sip:8863@192.168.200.106:5060;user=phone

Proxy-Authorization: Digest username=“8863”,realm=“192.168.27.216”,nonce=“04f34848”,uri=“sip:8861@open-ims.test;user=phone”,response=“9d101015ebcc8d658efad68184ce1951”,algorithm=MD5

Content-Length: 0

The peer isn’t using the correct nonce; it should match the one in the preceeding 401 response.

Hi David,

thank you for the reply.

No, the second INVITE contains the nonce which it got it from the 401 before…

Please check, 04f34848 this is the nonce sent by asterisk, and my device uses this same nonce when sending the INVITE second time

Please help me here

Kind Regards
SenthilK

Looks like I misread it.

Normally you would expect a non-proxy authorisation, but I thought that Asterisk would accept either. As I don’t think I’ve really seen a proxy one, I can’t be certain.