dmq_usrloc Module

Andrey Rybkin

   bks.tv
   <rybkin.a@bks.tv>

Edited by

Andrey Rybkin

   bks.tv
   <rybkin.a@bks.tv>

Edited by

Julien Chavanton

   flowroute.com
   <jchavanton@gmail.com>

Edited by

Emmanuel Schmidbauer

   TextNow Inc.
   <emmanuel.schmidbauer@textnow.com>

   Copyright © 2014

   Copyright © 2017

   Copyright © 2020
     __________________________________________________________________

   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)
              3.8. replicate_socket_info (int)
              3.9. usrloc_delete (int)

   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
   1.8. Set replicate_socket_info parameter
   1.9. Set usrloc_domain parameter

Chapter 1. Admin Guide

   Table of Contents

   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)
        3.8. replicate_socket_info (int)
        3.9. usrloc_delete (int)

1. Overview

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

2. Dependencies

   2.1. Kamailio Modules

2.1. Kamailio Modules

   The following modules must be loaded before this module:
     * DMQ module..
     * USRLOC module..

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)
   3.8. replicate_socket_info (int)
   3.9. usrloc_delete (int)

3.1. enable (int)

   The parameter controls whether 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 whether 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 whether 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 whether 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 than 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")
...

3.8. replicate_socket_info (int)

   The parameter controls whether the socket replication is active or not.
   This is important for anycast scenarios. The value can be:
     * 0 - disabled
     * 1 - enabled, replicate socket by proto:host:port
     * 2 - enabled, replicate socket by socket name

   Default value is 0.

   Example 1.8. Set replicate_socket_info parameter
...
modparam("dmq_usrloc", "replicate_socket_info", 1)
...

3.9. usrloc_delete (int)

   Enable (1) or disable (0) synchronizing usrloc delete actions.
   Disabling delete actions can be useful when user location data is
   ephemeral.

   Default value is 1.

   Example 1.9. Set usrloc_domain parameter
...
modparam("dmq_usrloc", "usrloc_delete", 0)
...
