# &adminguide;

## Overview

The qos module provides a way to keep track of per dialog SDP session(s).

## How it works

The qos module uses the dialog module to be notified of any new or updated dialogs. It will then look for and extract the SDP session (if present) from SIP requests and replies and keep track of it for the entire life of a dialog.

All of this happens with a properly configured dialog and qos module. You need to call the dlg_manage() function and set the qos flag at the time any INVITE sip message is seen. See the dialog module users guide for information.

A dialog can have one or more SDP sessions active in one of the following states:

- pending - only one endpoint of the SDP session is known.

- negotiated - both endpoints of the SDP session are known.

An SDP session can be established in one of the following scenarios:

- INVITE/200ok - typical "INVITE" and "200 OK" SDP exchange.

- 200ok/ACK - "200 OK" and "ACK" SDP exchange (for calls starting with an empty INVITE).

- 183/PRACK - early media via "183 Session Progress" and "PRACK" (see RFC 3959 for more information) - not implemented yet.

## Dependencies

### &kamailio; Modules

The following modules must be loaded before this module:

- dialog - dialog module and its dependencies (tm).

### External Libraries or Applications

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

- None.

## Parameters

### `qos_flag` (integer)

The module will not do anything to any message unless instructed to do so via the config script. You must set the `qos_flag` value in the `setflag()` call of the INVITE you want the qos module to process. But before you can do that, you need to tell the qos module which flag value you are assigning to qos.

In most cases when ever you call dlg_manage() function you will want to set the qos flag. If the dialog is not tracked and the qos flag is set, it will not have any effect.

This parameter must be set or the module will not load.

Default value is Not set!.

#### Set `qos_flag` parameter

    ...
    modparam("qos", "qos_flag", 7)
    ...
    route {
      ...
      if (method=="INVITE") {
    	dlg_manage(); # Track the dialog
        setflag(7); # Set the qos flag
      }
      ...
    }

## Functions

There are no exported functions that could be used in scripts.

## Statistics

There are no exported statistics for the qos module.

## Exported pseudo-variables

There are no exported pseudo-variables for the qos module.

## Installation and Running

Just load the module and remember to set the flag.