[asterisk-users] SIP Registrations

Alexandru Oniciuc Alexandru.Oniciuc at trivenet.it
Thu Sep 30 02:36:59 CDT 2010


Hello list,

                I need some light regarding the way asterisk is handling the SIP Registration method:

                I have an asterisk 1.6.0.22 and a UAC that sends REGISTER requests without the Authentication part in the sip message. The UAC expects a 401 reply to create the correct auth request.
                When it receives an empty REGISTER asterisk does basically 2 things:


1.       returns an 503

<--- SIP read from UDP://1.2.3.5:5060 --->
REGISTER sip:1.2.3.4;user=phone SIP/2.0
Via:SIP/2.0/UDP 1.2.3.5:5060;rport;branch=z9hG4bK62F7FE99
From:<sip:123456789 at 1.2.3.4>;tag=3D090004
To:<sip:123456789 at 1.2.3.4>
Call-ID:3D0807BC@
CSeq:53246 REGISTER
Max-Forwards:70
Contact:<sip:123456789 at 1.2.3.5:5060>
Allow:INVITE,CANCEL,ACK,REGISTER,INFO,BYE,OPTIONS,REFER,NOTIFY,SUBSCRIBE,MESSAGE
Expires:60
User-Agent:OTHER UA
Content-Length:0


<------------->
--- (12 headers 0 lines) ---

<--- Transmitting (no NAT) to 1.2.3.5:5060 --->
SIP/2.0 503 Server error
Via: SIP/2.0/UDP 1.2.3.5:5060;rport;branch=z9hG4bK62F7FE99;received=1.2.3.5
From: <sip:123456789 at 1.2.3.4>;tag=3D090004
To: <sip:123456789 at 1.2.3.4>;tag=as7bb7cbf6
Call-ID: 3D0807BC@
CSeq: 53246 REGISTER
User-Agent: Asterisk 1.6.0.22
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0


2.       returns a 401 with the nonce

<--- SIP read from UDP://1.2.3.5:5060 --->
REGISTER sip:1.2.3.4;user=phone SIP/2.0
Via:SIP/2.0/UDP 1.2.3.5:5060;rport;branch=z9hG4bK62F7FEA5
From:<sip:123456789 at 1.2.3.4>;tag=3D090008
To:<sip:123456789 at 1.2.3.4>
Call-ID:3D0807BC@
CSeq:53248 REGISTER
Max-Forwards:70
Contact:<sip:123456789 at 1.2.3.5:5060>
Allow:INVITE,CANCEL,ACK,REGISTER,INFO,BYE,OPTIONS,REFER,NOTIFY,SUBSCRIBE,MESSAGE
Expires:60
User-Agent:OTHER UA
Content-Length:0


<------------->
--- (12 headers 0 lines) ---
Sending to 1.2.3.5 : 5060 (no NAT)
<--- Transmitting (no NAT) to 1.2.3.5:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 1.2.3.5:5060;rport;branch=z9hG4bK62F7FEA5;received=1.2.3.5
From: <sip:123456789 at 1.2.3.4>;tag=3D090008
To: <sip:123456789 at 1.2.3.4>;tag=as0811b2ee
Call-ID: 3D0807BC@
CSeq: 53248 REGISTER
User-Agent: Asterisk 1.6.0.22
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="myrealm", nonce="6a08a09c"
Content-Length: 0

The questions are:

*         is asterisk supposed to return the 401 to a REGISTER method which lacks the Auth Info? I saw that it returns 401 to REGISTER methods that have the wrong nonce and this behavior should be correct.

*         the Register method should always contain the last nonce and the auth part?

*         why the 503 message?

Thanks in advance,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100930/6f0c9f38/attachment.htm 


More information about the asterisk-users mailing list