RFC3261: SIP:12.2.2 UAS的行为

本文详细解释了UAS在处理对话请求时的原子性原则,涉及请求的接受与拒绝、状态管理、CSeq序列号处理、对话重启后的对话恢复策略,以及目标刷新请求的处理机制。
摘要由CSDN通过智能技术生成
12.2.2 UAS Behavior
12.2.2 UAS的行为

   Requests sent within a dialog, as any other requests, are atomic.  If a particular request is accepted by the UAS, all the state changes associated with it are performed.  If the request is rejected, none of the state changes are performed.

在对话中发送的请求和任何其他请求一样,都是原子请求。如果UAS接受了特定的请求,则执行与之相关的所有状态更改。如果请求被拒绝,则不会执行任何状态更改。

      Note that some requests, such as INVITEs, affect several pieces of state.

请注意,一些请求(如INVITE)会影响多个状态。

   The UAS will receive the request from the transaction layer.  If the request has a tag in the To header field, the UAS core computes the dialog identifier corresponding to the request and compares it with existing dialogs.  If there is a match, this is a mid-dialog request. In that case, the UAS first applies the same processing rules for requests outside of a dialog, discussed in Section 8.2.

​UAS将接收来自事务层的请求。如果请求的To报头字段中有一个标记,UAS核心将计算与请求相对应的对话标识符,并将其与现有对话进行比较。如果匹配,则这是一个对话中期请求。在这种情况下,UAS首先对对话之外的请求应用相同的处理规则,如第8.2节所述。

   If the request has a tag in the To header field, but the dialog identifier does not match any existing dialogs, the UAS may have crashed and restarted, or it may have received a request for a different (possibly failed) UAS (the UASs can construct the To tags so that a UAS can identify that the tag was for a UAS for which it is providing recovery).  Another possibility is that the incoming request has been simply misrouted.  Based on the To tag, the UAS MAY either accept or reject the request.  Accepting the request for acceptable To tags provides robustness, so that dialogs can persist even through crashes.  UAs wishing to support this capability must take into consideration some issues such as choosing monotonically increasing CSeq sequence numbers even across reboots, reconstructing the route set, and accepting out-of-range RTP timestamps and sequence numbers.

如果请求的To报头字段中有一个标签,但对话标识符与任何现有对话都不匹配,则UAS可能已经崩溃并重新启动,或者它可能收到了对不同(可能失败)UAS的请求(UAS可以构造To标签,以便UAS可以识别该标签是为其提供恢复的UAS的)。另一种可能性是传入的请求只是被错误地路由了。根据To标签,UAS可以接受或拒绝请求。接受对可接受的To标记的请求提供了健壮性,因此对话即使在崩溃时也可以持久存在。希望支持该功能的UA必须考虑一些问题,例如即使在重新启动时也要选择单调增加的CSeq序列号,重建路由集,以及接受超出范围的RTP时间戳和序列号。

   If the UAS wishes to reject the request because it does not wish to recreate the dialog, it MUST respond to the request with a 481 (Call/Transaction Does Not Exist) status code and pass that to the server transaction.

如果UAS因为不希望重新创建对话而希望拒绝请求,则它必须使用481(呼叫/事务不存在)状态代码来响应请求,并将其传递给服务器事务。

   Requests that do not change in any way the state of a dialog may be received within a dialog (for example, an OPTIONS request).  They are processed as if they had been received outside the dialog.

不会以任何方式改变对话状态的请求可以在对话中接收(例如,OPTIONS请求)。它们被处理,就好像它们是在对话之外收到的一样。

   If the remote sequence number is empty, it MUST be set to the value of the sequence number in the CSeq header field value in the request. If the remote sequence number was not empty, but the sequence number of the request is lower than the remote sequence number, the request is out of order and MUST be rejected with a 500 (Server Internal Error) response.  If the remote sequence number was not empty, and the sequence number of the request is greater than the remote sequence number, the request is in order.  It is possible for the CSeq sequence number to be higher than the remote sequence number by more than one.  This is not an error condition, and a UAS SHOULD be prepared to receive and process requests with CSeq values more than one higher than the previous received request.  The UAS MUST then set the remote sequence number to the value of the sequence number in the CSeq header field value in the request.

如果远程序列号为空,则必须将其设置为请求中CSeq报头字段值中的序列号值。如果远程序列号不是空的,但请求的序列号低于远程序列号,则该请求是无序的,必须以500(服务器内部错误)响应拒绝。如果远程序列号不是空的,并且请求的序列号大于远程序列号,则请求是有序的。CSeq序列号可能比远程序列号高一个以上。这不是错误情况,UAS应该准备好接收和处理CSeq值比之前接收的请求高出一个以上的请求。然后,UAS必须将远程序列号设置为请求中CSeq报头字段值中的序列号值。

      If a proxy challenges a request generated by the UAC, the UAC has to resubmit the request with credentials.  The resubmitted request will have a new CSeq number.  The UAS will never see the first request, and thus, it will notice a gap in the CSeq number space. Such a gap does not represent any error condition.

如果代理对UAC生成的请求提出质疑,UAC必须使用凭据重新提交该请求。重新提交的请求将有一个新的CSeq编号。UAS将永远不会看到第一个请求,因此,它将注意到CSeq数字空间中的间隙。这样的间隙并不代表任何误差条件。

   When a UAS receives a target refresh request, it MUST replace the dialog's remote target URI with the URI from the Contact header field in that request, if present.

当UAS收到目标刷新请求时,它必须将对话的远程目标URI替换为该请求中Contact报头字段中的URI(如果存在)。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值