[asterisk-users] Asterisk refuses INVITE (401) and I don't know why

Bruce Ferrell bferrell at baywinds.org
Tue Nov 22 09:25:21 CST 2011


Jonas,

May I suggest that you present us your sip.conf entry for this peer, properly redacted, of course.  That might help more.  What I do for "gateways" at known addresses is to put an
entry like this into the sip.conf entry:


[peer]
type=peer
defaultip=192.168.40.123
insecure=invite,port
context=some_context





On 11/22/2011 06:40 AM, Jonas Kellens wrote:
> Hello list,
>
> this is the communication between an Aastra 5000 PBX and Asterisk, where the Aastra makes a call to Asterisk. For some reason, Asterisk responds with 401-Unauthorized and I don't
> know why.
>
> Calls go well with Panasonic PBX, Avaya PBX, Alcatel-Lucent PBX but NOT with this Aastra.
>
>
> A1.A1.A1.A1 = IP-address Asterisk PBX
> AS.AS.AS.AS = IP-address Aastra PBX
>
> Aastra PBX makes a call to the number 3221112233...
>
> This is all the sip debug trace gathered with asterisk :
>
>
> <--- SIP read from UDP:AS.AS.AS.AS:61490 --->
> INVITE sip:3221112233 at A1.A1.A1.A1:5060 SIP/2.0
> Via: SIP/2.0/UDP AS.AS.AS.AS:61490;branch=z9hG4bK15388160301891243008;rport
> From: <sip:SIPPEERusername at sip.domain.tld:5060>;tag=310158BD
> To: <sip:3221112233 at A1.A1.A1.A1:5060>
> Call-ID: 0201FFFFCEFEA742
> CSeq: 1 INVITE
> Contact: <sip:SIPPEERusername at AS.AS.AS.AS:61490>
> Proxy-Authorization: Digest username="SIPPEERusername", realm="domain.tld", nonce="67105ac4", uri="sip:3221112233 at A1.A1.A1.A1:5060", response="60be856773
> f86450fc9ddbaf7a568505", algorithm=MD5
> Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, UPDATE
> Max-Forwards: 70
> Privacy: none
> P-Asserted-Identity: <sip:3224445566 at sip.domain.tld>
> User-Agent: A5000 R52-H2C0205
> P-Behind-Gsi: 192.168.6.1
> Content-Type: application/sdp
> Content-Length:195
>
> v=0
> o=- 0 0 IN IP4 sip.domain.tld
> s=-
> i=(o=IN IP4 10.1.2.35)
> c=IN IP4 AS.AS.AS.AS
> t=0 0
> m=audio 62654 RTP/AVP 8 0
> a=rtcp:65115
> a=rtpmap:8 PCMA/8000
> a=rtpmap:0 PCMU/8000
> a=ptime:20
>
> <------------->
>
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] --- (16 headers 11 lines) ---
> [Nov 18 15:14:35] VERBOSE[2255] netsock.c: [Nov 18 15:14:35]   == Using SIP RTP TOS bits 184
> [Nov 18 15:14:35] VERBOSE[2255] netsock.c: [Nov 18 15:14:35]   == Using SIP RTP CoS mark 5
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Sending to AS.AS.AS.AS : 61490 (no NAT)
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Using INVITE request as basis request - 0201FFFFCEFEA742
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Found peer 'SIPPEERusername' for 'SIPPEERusername' from AS.AS.AS.AS:61490
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35]
> <--- Reliably Transmitting (NAT) to AS.AS.AS.AS:61490 --->
> SIP/2.0 401 Unauthorized
> Via: SIP/2.0/UDP AS.AS.AS.AS:61490;branch=z9hG4bK15388160301891243008;received=AS.AS.AS.AS;rport=61490
> From: <sip:SIPPEERusername at sip.domain.tld:5060>;tag=310158BD
> To: <sip:3221112233 at A1.A1.A1.A1:5060>;tag=as68f71fe5
> Call-ID: 0201FFFFCEFEA742
> CSeq: 1 INVITE
> Server: Asterisk PBX 1.6.2.20
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
> Supported: replaces, timer
> WWW-Authenticate: Digest algorithm=MD5, realm="domain.tld", nonce="46ef24d9"
> Content-Length: 0
>
> <------------>
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Scheduling destruction of SIP dialog '0201FFFFCEFEA742' in 32000 ms (Method: INVITE)
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35]
> <--- SIP read from UDP:AS.AS.AS.AS:61490 --->
> ACK sip:3221112233 at A1.A1.A1.A1:5060 SIP/2.0
> Via: SIP/2.0/UDP AS.AS.AS.AS:61490;branch=z9hG4bK15388160301891243008;rport
> From: <sip:SIPPEERusername at sip.domain.tld:5060>;tag=310158BD
> To: <sip:3221112233 at A1.A1.A1.A1:5060>;tag=as68f71fe5
> Call-ID: 0201FFFFCEFEA742
> CSeq: 1 ACK
> Contact: <sip:SIPPEERusername at AS.AS.AS.AS:61490>
> Max-Forwards: 70
> User-Agent: A5000 R52-H2C0205
> P-Behind-Gsi: 192.168.6.1
> Content-Length: 0
>
>
> <------------->
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] --- (11 headers 0 lines) ---
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35]
> <--- SIP read from UDP:AS.AS.AS.AS:61490 --->
> INVITE sip:3221112233 at A1.A1.A1.A1:5060 SIP/2.0
> Via: SIP/2.0/UDP AS.AS.AS.AS:61490;branch=z9hG4bK6996345481960200906;rport
> From: <sip:SIPPEERusername at sip.domain.tld:5060>;tag=33015DBD
> To: <sip:3221112233 at A1.A1.A1.A1:5060>
> Call-ID: 0201FFFFCCFEA242
> CSeq: 1 INVITE
> Contact: <sip:SIPPEERusername at AS.AS.AS.AS:61490>
> Proxy-Authorization: Digest username="SIPPEERusername", realm="domain.tld", nonce="46ef24d9", uri="sip:3221112233 at A1.A1.A1.A1:5060", response="14ecbfc7df24b49926151284c123ea11",
> algorithm=MD5
> Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, UPDATE
> Max-Forwards: 70
> Privacy: none
> P-Asserted-Identity: <sip:3224445566 at sip.domain.tld>
> User-Agent: A5000 R52-H2C0205
> P-Behind-Gsi: 192.168.6.1
> Content-Type: application/sdp
> Content-Length:195
>
> v=0
> o=- 0 0 IN IP4 sip.domain.tld
> s=-
> i=(o=IN IP4 10.1.2.35)
> c=IN IP4 AS.AS.AS.AS
> t=0 0
> m=audio 62654 RTP/AVP 8 0
> a=rtcp:65115
> a=rtpmap:8 PCMA/8000
> a=rtpmap:0 PCMU/8000
> a=ptime:20
>
>
> <------------->
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] --- (16 headers 11 lines) ---
> [Nov 18 15:14:35] VERBOSE[2255] netsock.c: [Nov 18 15:14:35]   == Using SIP RTP TOS bits 184
> [Nov 18 15:14:35] VERBOSE[2255] netsock.c: [Nov 18 15:14:35]   == Using SIP RTP CoS mark 5
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Sending to AS.AS.AS.AS : 61490 (no NAT)
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Using INVITE request as basis request - 0201FFFFCCFEA242
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Found peer 'SIPPEERusername' for 'SIPPEERusername' from AS.AS.AS.AS:61490
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35]
> <--- Reliably Transmitting (NAT) to AS.AS.AS.AS:61490 --->
> SIP/2.0 401 Unauthorized
> Via: SIP/2.0/UDP AS.AS.AS.AS:61490;branch=z9hG4bK6996345481960200906;received=AS.AS.AS.AS;rport=61490
> From: <sip:SIPPEERusername at sip.domain.tld:5060>;tag=33015DBD
> To: <sip:3221112233 at A1.A1.A1.A1:5060>;tag=as1ba6ed56
> Call-ID: 0201FFFFCCFEA242
> CSeq: 1 INVITE
> Server: Asterisk PBX 1.6.2.20
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
> Supported: replaces, timer
> WWW-Authenticate: Digest algorithm=MD5, realm="domain.tld", nonce="3df09f45"
> Content-Length: 0
>
>
> <------------>
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Scheduling destruction of SIP dialog '0201FFFFCCFEA242' in 32000 ms (Method: INVITE)
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35]
> <--- SIP read from UDP:AS.AS.AS.AS:61490 --->
> ACK sip:3221112233 at A1.A1.A1.A1:5060 SIP/2.0
> Via: SIP/2.0/UDP AS.AS.AS.AS:61490;branch=z9hG4bK6996345481960200906;rport
> From: <sip:SIPPEERusername at sip.domain.tld:5060>;tag=33015DBD
> To: <sip:3221112233 at A1.A1.A1.A1:5060>;tag=as1ba6ed56
> Call-ID: 0201FFFFCCFEA242
> CSeq: 1 ACK
> Contact: <sip:SIPPEERusername at AS.AS.AS.AS:61490>
> Max-Forwards: 70
> User-Agent: A5000 R52-H2C0205
> P-Behind-Gsi: 192.168.6.1
> Content-Length: 0
>
>
> <------------->
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] --- (11 headers 0 lines) ---
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35]
> <--- SIP read from UDP:AS.AS.AS.AS:61490 --->
> INVITE sip:3221112233 at A1.A1.A1.A1:5060 SIP/2.0
> Via: SIP/2.0/UDP AS.AS.AS.AS:61490;branch=z9hG4bK847851481531358325;rport
> From: <sip:SIPPEERusername at sip.domain.tld:5060>;tag=340163BD
> To: <sip:3221112233 at A1.A1.A1.A1:5060>
> Call-ID: 0201FFFFCBFE9C42
> CSeq: 1 INVITE
> Contact: <sip:SIPPEERusername at AS.AS.AS.AS:61490>
> Proxy-Authorization: Digest username="SIPPEERusername", realm="domain.tld", nonce="3df09f45", uri="sip:3221112233 at A1.A1.A1.A1:5060", response="80683cd640815b362f74afcfcb68809a",
> algorithm=MD5
> Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, UPDATE
> Max-Forwards: 70
> Privacy: none
> P-Asserted-Identity: <sip:3224445566 at sip.domain.tld>
> User-Agent: A5000 R52-H2C0205
> P-Behind-Gsi: 192.168.6.1
> Content-Type: application/sdp
> Content-Length:195
>
> v=0
> o=- 0 0 IN IP4 sip.domain.tld
> s=-
> i=(o=IN IP4 10.1.2.35)
> c=IN IP4 AS.AS.AS.AS
> t=0 0
> m=audio 62654 RTP/AVP 8 0
> a=rtcp:65115
> a=rtpmap:8 PCMA/8000
> a=rtpmap:0 PCMU/8000
> a=ptime:20
>
>
> <------------->
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] --- (16 headers 11 lines) ---
> [Nov 18 15:14:35] VERBOSE[2255] netsock.c: [Nov 18 15:14:35]   == Using SIP RTP TOS bits 184
> [Nov 18 15:14:35] VERBOSE[2255] netsock.c: [Nov 18 15:14:35]   == Using SIP RTP CoS mark 5
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Sending to AS.AS.AS.AS : 61490 (no NAT)
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Using INVITE request as basis request - 0201FFFFCBFE9C42
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Found peer 'SIPPEERusername' for 'SIPPEERusername' from AS.AS.AS.AS:61490
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35]
> <--- Reliably Transmitting (NAT) to AS.AS.AS.AS:61490 --->
> SIP/2.0 401 Unauthorized
> Via: SIP/2.0/UDP AS.AS.AS.AS:61490;branch=z9hG4bK847851481531358325;received=AS.AS.AS.AS;rport=61490
> From: <sip:SIPPEERusername at sip.domain.tld:5060>;tag=340163BD
> To: <sip:3221112233 at A1.A1.A1.A1:5060>;tag=as26c6d395
> Call-ID: 0201FFFFCBFE9C42
> CSeq: 1 INVITE
> Server: Asterisk PBX 1.6.2.20
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
> Supported: replaces, timer
> WWW-Authenticate: Digest algorithm=MD5, realm="domain.tld", nonce="6a7cfd54"
> Content-Length: 0
>
>
> <------------>
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35] Scheduling destruction of SIP dialog '0201FFFFCBFE9C42' in 32000 ms (Method: INVITE)
> [Nov 18 15:14:35] VERBOSE[2255] chan_sip.c: [Nov 18 15:14:35]
> <--- SIP read from UDP:AS.AS.AS.AS:61490 --->
> ACK sip:3221112233 at A1.A1.A1.A1:5060 SIP/2.0
> Via: SIP/2.0/UDP AS.AS.AS.AS:61490;branch=z9hG4bK847851481531358325;rport
> From: <sip:SIPPEERusername at sip.domain.tld:5060>;tag=340163BD
> To: <sip:3221112233 at A1.A1.A1.A1:5060>;tag=as26c6d395
> Call-ID: 0201FFFFCBFE9C42
> CSeq: 1 ACK
> Contact: <sip:SIPPEERusername at AS.AS.AS.AS:61490>
> Max-Forwards: 70
> User-Agent: A5000 R52-H2C0205
> P-Behind-Gsi: 192.168.6.1
> Content-Length: 0
>
>
>
> Thanks.
>
> Kind regards,
> Jonas.
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20111122/cd164b58/attachment.htm>


More information about the asterisk-users mailing list