RFC3261: SIP:19.3标签

19.3 Tags
19.3标签

   The "tag" parameter is used in the To and From header fields of SIP messages.  It serves as a general mechanism to identify a dialog, which is the combination of the Call-ID along with two tags, one from each participant in the dialog.  When a UA sends a request outside of a dialog, it contains a From tag only, providing "half" of the dialog ID.  The dialog is completed from the response(s), each of which contributes the second half in the To header field.  The forking of SIP requests means that multiple dialogs can be established from a single request.  This also explains the need for the two-sided dialog identifier; without a contribution from the recipients, the originator could not disambiguate the multiple dialogs established from a single request.

“tag”参数用于SIP消息的To和From报头字段。它是一种识别对话的通用机制,它是呼叫ID和两个标签的组合,对话中的每个参与者都有一个标签。当UA在对话之外发送请求时,它只包含一个From标记,提供对话ID的“一半”。对话由响应完成,每个响应在To报头字段中提供后半部分。SIP请求的分叉意味着可以从一个请求建立多个对话。这也解释了对双侧对话标识符的需要;如果没有接收方的贡献,发起方就无法消除由单个请求建立的多个对话的歧义。

   When a tag is generated by a UA for insertion into a request or response, it MUST be globally unique and cryptographically random with at least 32 bits of randomness.  A property of this selection requirement is that a UA will place a different tag into the From header of an INVITE than it would place into the To header of the response to the same INVITE.  This is needed in order for a UA to invite itself to a session, a common case for "hairpinning" of calls in PSTN gateways.  Similarly, two INVITEs for different calls will have different From tags, and two responses for different calls will have different To tags.

当UA生成用于插入请求或响应的标签时,它必须是全局唯一的,并且在密码上是随机的,具有至少32位的随机性。该选择要求的一个特性是UA将不同的标签放置到INVITE的From报头中,而不是放置到对同一INVITE响应的To报头中。这是UA邀请自己参加会话所必需的,这是PSTN网关中呼叫“固定”的常见情况。类似地,用于不同调用的两个INVITE将具有不同的From标记,用于不同呼叫的两个响应具有不同的To标记。

   Besides the requirement for global uniqueness, the algorithm for generating a tag is implementation-specific.  Tags are helpful in fault tolerant systems, where a dialog is to be recovered on an alternate server after a failure.  A UAS can select the tag in such a way that a backup can recognize a request as part of a dialog on the failed server, and therefore determine that it should attempt to recover the dialog and any other state associated with it.

除了对全局唯一性的要求外,生成标签的算法是特定于实现的。标签在容错系统中很有帮助,在容错系统中将在发生故障后在备用服务器上恢复对话。UAS可以这样选择标记,即备份可以将请求识别为故障服务器上对话的一部分,从而确定它应该尝试恢复对话以及与之相关的任何其他状态。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值