Chinaunix首页 | 论坛 | 博客
  • 博客访问: 161811
  • 博文数量: 24
  • 博客积分: 2019
  • 博客等级: 大尉
  • 技术积分: 352
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-22 17:36
文章分类
文章存档

2011年(2)

2010年(22)

我的朋友

分类: 网络与安全

2010-04-12 15:56:51

SIP Notes: To/Request-URI and Route/Record-Route

  1. To and Request-URI
    1. To
      1. The To header field first and foremost specifies the desired "logical" recipient of the request, or the address-of-record of the user or resource that is the target of this request. This may or may not be the ultimate recipient of the request. The To header field MAY contain a SIP or SIPS URI, but it may also make use of other URI schemes(the tel URL, for example) when appropriate. All SIP implementations MUST support the SIP URI scheme. Any implementation that supports TLS MUST support the SIPS URI scheme. The To header field allows for a display name.  (RFC3261 P36)
      2. Usually the user will suggest the To header field through a human interface, perhaps inputting the URI manually or selecting it from some sort of address book. Frequently, the user will not enter a complete URI, but rather a string of digits or letters(for example, "bob"). It is at the descretion of the UA to choose how to interpret this input. Using the string to form the user part of a SIP URI implies that the UA wishes ther name to be resolved in the domain to the right-hand side(RHS) of the at-sign in the SIP URI(for instance, sip:bog@example.com). The RHS will frequently be the home domain of the requestor, which allows for the home domain to process the outgoing request. This is useful for features like "speed dial" that require interpretation of the user part in the home domain. (RFC3261 P36)
      3. The To header field specifies the logical recipient of the request. The optional "display-name" is meant to be rendered by a human-user interface. The "tag" parameter serves as a gerneral mechanism for dialog identification. 
    2. Request-URI
      1. Request-URI
        1. (RFC3261 P35)The initial Request-URI of the message SHOULD be set to the value of the URI in the To field.One notable exception is the REGISTER method; behavior for setting the Request-URI of REGISTER is:
          1. (RFC3261 P57)the Request-URI names the domain of the location service for which the registration is meant (for example, "sip:chicago.com"). The "userinfo" and "@" components of the SIP URI MUST NOT be present
          2. (RFC3261 P35) In some special circumstances, the presence of a pre-existing route set can affect the Request-URI of the message. A pre-existing route set is an ordered set of URIs that identify a chain of servers, to which a UAC will send outgoing requests that are outside of a dialog. Commonly, the are configured on the UA by a user or service provider manually, or through some other non-SIP mechanism. When a provider wishes to configure a UA with an outbound proxy, it is RECOMMENDED that this be done by providing it with a pre-existing route set with a single URI, that of the outbound proxy.  When a pre-existing route set is present, the procedures for populating the Request-URI and Route header field is:
            1. (RFC3261 P74)The UAC uses the remote target and route set to build the Request-URI and Route header field of the request.
            2. (RFC3261 P74)If the route set is empty, the UAC MUST place the remote target URI into the Request-URI. The UAC MUST NOT add a Route header field to the reuqest.
            3. (RFC3261 P74)If the route set is not empty, and the first URI in the route set contains the lr parameter, the UAC MUST place the remote target URI into the Request-URI and MUST include a Route header field containing the route set values in order, including all parameters.
            4. (RFC3261 P74)If the route set is not empty, and its first URI does not contain the lr parameter, the UAC MUST place the first URI from the route set into the Request-URI, stripping any parameters that are not allowed in a Request-URI. The UAC MUST add a Route header field containing the remainder of the route set values in order, including all parameters. The UAC MUST then place the remote target URI into Route header field as the last value. 
    3. The To field is never used for routing - Request-URI is used for this purpose.
  2. Record-Route/Route
    1. Record-Route
      1. The Record-Route header field is inserted by proxies in a request to force future requests in the dialog to be routed through the proxy.
    2. Route
      1. The Route header field is used to force routing for a request through the listed set of proxies.
    3. SIP Routing
      1. The proxy is used for routing messages within a SIP network. The following items only work for stateful proxy.
      2. Loose Routing
        1. The lr parameter indicates that loose routing is being used. When loose routing is being used, the request-URI remains constant(instead of changing for each hop). The TO and FROM headers never change either, regardless of the routing method used. The two headers are never used for routing in the SIP network. 
        2. The VIA header is appended by each proxy as the message is routed through the network. The purpose of the VIA header is loop detection. If a proxy finds its own address in the VIA header, it then knows that this message has already been processed, and the message is looping around the network. Stric routing uses additional headers for recording a route(record-route).
        3. Routing responsibility for the message is left to each proxy along the route. Any single router is only responsible, however, for its leg of the path, and not end-to-end routing.
      3. Strict Routing
        1. Strict routing relies on a route list for each subscriber. The route list is created during registration. As the REGISTER message is routed through the network, each proxy will append the message with its own address using the RECORD-ROUTE header. The headers are added to the message in order so that the path can be established.
        2. The route recorded when registering a location is stored at the registar and becomes a part of the subsciber's registration record. This route list is then shared with any stateful proxy. The route is shared though the use of ROUTE headers in the messages. The ROUTE messages are added to each request either by the UAC or by a stateful proxy. 
        3. For example, some stateful proxies/UAS might save the RECORD-ROUTE headers as a route list for the subscriber for the duration of the session. When the UAC has received all of the responses for a request, it then converts the RECORD-ROUTE headers into a ROUTE header(or headers) for subsequent requests. For example, the ACK would use ROUTE header. 
      4. When routing a SIP request, the request-URI will identify the next hop in the network, employing the route list established for a particular subscriber. It should be noted that the TO and FROM headers are never used for routing purposes. In fact, the network ignores these headers completely. The are only for the consumption by applications and use displays(such as calling name dispalys).
 
阅读(3304) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~