# &adminguide;

## Overview

This module writes SIP traffic and some associated details into local files. It intercepts automatically all the SIP traffic received or sent by &kamailio; and provides a function to trigger storage from configuration file.

Received traffic has the tag 'rcv' and the one to be sent has the tag 'snd'. The tag value is provided as parameter for the config function.

Besides the SIP packets, the module aims to save details related to &kamailio; runtime environment that are useful for troubleshooting, like process id, child rank, a.s.o.

The module should be useful for troubleshooting during development or testing of new deployments, especially when dealing with traffic over TLS with forward privacy, when other tools such as wireshark cannot decrypt. For production environments with a lot of SIP traffic, look at siptrace and sipcapture modules for a scalable alternative to capture all the SIP traffic and then search using Homer Sipcapture web toolkit.

## 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

### `enable` (int)

Enable storage.

Default value is 0 (0 - off; 1 - on).

#### Set `enable` parameter

    ...
    modparam("sipdump", "enable", 1)
    ...

### `wait` (int)

Wait time (microseconds) when no SIP traffic is received.

Default value is 100.

#### Set `wait` parameter

    ...
    modparam("sipdump", "wait", 2000)
    ...

### `rotate` (int)

Time interval in seconds to rotate files.

Default value is 7200 (2 hours).

#### Set `rotate` parameter

    ...
    modparam("sipdump", "rotate", 3600)
    ...

### `folder` (str)

Path to the folder where to save the files.

Default value is "/tmp".

#### Set `folder` parameter

    ...
    modparam("sipdump", "folder", "/var/run/kamailio")
    ...

### `fprefix` (str)

File name prefix. The date is appended to this prefix in the format yyyy-mm-dd--hh-mm-ss. The extension of the file is ".data".

Default value is "kamailio-sipdump-".

#### Set `fprefix` parameter

    ...
    modparam("sipdump", "fprefix", "ksipdump-")
    ...

## Functions

### `sipdump_send(tag)`

Send the details of the current SIP message to the writer process and get it stored in the file.

The parameter "tag" can be any string, it is going to be written in the tag attribute inside the storage file.

This function can be used from ANY_ROUTE.

#### `sipdump_send` usage

    ...
    sipdump_send("cfg");
    ...

## RPC Commands

### `sipdump.enable`

Control the value for "enable" parameter.

If no value is provided to this command, the value of "enable" parameter is returned.

This function can be used from ANY_ROUTE.

#### `sipdump.enable` usage

    ...
    &kamcmd; sipdump.enable
    &kamcmd; sipdump.enable 1
    &kamcmd; sipdump.enable 0
    ...