| Class | DialogRoutes |
| In: |
sipper/session_state/dialog_routes.rb
|
| Parent: | Object |
Maintains the route set and remote target for the dialog, also encapsulating the logic for target refresh and strict router manipulation.
| LRREGX | = | /;lr/.freeze |
Returns the Request URI and route header values. [remote_target, [routes]], if there is no route set then an empty array for routes is returned. e.g. [remote_target, [], bool] The last element of the array is a boolean use_ruri which is true of the request uri should be used to determine the destination of the request, otherwise top route header should be used.
RFC 3261 12.2.1.1 The UAC uses the remote target and route set to build the Request-URI and Route header field of the request.
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 request.
If the route set is not empty, and the first URI in the route set contains the lr parameter (see Section 19.1.1), 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.
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 the Route header field as the last value. todo - see what needs to be stripped while placing top route in ruri
This will typically be used for initial request only when the controller changes the route headers or pushes new route headers. Here we completely ignore the @route_set and just go by the route headers. Note that the pre_existing route headers would already have been added to the request when the request was first created.