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).
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).
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).
If this parameter is set, the loose_route call stores the user part of the route URI in the AVP, which is identified by the parameter value. It can be utilized later in the routing script.
Default value is NULL (do not insert user part into avps).
Example 4. Set user_part_avp
parameter, later use
... modparam("rr", "user_part_avp", "route_user") ... route{ ... if (loose_route()) { t_relay(); } if ($route_user == "my_user") { ... } ... }
If this parameter is set, the loose_route call stores the URI of the next hop in the AVP, which is identified by the parameter value. It can be then utilized in the routing script.
Default value is NULL (do not insert next route into avps).
Example 5. Set next_route_avp
parameter, later use
... modparam("rr", "next_route_avp", "route_next") ... route{ ... loose_route(); if ($route_next=~"101.102.103.1[0-9][0-9]") { t_relay(); }
Secret to distinguish cookies from different servers.
Default value is empty string.
Example 6. Set cookie_secret
parameter, later use
... modparam("rr", "cookie_secret", "bflmpsvz") ...
If set to 1 and two Record-Route headers have been inserted by the proxy before then the outgoing socket is forced by loose_route() to be the address of the second Route header in the in-dialog requests. Useful on multihomed hosts.
Default value is 1 (yes).
The function performs loose routing as defined in RFC3261 and
will set Avp value passed in Route header that were created by record_route
.
If ftag!=tag.from then from/to are flipped.
If there are any Route HFs in the message, the function takes the first one, rewrites Request-URI with it's value and removes the first URI from Route HFs.
The function adds a new Record-Route header field. The header field
will be inserted in the message before any other Record-Route
header fields. Avp marked using setavpflag
, flag dialog_cookie
will be inserted as serialized parameter of record-route header. Note that only user class AVPs should
be passed as cookies, i.e. domain and global should be avoided.
Example 10. record_route
usage
avpflags dialog_cookie; # must be declared when used in script ... setavpflag($cookie, "dialog_cookie"); setavpflag("$f./^dlg_/", "dialog_cookie"); record_route(); ...
This function will put the string into Record-Route, don't use unless you know what you are doing.
Meaning of the parameters is as follows:
string - String to be inserted into the header field.