RFC3261: SIP:19.1.4 URI 比较

19.1.4 URI Comparison
19.1.4 URI 比较

   Some operations in this specification require determining whether two SIP or SIPS URIs are equivalent.  In this specification, registrars need to compare bindings in Contact URIs in REGISTER requests (see Section 10.3.).  SIP and SIPS URIs are compared for equality according to the following rules:

?本规范中的一些操作需要确定两个SIP URI还是SIPS URI是等效的。在本规范中,注册器需要比较REGISTER请求中的Contact URI中的绑定(请参阅第10.3节)。根据以下规则比较SIP和SIPS URI的相等性:

      o  A SIP and SIPS URI are never equivalent.

o SIP和SIPS URI从来都不是等效的。

      o  Comparison of the userinfo of SIP and SIPS URIs is case-sensitive.  This includes userinfo containing passwords or formatted as telephone-subscribers.  Comparison of all other components of the URI is case-insensitive unless explicitly defined otherwise.

o SIP和SIPS URI的用户信息比较区分大小写。这包括包含密码或格式化为电话用户的用户信息。除非另有明确定义,否则URI的所有其他组件的比较不区分大小写。

      o  The ordering of parameters and header fields is not significant in comparing SIP and SIPS URIs.

o在比较SIP和SIPS URI时,参数和报头字段的顺序并不重要。

      o  Characters other than those in the "reserved" set (see RFC 2396 [5]) are equivalent to their ""%" HEX HEX" encoding.

?o除“保留”集中的字符(见RFC 2396[5])外,其他字符等效于其“%”HEX HEX“编码。

      o  An IP address that is the result of a DNS lookup of a host name does not match that host name.

o作为主机名DNS查找结果的IP地址与该主机名不匹配。

      o  For two URIs to be equal, the user, password, host, and port components must match.

o要使两个URI相等,用户、密码、主机和端口组件必须匹配。

         A URI omitting the user component will not match a URI that includes one.  A URI omitting the password component will not match a URI that includes one.

省略用户组件的URI与包含用户组件的URL不匹配。省略密码组件的URI与包含密码组件的URL不匹配。

         A URI omitting any component with a default value will not match a URI explicitly containing that component with its default value.  For instance, a URI omitting the optional port component will not match a URI explicitly declaring port 5060. The same is true for the transport-parameter, ttl-parameter, user-parameter, and method components.

省略任何具有默认值的组件的URI将与显式包含该组件的URI及其默认值不匹配。例如,省略可选端口组件的URI将与显式声明端口5060的URI不匹配。传输参数、ttl参数、用户参数和方法组件也是如此。

            Defining sip:user@host to not be equivalent to sip:user@host:5060 is a change from RFC 2543.  When deriving addresses from URIs, equivalent addresses are expected from equivalent URIs.  The URI sip:user@host:5060 will always resolve to port 5060.  The URI sip:user@host may resolve to other ports through the DNS SRV mechanisms detailed in [4].

?定义sip:user@host不等同于sip:user@host:5060是对RFC 2543的更改。从URI派生地址时,需要从等效URI派生等效地址。URI sip:user@host:5060将始终解析到端口5060。URI sip:user@host可以通过[4]中详细介绍的DNS SRV机制解析到其他端口。

      o  URI uri-parameter components are compared as follows:

o URI URI参数组件的比较如下:

         -  Any uri-parameter appearing in both URIs must match.

-出现在两个uri中的任何uri参数都必须匹配。

         -  A user, ttl, or method uri-parameter appearing in only one URI never matches, even if it contains the default value.

-只出现在一个uri中的用户、ttl或方法uri参数永远不会匹配,即使它包含默认值。

         -  A URI that includes an maddr parameter will not match a URI that contains no maddr parameter.

-包含maddr参数的URI将与不包含madder参数的URI不匹配。

         -  All other uri-parameters appearing in only one URI are ignored when comparing the URIs.

-在比较uri时,将忽略仅出现在一个uri中的所有其他uri参数。

      o  URI header components are never ignored.  Any present header component MUST be present in both URIs and match for the URIs to match.  The matching rules are defined for each header field in Section 20.

?o URI报头组件永远不会被忽略。任何现有的报头组件都必须存在于两个URI中,并且匹配才能使URI匹配。在第20节中为每个报头字段定义了匹配规则。

   The URIs within each of the following sets are equivalent:

以下每个集合中的URI是等效的:

   sip:%[email protected];transport=TCP
   sip:[email protected];Transport=tcp

   sip:[email protected]
   sip:[email protected];newparam=5
   sip:[email protected];security=on

   sip:biloxi.com;transport=tcp;method=REGISTER?to=sip:bob%40biloxi.com
   sip:biloxi.com;method=REGISTER;transport=tcp?to=sip:bob%40biloxi.com

   sip:[email protected]?subject=project%20x&priority=urgent
   sip:[email protected]?priority=urgent&subject=project%20x

   The URIs within each of the following sets are not equivalent:

以下每个集合中的URI都不等效:

   SIP:[email protected];Transport=udp             (different usernames)
   sip:[email protected];Transport=UDP

   sip:[email protected]                   (can resolve to different ports)
   sip:[email protected]:5060

   sip:[email protected]              (can resolve to different transports)
   sip:[email protected];transport=udp

   sip:[email protected]     (can resolve to different port and transports)
   sip:[email protected]:6000;transport=tcp

   sip:[email protected]                    (different header component)
   sip:[email protected]?Subject=next%20meeting

   sip:[email protected]   (even though that's what
   sip:[email protected]                 phone21.boxesbybob.com resolves to)

   Note that equality is not transitive:

请注意,相等是不可传递的:

      o  sip:[email protected] and sip:[email protected];security=on are equivalent

o sip:[email protected]和sip:[email protected];security=on是等效的

      o  sip:[email protected] and sip:[email protected];security=off are equivalent

osip:[email protected]和sip:[email protected];security=off是等效的

      o  sip:[email protected];security=on and
         sip:[email protected];security=off are not equivalent

o sip:[email protected];security=on和
sip:[email protected];security=off不等价