1.1. Overview
The module contains record routing logic 1.2. Dialog support
OpenSIPS is basically only a transaction statefull proxy, without any dialog support build in. There are many features/services which actually requires a dialog awareness, like storing the information in the dialog creation stage, information which will be used during the whole dialog existence.
The most urging example is NAT traversal, in dealing with the within the dialog INVITEs (re-INVITEs). When processing the initial INVITE, the proxy detects if the caller or callee is behind some NAT and fixes the signalling and media parts - since not all the detection mechanism are available for within the dialog requests (like usrloc), to be able to fix correspondingly the sequential requests, the proxy must remember that the original request was NAT processed. There are many other cases where dialog awareness fixes or helps.
The solution is to store additional dialog-related information in the routing set (Record-Route/Route headers), headers which show up in all sequential requests. So any information added to the Record-Route header will be found (with no direction dependencies) in Route header (corresponding to the proxy address).
As storage container, the parameters of the Record-Route / Route header will be used - Record-Route parameters mirroring are reinforced by RFC 3261 (see 12.1.1 UAS behavior).
For this purpose, the modules offers the following functions: add_rr_param() - see Section 1.5.4, “ add_rr_param(param) ” check_route_param() - see Section 1.5.5, “ check_route_param(re) ” Example 1.1. Dialog support in RR module
UAC OpenSIPS PROXY UAS
---- INVITE ------> record_route() ----- INVITE ----> add_rr_param(\
--- reINVITE -----> loose_route() ---- reINVITE --->
check_route_param(\
<-- reINVITE ------ loose_route() <--- reINVITE ----
check_route_param(\
<------ BYE ------- loose_route() <----- BYE ------- check_route_param(\
1.3. Dependencies 1.3.1. OpenSIPS Modules
The following modules must be loaded before this module: No dependencies on other OpenSIPS modules. 1.3.2. External Libraries or Applications
The following libraries or applications must be installed before running OpenSIPS with this module loaded: None.
1.4. Exported Parameters 1.4.1. enable_full_lr (integer)
If set to 1 then “;lr=on” instead of just “;lr” will be used. This is to overcome problems with broken UAs which strip “;lr” parameter when generating Route header fields from Record-Route (“;lr=on” seems to help).
Default value is 0 (no).
Example 1.2. Set enable_full_lr parameter ...
modparam(\...
1.4.2. append_fromtag (integer)
If turned on, request's from-tag is appended to record-route; that's useful for understanding whether subsequent requests (such as BYE) come from caller
(route's from-tag==BYE's from-tag) or callee (route's
from-tag==BYE's to-tag) Default value is 1 (yes).
Example 1.3. Set append_fromtag parameter ...
modparam(\...
1.4.3. enable_double_rr (integer)
There are some situations when the server needs to insert two Record-Route header fields instead of one. For example when using two
disconnected networks or doing cross-protocol forwarding from UDP->TCP. This parameter enables inserting of 2 Record-Routes. The server will later remove both of them. Default value is 1 (yes).
Example 1.4. Set enable_double_rr parameter ...
modparam(\...
1.4.4. add_username (integer)
If set to a non 0 value (which means yes), the username part will be also added in the Record-Route URI. Default value is 0 (no).
Example 1.5. Set add_username parameter ...
modparam(\...
1.5. Exported Functions