SIP: Register

From Jaymzworld

Jump to: navigation, search

Contents

Introduction

Registration binds a particular device Contact URI with a SIP user Address of Record (AOR).

Karen at extension 24001 sends a SIP REGISTER request to the SES server. The SES server provides a challenge to the endpoint, which encrypts the user information according to the challenge issued by the server and sends the response back. The SES server validates the credentials. It registers Karen in its contact database and returns a response (200 OK) to the SIP client. The response includes the Karen's current contact list in Contact headers. The format of the authentication shown is HTTP digest.

Avaya SES endpoint registers

SIP message ladder

10.0.13.244             10.0.1.8
|                       | <Call><PFrame><Time>
|                       |
|>F1 REGISTER --------->|  1 PF:1   10:31:15.8467
|                       |
|<- Unauthorized 401 F2<|  1 PF:2   10:31:15.8668
|                       |
|>F3 REGISTER --------->|  1 PF:3   10:31:15.9057
|                       |
|<----------- OK 200 F4<|  1 PF:4   10:31:15.9171

Detailed messages

Notes on the headers below:

  • The To: field is who is being registered (Address of Record)
  • From: is the party performing the registration
  • Contact: is what is being registered
  • The same Call-ID as here will be used during re-registration
REGISTER sip:iptlab.com SIP/2.0
Via: SIP/2.0/UDP 10.0.13.244;branch=z9hG4bK2e8f4cae1
Max-Forwards: 70
Content-Length: 0
To: Karen Filippelli 24001 <sip:24001@iptlab.com>
From: Karen Filippelli 24001 <sip:24001@iptlab.com>;tag=69db898e3431cfa
Call-ID: bd70c8844106327501446a65cc257abe@10.0.13.244
CSeq: 1820884953 REGISTER
Contact: Karen Filippelli 24001 <sip:24001@10.0.13.244>;expires=360
Allow: NOTIFY
Allow: REFER
Allow: OPTIONS
Allow: INVITE
Allow: ACK
Allow: CANCEL
Allow: BYE
User-Agent: Elite 1.0 Brcm Callctrl/1.5.1.0 MxSF/v3.2.6.26

Authentication is required, so SES challenges the endpoint, sending a WWW-Authenticate nonce value. This challenge may be for Proxy (Proxy-Authenticate), as well as for UAS (WWW-Authenticate).

SIP/2.0 401 Unauthorized
From: Karen Filippelli 24001 <sip:24001@iptlab.com>;tag=69db898e3431cfa
To: Karen Filippelli 24001 <sip:24001@iptlab.com>;tag=FF78C5D3F514954FB230386A2A1F650E121423244546955
Call-ID: bd70c8844106327501446a65cc257abe@10.0.13.244
CSeq: 1820884953 REGISTER
Via: SIP/2.0/UDP 10.0.13.244;received=10.0.13.244;branch=z9hG4bK2e8f4cae1
Content-Length: 0
WWW-Authenticate: Digest realm="iptlab.com",domain="iptlab.com",
nonce="MTIxNDIzMjQ0NTpTREZTZXJ2ZXJTZWNyZXRLZXk6NjI4Nzc4MzYx",algorithm=MD5
Server: Avaya SIP Enablement Services
Organization: iptlab.com

The endpoint replies with the proper nonce reply.

REGISTER sip:iptlab.com SIP/2.0
Via: SIP/2.0/UDP 10.0.13.244;branch=z9hG4bKd9332f9b3
Max-Forwards: 70
Content-Length: 0
To: Karen Filippelli 24001 <sip:24001@iptlab.com>
From: Karen Filippelli 24001 <sip:24001@iptlab.com>;tag=69db898e3431cfa
Call-ID: bd70c8844106327501446a65cc257abe@10.0.13.244
CSeq: 1820884954 REGISTER
Contact: Karen Filippelli 24001 <sip:24001@10.0.13.244>;expires=360
Allow: NOTIFY
Allow: REFER
Allow: OPTIONS
Allow: INVITE
Allow: ACK
Allow: CANCEL
Allow: BYE
Authorization:Digest response="2a144ebfdd56c7c0f6e4fa2045cb85ad",username="24001",realm="iptlab.com",
nonce="MTIxNDIzMjQ0NTpTREZTZXJ2ZXJTZWNyZXRLZXk6NjI4Nzc4MzYx",algorithm=MD5,uri="sip:iptlab.com"
User-Agent: Elite 1.0 Brcm Callctrl/1.5.1.0 MxSF/v3.2.6.26

