REGISTERsip:ims1.fj.chinamobile.com SIP/2.0
Via: SIP/2.0/UDP192.168.11.60:9137;branch=z9hG4bK0d2ecbdf
From:<sip:+865939008842@ims1.fj.chinamobile.com>;tag=5c154d87
To: <sip:+865939008842@ims1.fj.chinamobile.com>
Contact:<sip:+865939008842@192.168.11.60:9137>
Call-ID: 13798155310002000950b0cd45@192.168.11.60
CSeq: 2REGISTER
Expires: 120
Max-Forwards: 70
Content-Length: 0
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.11.60:9137;branch=z9hG4bK0d2ecbdf
To:<sip:+865939008842@ims1.fj.chinamobile.com>;tag=ztesiphKb92HEV*1-3-16648*bhgg.1
From:<sip:+865939008842@ims1.fj.chinamobile.com>;tag=5c154d87
Call-ID: 13798155310002000950b0cd45@192.168.11.60
CSeq: 2REGISTER
Content-Length: 0
WWW-Authenticate: Digestrealm=*********
REGISTERsip:ims1.fj.chinamobile.com SIP/2.0
Via: SIP/2.0/UDP192.168.11.60:9137;branch=z9hG4bK0d2ecbdf
From:<sip:+865939008842@ims1.fj.chinamobile.com>;tag=5c154d87
To:<sip:+865939008842@ims1.fj.chinamobile.com>
Contact:<sip:+865939008842@192.168.11.60:9137>
Call-ID: 13798155310002000950b0cd45@192.168.11.60
CSeq: 3REGISTER
Authorization: Digestusername=**************
Expires: 120
Max-Forwards: 70
Content-Length: 0
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP192.168.11.60:9137;branch=z9hG4bK0d2ecbdf
To: <sip:+865939008842@ims1.fj.chinamobile.com>;tag=ztesiphKb92HEV*1-3-16648*bhgg.1
From:<sip:+865939008842@ims1.fj.chinamobile.com>;tag=5c154d87
Call-ID: 13798155310002000950b0cd45@192.168.11.60
CSeq: 2REGISTER
Content-Length: 0
WWW-Authenticate: Digest realm=**************
REGISTERsip:ims1.fj.chinamobile.com SIP/2.0
Via: SIP/2.0/UDP192.168.11.60:9137;branch=z9hG4bK0d2ecbdf
From:<sip:+865939008842@ims1.fj.chinamobile.com>;tag=5c154d87
To:<sip:+865939008842@ims1.fj.chinamobile.com>
Contact:<sip:+865939008842@192.168.11.60:9137>
Call-ID: 13798155310002000950b0cd45@192.168.11.60
CSeq: 3REGISTER
Authorization: Digestusername=************
Expires: 120
Max-Forwards: 70
Content-Length: 0
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP192.168.11.60:9137;branch=z9hG4bK0d2ecbdf
To:<sip:+865939008842@ims1.fj.chinamobile.com>;tag=ztesiphKb92HEV*1-3-16648*bhgg.1
From:<sip:+865939008842@ims1.fj.chinamobile.com>;tag=5c154d87
Call-ID: 13798155310002000950b0cd45@192.168.11.60
CSeq: 2REGISTER
Content-Length: 0
WWW-Authenticate: Digestrealm=******************
注册流程图
根据上述消息进行详细分析。
首先,我们关注红色字体,Via头域的最上一个branch参数是以z9hG4bk开头,branch参数在该客户端发出的所有的事务中都是唯一的。因此,我们根据服务端事务匹配请求,以上发送的消息都是同一个事物。
其次,我们关注红色字体,CSeq头域,UAC发送的注册消息中的CSeq序号一直在递增,表示客户端期望处理不同的事物。
再次,我们关注红色字体,CSeq头域,UAC发送的注册消息中的CSeq序号一直在递增,UAS回复401消息中的CSeq序号一直为2,表示UAC发送的事物重复,直接对此消息按照上次处理的结果进行回复。
根据注册消息处理是原子操作,注册完成或是被终止,注册消息流程才算处理完成。
注意 : Call-ID 头域在后面进行介绍,详见注册服务器处理注册请求步骤 7 。