大家先来看下Request-URI的定义:
The Request-URI is a special form of SIP URI and indicates the resource to which the request is being sent, also known as the request target. SIP URIs are discussed in more detail in Section 4.2.
同样<RFC3261>里如下一句话导出了Request-URI的本质,那就是只有处理request的UAS对应的URI才是Request-URI:
the Request-URI identifies the UAS that is to process the request.
如下有更详细地描述:
The next header fields are the To and From header fields, which show the
originator and destination of the SIP request. SIP requests are routed based on
the Request-URI instead of the To URI. This is because the Request-URI can be
changed and rewritten as a request is forwarded, while the To URI generally stays
the same. When a name label is used, as in this example, the SIP URI is enclosed
in brackets <>. The name label could be displayed during alerting, for example,
but is not used by the protocol。
-----SIP Request是基于Request-URI而非To URI来路由的.
因为在request转发的时候可以改写Request-URI,而To URI通常保持不变。
那为什么To会保持不变呢?
因为这个To是站在最初那个请求者的角度的To,3261是这样描述的:
The To header field identifies the original recipient of the request designated by
the user identified in the From field. The original recipient may or may not be
the UAS processing the request, due to call forwarding or other proxy operations.
(From filed所标识的用户所指定的原始接收者就是To. 而这个原始接收者并不一定是最终
处理请求的UAS, 因为可能存在呼叫转移或其他代理操作).