SIP常用消息实例参考 4、SUBSCRIBE消息

4、SUBSCRIBE消息
 
     1)头字段填写说明
      Call-id:                 必选
      CSeq:                   必选
      From:                    必选
      To:                        必选
      Max-Forwards: 必选
      Via:                       必选
      Expires:                常用可选头
      2)消息实例
      请求端(192.168.2.161)给服务器端(192.168.2.89)发送SUBSCRIBE消息,参考消息如下:
SUBSCRIBE sip: 01062237498 @192 . 168.2 . 89 : 5060  SIP / 2.0
Via: SIP
/ 2.0 / UDP  192.168 . 2.161 : 32092 ;branch = z9hG4bK - d87543 - ec03ee3e022acf28 - 1 -- d87543-;rport
Max - Forwards:  70
Contact: 
< sip: 01062237498 @192 . 168.2 . 161 : 32092 >
To : " 01062237498 " < sip: 01062237498 @192 . 168.2 . 89 : 5060 >
From : " 01062237498 " < sip: 01062237498 @192 . 168.2 . 89 : 5060 > ;tag = e01c2548
Call
- ID: NDQzMGE1MDMzYWU0NjRiYzMxMGY3NGUxMjBhMjBkNTQ.
CSeq: 
1  SUBSCRIBE
Expires: 
300
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
User - Agent: eyeBeam release 1011d stamp  40820
Event: message
- summary
Content
- Length:  0
      服务器端(192.168.2.89)发送回执的200 OK信息,参考消息如下:
SIP / 2.0   200  OK
Via: SIP
/ 2.0 / UDP  192.168 . 2.161 : 32092 ;branch = z9hG4bK - d87543 - ec03ee3e022acf28 - 1 -- d87543-;rport
From : " 01062237498 " < sip: 01062237498 @192 . 168.2 . 89 : 5060 > ;tag = e01c2548
To : " 01062237498 " < sip: 01062237498 @192 . 168.2 . 89 : 5060 >
Call
- ID: NDQzMGE1MDMzYWU0NjRiYzMxMGY3NGUxMjBhMjBkNTQ.
CSeq: 
1  SUBSCRIBE
Content
- Length:  0

你可能感兴趣的:(SIP协议)