# &adminguide;

## Overview

This module can store and fetch SIP message content in an in-memory hash table.

## Dependencies

### &kamailio; Modules

The following modules must be loaded before this module:

- None.

### External Libraries or Applications

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

- None

## Parameters

### `hash_size (int)`

Number of slots in the hash table. It should be power of 2.

Default value: 256.

#### `hash_size` usage

    ...
    modparam("siprepo", "hash_size", 1024)
    ...

### `expire (int)`

Number of seconds until the stored message content expires.

Default value: 180.

#### `expire` usage

    ...
    modparam("siprepo", "expire", 240)
    ...

### `timer_interval (int)`

Number of seconds to run the timer routine.

Default value: 10.

#### `timer_interval` usage

    ...
    modparam("siprepo", "timer_interval", 5)
    ...

### `timer_procs (int)`

Number of timer processes.

Default value: 1.

#### `timer_procs` usage

    ...
    modparam("siprepo", "timer_procs", 2)
    ...

## Functions

### `sr_msg_push(msgid)`

Push the message content to hash table and associate it with `msgid`. The Call-Id and msgid are needed to pull the message.

This function can be used from ANY_ROUTE.

#### `sr_msg_push()` usage

    ...
    request_route {
        ...
        $var(msgid) = $sruid;
        if(sr_msg_push("$var(msgid)")) {
        }
        ...
    }
    ...

### `sr_msg_pull(callid, msgid, rname)`

Pull the message content and execute the route block 'rname'.

This function can be used from ANY_ROUTE.

#### `sr_msg_pull()` usage

    ...
    request_route {
        ...
        if(sr_msg_pull("$var(callid)", "$var(msgid)", "REPOPULL")) {
        }
        ...
    }
    ...

### `sr_msg_async_pull(callid, msgid, gname, rname)`

Pull the message content and execute the route block 'rname' via async group 'gname'.

This function can be used from ANY_ROUTE.

#### `sr_msg_async_pull()` usage

    ...
    request_route {
        ...
        if(sr_msg_async_pull("$var(callid)", "$var(msgid)", "WG01", "REPOPULL")) {
        }
        ...
    }
    ...

### `sr_msg_rm(callid, msgid)`

Remove the message content.

This function can be used from ANY_ROUTE.

#### `sr_msg_rm()` usage

    ...
    request_route {
        ...
        if(sr_msg_rm("$var(callid)", "$var(msgid)")) {
        }
        ...
    }
    ...

### `sr_msg_check()`

Check if the message is stored.

This function can be used from ANY_ROUTE.

#### `sr_msg_check()` usage

    ...
    request_route {
        ...
        if(sr_msg_check()) {
        }
        ...
    }
    ...