RFC3261: SIP:10.3处理REGISTER请求

10.3 Processing REGISTER Requests
10.3处理REGISTER请求

   A registrar is a UAS that responds to REGISTER requests and maintains a list of bindings that are accessible to proxy servers and redirect servers within its administrative domain.  A registrar handles requests according to Section 8.2 and Section 17.2, but it accepts only REGISTER requests.  A registrar MUST not generate 6xx responses.

​注册器是一个UAS,它响应REGISTER请求并维护其管理域内的代理服务器和重定向服务器可访问的绑定列表。登记员根据第8.2条和第17.2条处理请求,但只接受REGISTER请求。注册商不得生成6xx响应。

   A registrar MAY redirect REGISTER requests as appropriate.  One common usage would be for a registrar listening on a multicast interface to redirect multicast REGISTER requests to its own unicast interface with a 302 (Moved Temporarily) response.

注册员可酌情重定向REGISTER请求。一种常见用法是注册器在多播接口上侦听,以302(临时移动)响应将多播REGISTER请求重定向到其自己的单播接口。

   Registrars MUST ignore the Record-Route header field if it is included in a REGISTER request.  Registrars MUST NOT include a Record-Route header field in any response to a REGISTER request.

如果记录路由报头字段包含在REGISTER请求中,则注册器必须忽略该字段。注册器不得在对REGISTER请求的任何响应中包含Record-Route报头字段。

      A registrar might receive a request that traversed a proxy which treats REGISTER as an unknown request and which added a Record-Route header field value.

注册器可能会收到一个遍历代理的请求,该代理将REGISTER视为未知请求,并添加了Record-Route报头字段值。

   A registrar has to know (for example, through configuration) the set of domain(s) for which it maintains bindings.  REGISTER requests MUST be processed by a registrar in the order that they are received. REGISTER requests MUST also be processed atomically, meaning that a particular REGISTER request is either processed completely or not at all.  Each REGISTER message MUST be processed independently of any other registration or binding changes.

注册器必须知道(例如,通过配置)为其维护绑定的域集。REGISTER请求必须由注册器按照收到的顺序进行处理。REGISTER请求也必须以原子方式处理,这意味着特定的REGISTER申请要么被完全处理,要么根本不被处理。每个REGISTER消息必须独立于任何其他注册或绑定更改进行处理。

   When receiving a REGISTER request, a registrar follows these steps:

当收到REGISTER请求时,注册器会执行以下步骤:

      1. The registrar inspects the Request-URI to determine whether it has access to bindings for the domain identified in the Request-URI.  If not, and if the server also acts as a proxy server, the server SHOULD forward the request to the addressed domain, following the general behavior for proxying messages described in Section 16.

​1.注册器检查请求URI以确定其是否有权访问在请求URI中标识的域的绑定。如果不是,并且服务器也充当代理服务器,则服务器应按照第16节中描述的代理消息的一般行为,将请求转发到寻址域。

      2. To guarantee that the registrar supports any necessary extensions, the registrar MUST process the Require header field values as described for UASs in Section 8.2.2.

​2.为了保证注册器支持任何必要的扩展,注册器必须按照第8.2.2节中对UAS的描述处理Require报头字段值。

      3. A registrar SHOULD authenticate the UAC.  Mechanisms for the authentication of SIP user agents are described in Section 22. Registration behavior in no way overrides the generic authentication framework for SIP.  If no authentication mechanism is available, the registrar MAY take the From address as the asserted identity of the originator of the request.

​3.注册器应验证UAC。第22节描述了SIP用户代理的认证机制。注册行为决不会覆盖SIP的通用身份验证框架。如果没有可用的身份验证机制,注册器可以将From地址作为请求发起人的断言身份。

      4. The registrar SHOULD determine if the authenticated user is authorized to modify registrations for this address-of-record. For example, a registrar might consult an authorization database that maps user names to a list of addresses-of-record for which that user has authorization to modify bindings.  If the authenticated user is not authorized to modify bindings, the registrar MUST return a 403 (Forbidden) and skip the remaining steps.

4.注册器应确定经过身份验证的用户是否有权修改该记录地址的注册。例如,注册器可能会查阅授权数据库,该数据库将用户名映射到该用户有权修改绑定的记录地址列表。如果经过身份验证的用户没有被授权修改绑定,则注册器必须返回403(Forbidden)并跳过其余步骤。

         In architectures that support third-party registration, one entity may be responsible for updating the registrations associated with multiple addresses-of-record.

在支持第三方注册的体系结构中,一个实体可能负责更新与多个记录地址相关联的注册。

      5. The registrar extracts the address-of-record from the To header field of the request.  If the address-of-record is not valid for the domain in the Request-URI, the registrar MUST send a 404 (Not Found) response and skip the remaining steps.  The URI MUST then be converted to a canonical form.  To do that, all URI parameters MUST be removed (including the user-param), and any escaped characters MUST be converted to their unescaped form.  The result serves as an index into the list of bindings.

5.注册器从请求的To报头字段中提取记录的地址。如果记录的地址对请求URI中的域无效,则注册器必须发送404(未找到)响应并跳过其余步骤。然后必须将URI转换为规范形式。为此,必须删除所有URI参数(包括用户参数),并且必须将任何转义字符转换为其未转义的形式。结果用作绑定列表的索引。

      6. The registrar checks whether the request contains the Contact header field.  If not, it skips to the last step.  If the Contact header field is present, the registrar checks if there is one Contact field value that contains the special value "*" and an Expires field.  If the request has additional Contact fields or an expiration time other than zero, the request is invalid, and the server MUST return a 400 (Invalid Request) and skip the remaining steps.  If not, the registrar checks whether the Call-ID agrees with the value stored for each binding.  If not, it MUST remove the binding.  If it does agree, it MUST remove the binding only if the CSeq in the request is higher than the value stored for that binding.  Otherwise, the update MUST be aborted and the request fails.

