sip 注册流程

基本注册流程示意图:

注册流程描述如下:

1、         SIP代理向SIP服务器发送REGISTER请求;

2、         SIP服务器向SIP代理发送响应401,并在响应的消息头WWW-Authenticate字段中给出适合SIP代理的认证体制和参数;

3、         SIP代理重新向SIP服务器发送REGISTER请求,在请求的Authorization字段给出信任书,包含认证信息;

4、         SIP服务器对请求进行验证,如果检查出SIP代理身份合法,向SIP代理发送成功响应200 OK,如果身份不合法则发送拒绝服务应答。

注册信令消息示范:

Register sip:SIP服务器编码@目的域名或者IP地址端口  SIP/2.0

Via:SIP/2.0/UDP 源域名或者IP地址端口

From:<sip:SIP设备编码@源域名>;tag=185328220

To: <sip:SIP设备编码@源域名>

Call-ID:[email protected]

CSeq:1 Register

Contact: <sip:SIP设备编码@源IP地址端口>

Max-Forwords:70

Expires: 7200

Content-Length: 0

SIP/2.0 401 Unauthorized

To: sip:SIP设备编码@源域名

Content-Length: 0

CSeq:1 Register

Call-ID:[email protected]

From:<sip:SIP设备编码@源域名>;tag=185328220

Via:SIP/2.0/UDP 源域名或者IP地址端口

WWW-Authenticate: Digest realm=”64010000”,nonce=”6fe9ba44a76be22a”

Register sip:SIP服务器编码@目的域名或者IP地址端口  SIP/2.0

Via:SIP/2.0/UDP 源域名或者IP地址端口

From:<sip:SIP设备编码@源域名>;tag=185328220

To: <sip:SIP设备编码@源域名>

Call-ID:[email protected]

CSeq:2 Register

Contact: <sip:SIP设备编码@源IP地址端口>

Authorization: Digest username=”64010000002020000001”,realm=”64010000”, nonce=”6fe9ba44a76be22a”,uri=”sip:[email protected]:5060”,response=”9625d92d1bddea7a911926e0db054968”,algorithm=”MD5”

Max-Forwords:70

Expires: 7200

Content-Length: 0

SIP/2.0 200 OK

To: <sip:SIP设备编码@源域名>;tag=69113a2a

Contact: sip:SIP设备编码@源IP地址端口

Content-Length: 0

CSeq:2 Register

Call-ID:[email protected]

From:<sip:SIP设备编码@源域名>;tag=185328220

Via:SIP/2.0/UDP 源域名或者IP地址端口

Date:2010-11-02T15:01:26.115

Expires: 7200

猜你喜欢

转载自www.cnblogs.com/dpf-10/p/8915796.html
sip