# &adminguide;

## Overview

This module provides integration with Slack over webhooks. Slack integration (https://api.slack.com/messaging/webhooks)

It relays on libcurl through http_client module.

## Dependencies

### &kamailio; Modules

The following modules must be loaded before this module:

- HTTP_CLIENT - the http_client module should be loaded first.

### External Libraries or Applications

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

- &libcurl;

## Parameters

### `slack url` (str)

Slack webhook url

Default value is not set (empty)

#### Set `slack webhook URL` parameter

    ...
    modparam("slack", "slack_url", "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")
    ...

### `channel` (str)

Slack channel name

Default value is #kamailio

#### Set `channel` parameter

    ...
    modparam("slack", "channel", "#kamailio")
    ...

### `username` (str)

Specify the username for the published message

Default value is webhookbot.

#### Set `username` parameter

    ...
    modparam("slack", "username", "webhookbot")
    ...

### `icon_emoji` (str)

specify an emoji (using colon shortcodes, eg. :white_check_mark:) to use as the profile photo alongside the message.

Default value is :ghost:

#### Set `icon_emoji` parameter

    ...
    modparam("slack", "icon_emoji", ":ghost:")
    ...

## Functions

### `slack_send(format)`

Send a formatted message to slack channel.

The parameters are:

- format - The formatted string to be sent.

The parameters can contain pseudo-variables.

This function can be used from ANY_ROUTE.

#### `slack_send` usage

    ...
        slack_send("Hello from Kamailio! caller=$fU;callee=$tU;callid=$ci");
    ...