# &adminguide;

## Overview

This module exports the $uuid(type) class of variables that return unique values using functions from the libuuid library. UUIDs are used in the +sip.instance media feature tag in SIP, but can also be used for other purposes, like defining a unique session ID for a group of SIP dialogs.

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

- libuuid - OSSP uuid - Universally Unique Identifier (UUID) Library

## Usage

The following variables can be used:

- $uuid(g) - return the UUID value using uuid_generate().

- $uuid(r) - return the UUID value using uuid_generate_random().

- $uuid(t) - return the UUID value using uuid_generate_time().

- $uuid(s) - return the UUID value using uuid_generate_time_safe(). If the generation was not safe, the variable returns $null. The function is not available on Mac OS X - the value is the one returned by uuid_generate_time().

### `$uuid(type)` usage

    ...
    $var(uuid) = $uuid(g);
    xdbg("generated uuid is [$var(uuid)]\n");
    add_rr_param(";uuid=$var(uuid)");
    ...