6.注册器检查请求是否包含Contact报头字段。如果没有,则跳到最后一步。如果存在Contact报头字段,注册器将检查是否有一个Contact字段值包含特殊值“*”和Expires字段。如果请求有其他联系人字段或过期时间不是零,则该请求无效,服务器必须返回400(无效请求)并跳过其余步骤。如果不是,注册器将检查调用ID是否与为每个绑定存储的值一致。如果没有,则必须移除绑定。如果它同意,则只有当请求中的CSeq高于为该绑定存储的值时,它才能删除绑定。否则,更新必须中止,并且请求失败。

      7. The registrar now processes each contact address in the Contact header field in turn.  For each address, it determines the expiration interval as follows:

7.注册器现在依次处理Contact报头字段中的每个联系人地址。对于每个地址,它确定的过期间隔如下:

         -  If the field value has an "expires" parameter, that value MUST be taken as the requested expiration.

-如果字段值具有“expires”参数,则该值必须作为请求的过期时间。

         -  If there is no such parameter, but the request has an Expires header field, that value MUST be taken as the requested expiration.

-如果没有这样的参数,但请求有一个Expires报头字段,则该值必须作为请求的过期时间。

         -  If there is neither, a locally-configured default value MUST be taken as the requested expiration.

-如果两者都不存在,则必须将本地配置的默认值作为请求的过期时间。

         The registrar MAY choose an expiration less than the requested expiration interval.  If and only if the requested expiration interval is greater than zero AND smaller than one hour AND less than a registrar-configured minimum, the registrar MAY reject the registration with a response of 423 (Interval Too Brief).  This response MUST contain a Min-Expires header field that states the minimum expiration interval the registrar is willing to honor.  It then skips the remaining steps.

注册器可以选择一个小于请求的到期时间间隔的到期时间。如果且仅当所请求的到期间隔大于零且小于一小时且小于注册器配置的最小值时,注册器可以用423(间隔太短)的响应来拒绝注册。此响应必须包含一个Min Expires报头字段,该字段说明注册器愿意遵守的最小过期间隔。然后跳过其余步骤。

         Allowing the registrar to set the registration interval protects it against excessively frequent registration refreshes while limiting the state that it needs to maintain and decreasing the likelihood of registrations going stale.  The expiration interval of a registration is frequently used in the creation of services.  An example is a follow-me service, where the user may only be available at a terminal for a brief period.  Therefore, registrars should accept brief registrations; a request should only be rejected if the interval is so short that the refreshes would degrade registrar performance.

允许注册器设置注册间隔可以保护它不受过于频繁的注册刷新的影响,同时限制它需要保持的状态,并降低注册失效的可能性。注册的过期时间间隔经常用于创建服务。一个例子是follow-me服务,其中用户可能仅在终端处短暂可用。因此,注册器应接受简要登记;只有当间隔太短以至于刷新会降低注册器性能时,才应拒绝请求。

         For each address, the registrar then searches the list of current bindings using the URI comparison rules.  If the binding does not exist, it is tentatively added.  If the binding does exist, the registrar checks the Call-ID value.  If the Call-ID value in the existing binding differs from the Call-ID value in the request, the binding MUST be removed if the expiration time is zero and updated otherwise.  If they are the same, the registrar compares the CSeq value.  If the value is higher than that of the existing binding, it MUST update or remove the binding as above.  If not, the update MUST be aborted and the request fails.

对于每个地址,注册器然后使用URI比较规则搜索当前绑定的列表。如果绑定不存在,则会临时添加它。如果绑定确实存在,注册器将检查呼叫ID值。如果现有绑定中的呼叫ID值与请求中的呼叫标识值不同,则如果过期时间为零,则必须删除绑定,否则必须更新绑定。如果它们相同,注册器会比较CSeq值。如果该值高于现有绑定的值,则必须如上所述更新或删除绑定。如果没有,则必须中止更新,并且请求失败。

         This algorithm ensures that out-of-order requests from the same UA are ignored.

该算法确保忽略来自同一UA的无序请求。

         Each binding record records the Call-ID and CSeq values from the request.

每个绑定记录都记录来自请求的调用ID和CSeq值。

         The binding updates MUST be committed (that is, made visible to the proxy or redirect server) if and only if all binding updates and additions succeed.  If any one of them fails (for example, because the back-end database commit failed), the request MUST fail with a 500 (Server Error) response and all tentative binding updates MUST be removed.

当且仅当所有绑定更新和添加都成功时,必须提交绑定更新(即,使其对代理或重定向服务器可见)。如果其中任何一个失败(例如,因为后端数据库提交失败),则请求必须失败并返回500(服务器错误)响应,并且必须删除所有临时绑定更新。

      8. The registrar returns a 200 (OK) response.  The response MUST contain Contact header field values enumerating all current bindings.  Each Contact value MUST feature an "expires" parameter indicating its expiration interval chosen by the registrar.  The response SHOULD include a Date header field.

8.注册器返回200(OK)响应。响应必须包含枚举所有当前绑定的Contact报头字段值。每个Contact值必须具有一个“expires”参数,指示注册器选择的到期间隔。响应应包括日期报头字段。

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值