[asterisk-users] Initial REGISTER Request: Contains Credentials before 401

Brian LaVallee b.lavallee at globaltank.jp
Wed May 15 02:33:35 CDT 2013


My SIP provider is not happy that credentials (in the Authorization header
field) are provided in the initial REGISTER request.

The SIP provider ONLY wants the credentials AFTER rejecting the message with
a 401.

I know it's dumb, because the RFC says that the the initial REGISTER message
MAY include credentials.  If it fails, the proper authentication method is
included in the 401.  I know there is nothing wrong, it is how SIP is
supposed to work.

However I would like to keep my SIP provider from complaining.  Asterisk is
"NOT SUPPORTED" by the SIP provider.

Does anyone in the Asterisk community know how to avoid sending the
credentials until AFTER receiving a 401?

Any suggestions would be appreciated!


Sincerely,
Brian LaVallee

  
# ===========================
# sip.conf
# Asterisk 1.8.15-cert1
# ---------------------------
; 
[general]
;
; - trucated
; 
register=>accountnumber at server.carrier.tld:secret:account at proxy.carrier.tld/
DID
;
; - end

# ===========================
# SIP REGISTER Dialog
# ---------------------------

IP 4.4.4.4.sip > 8.8.8.8.sip: UDP, length 602
............................REGISTER sip:server.carrier.tld SIP/2.0
Via: SIP/2.0/UDP 4.4.4.4:5060;branch=aAaAaAaAaAaAaAa
Max-Forwards: 70
From: <sip:accountnumber at server.carrier.tld>;tag=as6c2d23d4
To: <sip:accountnumber at server.carrier.tld>
Call-ID: 3e47b75000b0924b6c9ba5759a7cf15d at 4.4.4.4
CSeq: 190 REGISTER
Authorization: Digest username="account", realm="carrier.tld",
algorithm=MD5, uri="sip:sip:8.8.8.8", nonce="1368595443265327",
response="0b833bff6d83337f9f88f6fb53bbcef6"
Expires: 1800
Contact: <sip:DID at 4.4.4.4:5060>
Content-Length: 0


IP 8.8.8.8.sip > 4.4.4.4.sip: UDP, length 469
............................SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 4.4.4.4:5060;branch=aAaAaAaAaAaAaAa
From: <sip:accountnumber at server.carrier.tld>;tag=as6c2d23d4
To: <sip:accountnumber at server.carrier.tld>;tag=3577586129
Call-ID: 3e47b75000b0924b6c9ba5759a7cf15d at 4.4.4.4
CSeq: 190 REGISTER
Content-Length: 0
Date: Wed, 15 May 2013 05:55:29 GMT
WWW-Authenticate: Digest realm="carrier.tld", domain="sip:8.8.8.8",
nonce="1368597329273572", opaque="", stale=TRUE, algorithm=MD5


IP 4.4.4.4.sip > 8.8.8.8.sip: UDP, length 602
............................REGISTER sip:server.carrier.tld SIP/2.0
Via: SIP/2.0/UDP 4.4.4.4:5060;branch=BbBbBbBbBbBbBbB
Max-Forwards: 70
From: <sip:accountnumber at server.carrier.tld>;tag=as333ffab1
To: <sip:accountnumber at server.carrier.tld>
Call-ID: 3e47b75000b0924b6c9ba5759a7cf15d at 4.4.4.4
CSeq: 191 REGISTER
Authorization: Digest username="account", realm="carrier.tld",
algorithm=MD5, uri="sip:sip:8.8.8.8", nonce="1368597329273572",
response="097ee5b915cd39c1407c785fb3c06caf"
Expires: 1800
Contact: <sip:DID at 4.4.4.4:5060>
Content-Length: 0


IP 8.8.8.8.sip > 4.4.4.4.sip: UDP, length 373
............................SIP/2.0 200 OK
Via: SIP/2.0/UDP 4.4.4.4:5060;branch=BbBbBbBbBbBbBbB
From: <sip:accountnumber at server.carrier.tld>;tag=as333ffab1
To: <sip:accountnumber at server.carrier.tld>
Call-ID: 3e47b75000b0924b6c9ba5759a7cf15d at 4.4.4.4
CSeq: 191 REGISTER
Contact: <sip:DID at 4.4.4.4:5060>;q=0;expires=1901
Content-Length: 0
Date: Wed, 15 May 2013 05:55:29 GMT

# ===========================







More information about the asterisk-users mailing list