dmq_usrloc Module

Andrey Rybkin

bks.tv

Edited by

Andrey Rybkin

bks.tv

Edited by

Julien Chavanton

flowroute.com

Table of Contents

1. Admin Guide
1. Overview
2. Dependencies
2.1. Kamailio Modules
3. Parameters
3.1. enable (int)
3.2. sync (int)
3.3. batch_size (int)
3.4. batch_usleep (int)
3.5. batch_msg_size (int)
3.6. batch_msg_contacts (int)
3.7. usrloc_domain (string)

List of Examples

1.1. Set enable parameter
1.2. Set sync parameter
1.3. Set batch size parameter
1.4. Set batch_usleep parameter
1.5. Set batch_msg_size parameter
1.6. Set batch_msg_contacts parameter
1.7. Set usrloc_domain parameter

Chapter 1. Admin Guide

1. Overview

The module adds user location (usrloc) records replication between multiple servers via DMQ module.

2. Dependencies

2.1. Kamailio Modules

The following modules must be loaded before this module:

  • DMQ module..

  • USRLOC module..

3. Parameters

3.1. enable (int)

The parameter controls whetner the replication is active or not. The value can be:

  • 0 - replication is disabled

  • 1 - replication is enabled

Default value is 0.

Example 1.1. Set enable parameter

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

3.2. sync (int)

The parameter controls whetner to request synchronization of all usrloc records at startup. The value can be:

  • 0 - disabled

  • 1 - enabled

Default value is 1.

Example 1.2. Set sync parameter

...
modparam("dmq_usrloc", "sync", 0)
...

3.3. batch_size (int)

The parameter controls whetner to throttle synchronization of all contacts in batches. Once a batch of SIP requests is sent out, then sleep for 'batch_usleep' microseconds. The value can be:

  • <=0 - disabled (no batching)

  • >0 - how many records to be sent in a batch

Default value is 0.

Example 1.3. Set batch size parameter

...
modparam("dmq_usrloc", "batch_size", 4000)
...

3.4. batch_usleep (int)

The parameter controls whetner to throttle synchronization of all contacts in batches. Once a batch of SIP requests is sent out, then sleep for 'batch_usleep' microseconds. The value can be:

  • <=0 - no sleep (it disables the batching)

  • >0 - how many microseconds to sleep before sending out another batch of usrloc records.

Default value is 0.

Example 1.4. Set batch_usleep parameter

...
modparam("dmq_usrloc", "batch_usleep", 1000)
...

3.5. batch_msg_size (int)

The parameter controls the size of the messages during a sync. This is to make sure the messages are never larger then 65536 (the maximum datagram size).

Note that batch_msg_contacts will also be checked.

Default value is 60000. Maximum value is 60000.

Example 1.5. Set batch_msg_size parameter

...
modparam("dmq_usrloc", "batch_msg_contacts", 50)  # 50 contacts / message
modparam("dmq_usrloc", "batch_msg_size", 500000)
# with this config, when doing a full sync, each message will be sent a soon as the body is larger 50K or contains 50 contacts
...

3.6. batch_msg_contacts (int)

The parameter controls the amount of contact per message/transaction during a sync.

Note that batch_msg_size will also be checked.

Default value is 1. Maximum value is 150.

Example 1.6. Set batch_msg_contacts parameter

...
modparam("dmq_usrloc", "batch_msg_contacts", 50)  # 50 contacts / message
modparam("dmq_usrloc", "batch_size", 10000)       # 10000 contacts / batch
modparam("dmq_usrloc", "batch_usleep", 500000)    # one batch every 500ms
# syncing 20K contacts/second with 50 contacts/message
...

3.7. usrloc_domain (string)

The usrloc domain to synchronize.

Default value is location.

Example 1.7. Set usrloc_domain parameter

...
modparam("dmq_usrloc", "usrloc_domain", "my_domain")
...