KeepAlive Module

Guillaume Bour

Edited by

Guillaume Bour


Table of Contents

1. Admin Guide
1. Overview
2. Dependencies
2.1. Kamailio Modules
2.2. External Libraries or Applications
2.3. Parameters
2.3.1. ping_interval (integer)
2.3.2. destination (string)
2.4. Functions
2.4.1. is_alive(destination)

List of Examples

1.1. Set ping_interval parameter
1.2. Set destination parameter
1.3. is_alive() usage

Chapter 1. Admin Guide

1. Overview

This module performs destinations monitoring either for itself, or on the behalf of other modules

2. Dependencies

2.1. Kamailio Modules

The following modules must be loaded before this module:

  • tm - Transaction module

2.2. External Libraries or Applications

The following libraries or applications must be installed before running Kamailio with this module loaded:

  • none

2.3. Parameters

2.3.1. ping_interval (integer)

Interval requests are sent to destinations (in seconds)

Default value is 30 seconds.

Example 1.1. Set ping_interval parameter

...
modparam("keepalive", "ping_interval", 10)
...

2.3.2. destination (string)

Allows to specify statically destinations you want to monitor

Example 1.2. Set destination parameter

...
modparam("keepalive", "destination", "192.168.10.20")
modparam("keepalive", "destination", "sip.provider.com")
...

2.4. Functions

2.4.1.  is_alive(destination)

Get destination status

Parameter destination is destination you want to check status

Return value: 1 if destination is up, 2 if destination is down, -1 on error.

This function can be used from ANY_ROUTE.

Example 1.3. is_alive() usage

...
is_alive("192.168.10.20");
...