3.4.5.2 SIP Proxy Operation

If a SIP proxy compliant with this protocol stores any state associated with SIP endpoints, it SHOULD use the value of the GRUU, if one is present in the Contact header field, as an index into its state table. Specifically, the GRUU from the Contact header field of SIP request messages SHOULD be used to identify UAC endpoints, and the GRUU from the Contact header field of SIP response messages SHOULD be used to identify UAS endpoints.

If a SIP proxy compliant with this protocol receives a request outside of the dialog, with no Route header fields, targeted at the URI that belongs to the domain that this proxy is responsible for, and it is supposed to access a SIP location service so that it can compute the request targets, as specified in [RFC3261] section 16, it MUST examine the target URI of the request.

For example, the Request-URI field is examined. If the URI contains a gruu parameter, and thus is a GRUU, and the URI does not refer to any GRUU known in the domain, the proxy rejects the request with a 404 response.

The proxy MUST ignore any records returned by the SIP location service that do not have the same GRUU value when computing request targets.

If the SIP proxy uses any record returned by the SIP location service as a request target, it MUST copy the grid parameter and its value from the original target URI, or GRUU, into the new target URI obtained from the SIP location service record. If the original target URI did not contain a grid parameter or the parameter value was empty, the proxy MUST insert a grid parameter value into the new target URI.

If a SIP proxy compliant with this protocol receives a mid-dialog request with Route header fields and a Request-URI field that belongs to the domain that this proxy is responsible for, and the proxy has access to the SIP location service in the domain, it MUST examine the URI and the Request-URI field. If the URI contains a gruu parameter, which means that it is a GRUU, and the URI does not refer to any GRUU known in the domain, the proxy MUST reject the request with a 404 response.

The proxy MUST contact the SIP location service for the domain for records where the address-of-record in the record matches the address-of-record in the URI and, from the returned set of records, select the records that have the same GRUU value that appears in the Request-URI.

If at least one record is selected:

  • The SIP proxy MUST arbitrarily choose one of the selected records as a new request target. It MUST then copy the grid parameter and its value from the original target URI (GRUU) into the new target. If the original target URI did not contain the grid parameter or the parameter value was empty, the proxy MUST insert a grid parameter value into the new target URI.

  • If there are no Route headers in the request after the proxy removes the topmost Route header pointing to it, as specified in [RFC3261] section 16.4, the proxy MUST copy all routing information from the selected SIP location service record to the Route header of the request.

If no records were selected, the proxy SHOULD reject the request with a 480 Temporarily Unavailable response.