rr Module

Jan Janak

FhG FOKUS

Edited by

Jan Janak

Bogdan-Andrei Iancu


Table of Contents
1. User's Guide
1.1. Overview
1.2. Dependencies
1.2.1. OpenSER Modules
1.2.2. External Libraries or Applications
1.3. Exported Parameters
1.3.1. enable_full_lr (integer)
1.3.2. append_fromtag (integer)
1.3.3. enable_double_rr (integer)
1.3.4. add_username (integer)
1.4. Exported Functions
1.4.1. loose_route()
1.4.2. strict_route() -- deprecated
1.4.3. record_route()
1.4.4. record_route_preset(string)
1.4.5. add_rr_param(param)
1.4.6. check_route_param(re)
2. Developer's Guide
3. Frequently Asked Questions
List of Examples
1-1. Set enable_full_lr parameter
1-2. Set append_fromtag parameter
1-3. Set enable_double_rr parameter
1-4. Set add_username parameter
1-5. loose_route usage
1-6. strict_route usage
1-7. record_route usage
1-8. record_route_preset usage
1-9. add_rr_param usage
1-10. check_route_param usage

Chapter 1. User's Guide

1.1. Overview

The module contains record routing logic


1.2. Dependencies

1.2.1. OpenSER Modules

The following modules must be loaded before this module:

  • No dependencies on other OpenSER modules.


1.2.2. External Libraries or Applications

The following libraries or applications must be installed before running OpenSER with this module loaded:

  • None.


1.3. Exported Parameters

1.3.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-1. Set enable_full_lr parameter

...
modparam("rr", "enable_full_lr", 1)
...

1.3.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-2. Set append_fromtag parameter

...
modparam("rr", "append_fromtag", 0)
...

1.3.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-3. Set enable_double_rr parameter

...
modparam("rr", "enable_double_rr", 0)
...

1.3.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-4. Set add_username parameter

...
modparam("rr", "add_username", 1)
...

1.4. Exported Functions

1.4.1. loose_route()

The function performs loose routing as defined in RFC3261. See the RFC3261 for more details.

Example 1-5. loose_route usage

...
loose_route();
...

1.4.2. strict_route() -- deprecated

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.

Example 1-6. strict_route usage

...
strict_route();
...

1.4.3. record_route()

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.

Example 1-7. record_route usage

...
record_route();
...

1.4.4. record_route_preset(string)

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.

Example 1-8. record_route_preset usage

...
record_route_preset("1.2.3.4:5090");
...

1.4.5. add_rr_param(param)

Adds a parameter to the Record-Route URI (param must be in ";name=value" format. The function may be called also before or after the record_route() call.

Meaning of the parameters is as follows:

  • param - String containing the URI parameter to be added. It must follow the ";name=value" scheme.

Example 1-9. add_rr_param usage

...
add_rr_param(";nat=yes");
...

1.4.6. check_route_param(re)

The function check if the URI parameters of the local Route header (coresponding to the local server) matches the given regular expression. It must be call after loose_route().

Meaning of the parameters is as follows:

  • re - regular expression to check against the Route URI parameters.

Example 1-10. check_route_param usage

...
if (check_route_param("nat=yes")) {
    setflag(6);
}
...

Chapter 2. Developer's Guide

The module does not provide any sort of API to use in other OpenSER modules.


Chapter 3. Frequently Asked Questions

3.1. Where can I find more about OpenSER?
3.2. Where can I post a question about this module?
3.3. How can I report a bug?

3.1. Where can I find more about OpenSER?

Take a look at http://openser.org/.

3.2. Where can I post a question about this module?

First at all check if your question was already answered on one of our mailing lists:

E-mails regarding any stable OpenSER release should be sent to and e-mails regarding development versions should be sent to .

If you want to keep the mail private, send it to .

3.3. How can I report a bug?

Please follow the guidelines provided at: http://openser.org/bugs.