12.1.1 UAS behavior 12.1.1UAS的行为 When a UAS responds to a request with a response that establishes a dialog (such as a 2xx to INVITE), the UAS MUST copy all Record-Route header field values from the request into the response (including the URIs, URI parameters, and any Record-Route header field parameters, whether they are known or unknown to the UAS) and MUST maintain the order of those values. The UAS MUST add a Contact header field to the response. The Contact header field contains an address where the UAS would like to be contacted for subsequent requests in the dialog (which includes the ACK for a 2xx response in the case of an INVITE). Generally, the host portion of this URI is the IP address or FQDN of the host. The URI provided in the Contact header field MUST be a SIP or SIPS URI. If the request that initiated the dialog contained a SIPS URI in the Request-URI or in the top Record-Route header field value, if there was any, or the Contact header field if there was no Record-Route header field, the Contact header field in the response MUST be a SIPS URI. The URI SHOULD have global scope (that is, the same URI can be used in messages outside this dialog). The same way, the scope of the URI in the Contact header field of the INVITE is not limited to this dialog either. It can therefore be used in messages to the UAC even outside this dialog. 当UAS用建立对话的响应(如2xx to INVITE)响应请求时,UAS必须将请求中的所有记录路由报头字段值复制到响应中(包括URI、URI参数和任何记录路由报头域参数,无论它们是UAS已知的还是未知的),并且必须保持这些值的顺序。UAS必须在响应中添加一个Contact报头字段。Contact报头字段包含UAS希望在对话中进行后续请求时联系的地址(在INVITE的情况下,包括2xx响应的ACK)。通常,此URI的主机部分是主机的IP地址或FQDN。在Contact报头字段中提供的URI必须是SIP或SIPS URI。如果启动对话的请求在请求URI或顶部记录路由报头字段值(如果有)中包含SIPS URI,或在联系人报头字段(如果没有记录路由报头域)中包含SIP URI,则响应中的联系人报头字段必须是SIPS URI。URI应该具有全局作用域(也就是说,在该对话之外的消息中可以使用相同的URI)。同样,INVITE的Contact报头字段中的URI范围也不限于此对话。因此,即使在该对话之外,它也可以用于给UAC的消息中。 The UAS then constructs the state of the dialog. This state MUST be maintained for the duration of the dialog. 然后UAS构建对话的状态。此状态必须在对话期间保持。 If the request arrived over TLS, and the Request-URI contained a SIPS URI, the "secure" flag is set to TRUE. 如果请求通过TLS到达,并且请求URI包含SIPS URI,则“安全”标志设置为TRUE。 The route set MUST be set to the list of URIs in the Record-Route header field from the request, taken in order and preserving all URI parameters. If no Record-Route header field is present in the request, the route set MUST be set to the empty set. This route set, even if empty, overrides any pre-existing route set for future requests in this dialog. The remote target MUST be set to the URI from the Contact header field of the request. 路由集必须设置为请求的记录路由报头字段中的URI列表,按顺序排列并保留所有URI参数。如果请求中没有记录路由报头字段,则路由集必须设置为空集。此路由集,即使为空,也会覆盖此对话中未来请求的任何预先存在的路由集。远程目标必须设置为请求的Contact报头字段中的URI。 The remote sequence number MUST be set to the value of the sequence number in the CSeq header field of the request. The local sequence number MUST be empty. The call identifier component of the dialog ID MUST be set to the value of the Call-ID in the request. The local tag component of the dialog ID MUST be set to the tag in the To field in the response to the request (which always includes a tag), and the remote tag component of the dialog ID MUST be set to the tag from the From field in the request. A UAS MUST be prepared to receive a request without a tag in the From field, in which case the tag is considered to have a value of null. 远程序列号必须设置为请求的CSeq报头字段中的序列号值。本地序列号必须为空。对话ID的呼叫标识符组件必须设置为请求中呼叫ID的值。对话ID的本地标签组件必须设置为响应请求的“To”字段中的标签(始终包括一个标签),对话ID的远程标签组件必须从请求的“From”字段设置为标签。UAS必须准备好接收“From”字段中没有标记的请求,在这种情况下,标记的值被视为null。 This is to maintain backwards compatibility with RFC 2543, which did not mandate From tags. 这是为了保持与RFC 2543的向后兼容性,RFC 2543没有强制要求From标签。 The remote URI MUST be set to the URI in the From field, and the local URI MUST be set to the URI in the To field.
远程URI必须设置为“From”字段中的URI,本地URI必须设置成“To”字段的URI。