| SIP的消息定义完全基于文本的格式。分为消息头和消息体,其主要有如下几个字段。 |
注册的头地址。如果是第一次注册,则与目的地址相同。 |
所有的来自一个客户机的注册都是用相同的Call-ID |
以相同Call-Id的注册必须拥有递增的Cseq号。 |
| INVITE方法说明一个用户或业务参加一个会话。消息体部分包含了被叫的信息说明。对于双方呼叫,主叫需说明他能接受和发送的媒质类型。示例如下: |
| INVITE sip:UserB@there.com SIP/2.0 |
| Via: SIP/2.0/UDP here.com:5060 |
| Call-ID: 12345600@here.com |
| Content-Type: application/sdp |
| o=UserA 2890844526 2890844526 IN IP4 here.com |
| ACK方法主要用于确认客户端对INVITE方法的请求已经响应。示例如下: |
| ACK sip:UserB@there.com SIP/2.0 |
| Via: SIP/2.0/UDP ss1.wcom.com:5060;branch=2d4790.1 |
| Via: SIP/2.0/UDP here.com:5060 |
| To: LittleGuy ;tag=314159 |
| Call-ID: 12345601@here.com |
| 客户机用BYE方法向服务器发消息来结束该呼叫。示例如下: |
| BYE sip: UserA@here.com SIP/2.0 |
| Via: SIP/2.0/UDP there.com:5060 |
| From: LittleGuy ;tag=314159 |
| Call-ID: 12345601@here.com |
| CANCEL方法用于取消一个挂起的呼叫。示例如下: |
| CANCEL sip:UserB@there.com SIP/2.0 |
| Via: SIP/2.0/UDP here.com:5060 |
| Call-ID: 12345600@here.com |
|