Good enough, says SES, you are registered.

SIP/2.0 200 OK
From: Karen Filippelli 24001 <sip:24001@iptlab.com>;tag=69db898e3431cfa
To: Karen Filippelli 24001 <sip:24001@iptlab.com>;tag=FF78C5D3F514954FB230386A2A1F650E121423244546957
Call-ID: bd70c8844106327501446a65cc257abe@10.0.13.244
CSeq: 1820884954 REGISTER
Via: SIP/2.0/UDP 10.0.13.244;received=10.0.13.244;branch=z9hG4bKd9332f9b3
Content-Length: 0
Contact: Karen Filippelli 24001 <sip:24001@10.0.13.244>;expires=360
Date: Mon, 23 Jun 2008 14:47:25 GMT
Organization: iptlab.com
Server: Avaya SIP Enablement Services

Asterisk

For reference, here's a registration from the Asterisk SIP implementation.

REGISTER sip:iptlab.com SIP/2.0
Via: SIP/2.0/UDP 10.0.14.250:5060;branch=z9hG4bK5433d84ee
Max-Forwards: 70
Content-Length: 0
To: 60002 <sip:60002@iptlab.com>
From: 60002 <sip:60002@iptlab.com>;tag=66bf526da0aac2b
Call-ID: df00b54215201d55fbdd1b1b4a8ae355@10.0.14.250
CSeq: 395083480 REGISTER
Route: <sip:10.0.5.110;lr>
Contact: 60002 <sip:60002@10.0.14.250:5060>;expires=3600
Allow: NOTIFY
Allow: REFER
Allow: OPTIONS
Allow: INVITE
Allow: ACK
Allow: CANCEL
Allow: BYE
User-Agent: Avaya SIP R2.2 Endpoint Brcm Callctrl/1.5.1.0 MxSF/v3.2.6.26

As seen with SES, Asterisk challenges the endpoint.

SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.14.250:5060;branch=z9hG4bK5433d84ee;received=10.0.14.250
From: 60002 <sip:60002@iptlab.com>;tag=66bf526da0aac2b
To: 60002 <sip:60002@iptlab.com>;tag=as3d641827
Call-ID: df00b54215201d55fbdd1b1b4a8ae355@10.0.14.250
CSeq: 395083480 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="iptlab.com", nonce="3963cd8c"
Content-Length: 0

The phone replies with the (hopefully) correct credentials

REGISTER sip:iptlab.com SIP/2.0
Via: SIP/2.0/UDP 10.0.14.250:5060;branch=z9hG4bKef4c470fd
Max-Forwards: 70
Content-Length: 0
To: 60002 <sip:60002@iptlab.com>
From: 60002 <sip:60002@iptlab.com>;tag=66bf526da0aac2b
Call-ID: df00b54215201d55fbdd1b1b4a8ae355@10.0.14.250
CSeq: 395083481 REGISTER
Route: <sip:10.0.5.110;lr>
Contact: 60002 <sip:60002@10.0.14.250:5060>;expires=3600
Allow: NOTIFY
Allow: REFER
Allow: OPTIONS
Allow: INVITE
Allow: ACK
Allow: CANCEL
Allow: BYE
Authorization:Digest response="3e55292c9bb7ad83200f52e0c8612b59",username="60002",realm="iptlab.com",
nonce="3963cd8c",algorithm=MD5,uri="sip:iptlab.com"
User-Agent: Avaya SIP R2.2 Endpoint Brcm Callctrl/1.5.1.0 MxSF/v3.2.6.26

Asterisk approves.

SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.14.250:5060;branch=z9hG4bKef4c470fd;received=10.0.14.250
From: 60002 <sip:60002@iptlab.com>;tag=66bf526da0aac2b
To: 60002 <sip:60002@iptlab.com>;tag=as3d641827
Call-ID: df00b54215201d55fbdd1b1b4a8ae355@10.0.14.250
CSeq: 395083481 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Expires: 3600
Contact: <sip:60002@10.0.14.250:5060>;expires=3600
Date: Mon, 23 Jun 2008 14:32:03 GMT
Content-Length: 0
Personal tools
communication