SIP 取消请求
SIP CANCEL Request
为什么 SIP CANCEL 方法需要与 INVITE 相同的 CSeq 号码和分支 ID。将 CANCEL 与相应的 INVITE 分支 ID 匹配就足够了。由于它是一个长值,因此足以识别交易。那么为什么 CANCEL cseq 具有相同的值?
原因是为了符合之前的规范,即:rfc2543。在这个旧规范中,没有使用分支参数。相反,检查了 rq-uri、to-tag、call-id、cseq 和 top-via。
为了保持与 rfc2543 的兼容性,新规范要求使用以 magic cookie ("z9hG4bK") 开头的分支,但仍需要旧方法。
要匹配 INVITE,CANCEL 应遵循 rfc3261(将请求匹配到服务器事务)
的第 17.2.3 节中定义的规则
If the branch parameter in the top Via header field is not present,
or does not contain the magic cookie, the following procedures are
used. These exist to handle backwards compatibility with RFC 2543
compliant implementations.
The INVITE request matches a transaction if the Request-URI, To tag,
From tag, Call-ID, CSeq, and top Via header field match those of the
INVITE request which created the transaction.
为什么 SIP CANCEL 方法需要与 INVITE 相同的 CSeq 号码和分支 ID。将 CANCEL 与相应的 INVITE 分支 ID 匹配就足够了。由于它是一个长值,因此足以识别交易。那么为什么 CANCEL cseq 具有相同的值?
原因是为了符合之前的规范,即:rfc2543。在这个旧规范中,没有使用分支参数。相反,检查了 rq-uri、to-tag、call-id、cseq 和 top-via。
为了保持与 rfc2543 的兼容性,新规范要求使用以 magic cookie ("z9hG4bK") 开头的分支,但仍需要旧方法。
要匹配 INVITE,CANCEL 应遵循 rfc3261(将请求匹配到服务器事务)
的第 17.2.3 节中定义的规则If the branch parameter in the top Via header field is not present,
or does not contain the magic cookie, the following procedures are
used. These exist to handle backwards compatibility with RFC 2543
compliant implementations.
The INVITE request matches a transaction if the Request-URI, To tag,
From tag, Call-ID, CSeq, and top Via header field match those of the
INVITE request which created the transaction.