RFC3261: SIP:19.1.2 字符转义要求

19.1.2 Character Escaping Requirements
19.1.2 字符转义要求

                                                       dialog
                                          reg./redir. Contact/
              default  Req.-URI  To  From  Contact   R-R/Route  external
user          --          o      o    o       o          o         o
password      --          o      o    o       o          o         o
host          --          m      m    m       m          m         m
port          (1)         o      -    -       o          o         o
user-param    ip          o      o    o       o          o         o
method        INVITE      -      -    -       -          -         o
maddr-param   --          o      -    -       o          o         o
ttl-param     1           o      -    -       o          -         o
transp.-param (2)         o      -    -       o          o         o
lr-param      --          o      -    -       -          o         o
other-param   --          o      o    o       o          o         o
headers       --          -      -    -       o          -         o

   (1): The default port value is transport and scheme dependent.  The default  is  5060  for  sip: using UDP, TCP, or SCTP.  The default is 5061 for sip: using TLS over TCP and sips: over TCP.

(1) :默认端口值取决于传输和方案。sip的默认值为5060:使用UDP、TCP或SCTP。sip:使用TLS over TCP和sip:over TCP的默认值为5061。

   (2): The default transport is scheme dependent.  For sip:, it is UDP. For sips:, it is TCP.

(2) :默认传输取决于方案。对于sip:,它是UDP。对于sips:,它是TCP。

   Table 1: Use and default values of URI components for SIP header field values, Request-URI and references SIP follows the requirements and guidelines of RFC 2396 [5] when defining the set of characters that must be escaped in a SIP URI, and uses its ""%" HEX HEX" mechanism for escaping.  From RFC 2396 [5]:

​表1:SIP报头字段值、请求URI和引用的URI组件的使用和默认值SIP在定义SIP URI中必须转义的字符集时遵循RFC 2396[5]的要求和指南,并使用其“%”HEX HEX“机制进行转义。根据RFC 2396[5]:

      The set of characters actually reserved within any given URI component is defined by that component.  In general, a character is reserved if the semantics of the URI changes if the character is replaced with its escaped US-ASCII encoding [5].  Excluded US-ASCII characters (RFC 2396 [5]), such as space and control characters and characters used as URI delimiters, also MUST be escaped.  URIs MUST NOT contain unescaped space and control characters.

​在任何给定的URI组件中实际保留的字符集都是由该组件定义的。通常,如果URI的语义发生变化,如果字符被其转义的US-ASCII编码取代,则该字符将被保留[5]。排除的US-ASCII字符(RFC 2396[5]),如空格和控制字符以及用作URI分隔符的字符,也必须转义。URI中不得包含未转义的空格和控制字符。

   For each component, the set of valid BNF expansions defines exactly which characters may appear unescaped.  All other characters MUST be escaped.

对于每个组件,一组有效的BNF展开式准确地定义了哪些字符可能未显示。所有其他字符都必须转义。

   For example, "@" is not in the set of characters in the user component, so the user "j@s0n" must have at least the @ sign encoded, as in "j%40s0n".

例如,“@”不在用户组件中的字符集中,因此用户“j@s0n”必须至少编码@符号,如“j%40s0n”中所示。

   Expanding the hname and hvalue tokens in Section 25 show that all URI reserved characters in header field names and values MUST be escaped.

​在第25节中扩展hname和hvalue标记显示,报头字段名称和值中的所有URI保留字符都必须转义。

   The telephone-subscriber subset of the user component has special escaping considerations.  The set of characters not reserved in the RFC 2806 [9] description of telephone-subscriber contains a number of characters in various syntax elements that need to be escaped when used in SIP URIs.  Any characters occurring in a telephone-subscriber that do not appear in an expansion of the BNF for the user rule MUST be escaped.

​用户组件的电话用户子集具有特殊的转义注意事项。在电话用户的RFC 2806[9]描述中未保留的字符集包含在SIP URI中使用时需要转义的各种语法元素中的许多字符。电话用户中出现的任何未出现在用户规则的BNF扩展中的字符都必须转义。

   Note that character escaping is not allowed in the host component of a SIP or SIPS URI (the % character is not valid in its expansion). This is likely to change in the future as requirements for Internationalized Domain Names are finalized.  Current implementations MUST NOT attempt to improve robustness by treating received escaped characters in the host component as literally equivalent to their unescaped counterpart.  The behavior required to meet the requirements of IDN may be significantly different.

请注意,在SIP或SIPS URI的主机组件中不允许使用字符转义(%字符在其扩展中无效)。随着国际化域名要求的最终确定,这种情况可能会在未来发生变化。当前的实现决不能试图通过将主机组件中接收到的转义字符视为其未转义的对应字符来提高健壮性。满足IDN要求所需的行为可能明显不同。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值