# &adminguide;

## Overview

This module hides the SIP routing headers that show topology details. It it is not affected by the server being transaction stateless or stateful. The script interpreter gets the SIP messages decoded, so all existing functionality is preserved.

The module is transparent for the configuration writer. It only needs to be loaded (tune the parameters if needed). The SIP server can be restarted whitout affecting ongoing calls - once it is up, can encode/decode topology details, thus no call will be lost.

By using same mask_key, many SIP servers can decode the message, for example, applicable for servers behind load balancers.

## Dependencies

### &kamailio; Modules

The following modules must be loaded before this module:

- rr module - server must perform record routing to ensure in-dialog requests are encoded/decoded.

### External Libraries or Applications

The following libraries or applications must be installed before running &kamailio; with this module loaded:

- None. In the future the module can be enhanced to use a stronger encryption algorithm.

## Parameters

### `mask_key` (str)

Keyword to mask the headers.

Default value is "_static_value_".

#### Set `mask_key` parameter

    ...
    modparam("topoh", "mask_key", "some secret here")
    ...

### `mask_ip` (str)

IP address to be used in masked headers to build valid SIP URIs. Can be any IP address, even a private-space IP address (e.g., 192.168.1.1), but must not be SIP server's local IP address. It is not used at all for SIP routing.

Default value is "10.1.1.10".

#### Set `mask_ip` parameter

    ...
    modparam("topoh", "mask_ip", "192.168.0.1")
    ...

### `mask_callid` (integer)

Whether to encode the Call-id: header. Some SIP extensions include the Call-id in the SIP message payload or header, so it is safe to not encode Call-id in such cases. Well-known extensions such as call transfer or conference join will be added to work with encoded Call-id.

Default value is 0 (do not mask).

#### Set `mask_callid` parameter

    ...
    modparam("topoh", "mask_callid", 1)
    ...

### `uparam_name` (str)

Name of URI parameter where to store encoded value.

Default value is "line".

#### Set `uparam_name` parameter

    ...
    modparam("topoh", "uparam_name", "myparam")
    ...

### `uparam_prefix` (str)

Prefix to be added in encoded URI parameters.

Default value is "sr-".

#### Set `uparam_prefix` parameter

    ...
    modparam("topoh", "uparam_prefix", "xyz")
    ...

### `vparam_name` (str)

Name of Via: parameter used to store encoded value.

Default value is "branch".

#### Set `vparam_name` parameter

    ...
    modparam("topoh", "vparam_name", "myv")
    ...

### `vparam_prefix` (str)

Prefix to be added in encoded Via: parameters.

Default value is "z9hG4bKsr-".

#### Set `vparam_prefix` parameter

    ...
    modparam("topoh", "vparam_prefix", "xyz")
    ...

### `callid_prefix` (str)

Prefix to be added in encoded Call-ID: headers.

Default value is "!!:".

#### Set `callid_prefix` parameter

    ...
    modparam("topoh", "callid_prefix", "***")
    ...

### `sanity_checks` (integer)

If set to 1, topoh module will bind to sanity module in order to perform sanity checks over received SIP request. Default sanity checks are done. It is useful to check if received request is well formated before proceeding to encoding/decoding.

Default value is 0 (do not bind to sanity module).

#### Set `sanity_checks` parameter

    ...
    modparam("topoh", "sanity_checks", 1)
    ...

## Functions

None.