Skip to content

UAC REGISTRANT module

The module enable OpenSIPS to register itself on a remote SIP registrar.

At startup, the registrant records are loaded into a hash table in memory and a timer is started. The hash index is computed over the AOR field.

The timer interval for checking records in a hash bucket is computed by dividing the timer_interval module param by the number of hash buckets. When the timer fires for the first time, the first hash bucket will be checked and REGISTERs will be sent out for each record that is found. On the next timeout fire, the second hash bucket will be checked and so on. If the configured timer_interval module param is lower then the number of buckets, the module will fail to start.

Example: setting the timer_interval module to 8 with a hash_size of 2, will result in having 4 hash buckets (2^2=4) and buckets will be checked one by one every 2s (8/4=2).

Each registrant has it’s own state. Registrant’s status can be inspected via “reg_list” MI comand.

UAC registrant states:

  • 0 - NOT_REGISTERED_STATE - the initial state (no REGISTER has been sent out yet);
  • 1 - REGISTERING_STATE - waiting for a reply from the registrar after a REGISTER without authentication header was sent;
  • 2 - AUTHENTICATING_STATE - waiting for a reply from the registrar after a REGISTER with authentication header was sent;
  • 3 - REGISTERED_STATE - the uac is successfully registered;
  • 4 - REGISTER_TIMEOUT_STATE : no reply received from the registrar;
  • 5 - INTERNAL_ERROR_STATE - some errors were found/encountered during the processing of a reply;
  • 6 - WRONG_CREDENTIALS_STATE - credentials rejected by the registrar;
  • 7 - REGISTRAR_ERROR_STATE - error reply received from the registrar;
  • 8 - UNREGISTERING_STATE - waiting for a reply from the registrar after an unREGISTER without authentication header was sent;
  • 9 - AUTHENTICATING_UNREGISTER_STATE - waiting for a reply from the registrar after an unREGISTER with authentication header was sent;

The following modules must be loaded before this module:

  • uac_auth - UAC authentication module

None.

The size of the hash table internally used to keep the registrants. A larger table distributes better the registration load in time but consumes more memory. The hash size is a power of number two.

Default value is 1.

Set hash_size parameter
...
modparam("uac_registrant", "hash_size", 2)
...

Defines the periodic timer for checking the registrations status.

Default value is 100.

Set timer_interval parameter
...
modparam("uac_registrant", "timer_interval", 120)
...

This parameter enables the clustering support in the module. This is used to share this registration between all the nodes in the cluster. When using this option, you should define (for each registrant record) a sharing tag - this sharing tag will control at the cluster level which node is entitled to perform the registation (only the node having that tag as active will do the registation, the onther nodes being idle).

Default value is 0 / off.

Set enable_clustering parameter
...
modparam("uac_registrant", "enable_clustering", 1)
...

Database where to load the registrants from.

Default value is “NULL” (use default DB URL from core).

Set 'db_url' parameter
...
modparam("uac_registrant", "db_url", "mysql://user:passw@localhost/database")
...

The database table that holds the registrant records.

Default value is “registrant”.

Set 'table_name' parameter
...
modparam("uac_registrant", "table_name", "my_registrant")
...

The column’s name in the database storing the URI pointing to the remote registrar (mandatory field). OpenSIPS expects a valid URI.

Default value is “registrar”.

Set 'registrar_column' parameter
...
modparam("uac_registrant", "registrar_column", "registrant_uri")
...

The column’s name in the database storing the URI pointing to the outbond proxy (not mandatory field). An empty or NULL value means no outbound proxy, otherwise OpenSIPS expects a valid URI.

Default value is “proxy”.

Set 'proxy_column' parameter
...
modparam("uac_registrant", "proxy_column", "proxy_uri")
...

The column’s name in the database storing the URI defining the address of record (mandatory field). The URI stored here will be used in the To URI of the REGISTER. OpenSIPS expects a valid URI.

Default value is “aor”.

Set 'aor_column' parameter
...
modparam("uac_registrant", "aor_column", "to_uri")
...

The column’s name in the database storing the URI defining the third party registrant (not mandatory field). The URI stored here will be used in the From URI of the REGISTER. An empty or NULL value means no third party registration (the From URI will be identical to To URI), otherwise OpenSIPS expects a valid URI.

Default value is “third_party_registrant”.

Set 'third_party_registrant_column' parameter
...
modparam("uac_registrant", "third_party_registrant_column", "from_uri")
...

The column’s name in the database storing the username for authentication (mandatory if the registrar requires authentication).

Default value is “username”.

Set 'username_column' parameter
...
modparam("uac_registrant", "username_column", "auth_username")
...

The column’s name in the database storing the password for authentication (mandatory if the registrar requires authntication).

Default value is “password”.

Set 'password_column' parameter
...
modparam("uac_registrant", "password_column", "auth_passowrd")
...

The column’s name in the database storing the binding URI in REGISTER (mandatory field). The URI stored here will be used in the Contact URI of the REGISTER. OpenSIPS expects a valid URI.

Default value is “binding_URI”.

Set 'binding_URI_column' parameter
...
modparam("uac_registrant", "binding_URI_column", "contact_uri")
...

The column’s name in the database storing the binding params in REGISTER (not mandatory field). If not NULL or not empty, the string stored here will be added as params to the Contact URI in REGISTER (it MUST start with ”;”.

If the following two params are present, then the binding will be enforced to be unique (if two bindings are received in a 200ok, a complete binding removal will be performed before re-registering):

  • reg-id
  • +sip.instance

Example of params that will force unique binding:

;reg-id=1;+sip.instance="<urn:uuid:11111111-AABBCCDDEEFF>"

Default value is “binding_params”.

Set 'binding_params_column' parameter
...
modparam("uac_registrant", "binding_params_column", "contact_params")
...

The column’s name in the database storing the expiration time (not mandatory).

Default value is “expiry”.

Set 'expiry_column' parameter
...
modparam("uac_registrant", "expiry_column", "registration_timeout")
...

The column’s name in the database storing the socket for sending the REGISTER (not mandatory). If a forced socket is provided, the socket MUST be explicitely set as a global listening socket in the config (see “listen” core parameter).

Default value is “forced_socket”.

Set 'forced_socket_column' parameter
...
modparam("uac_registrant", "forced_socket_column", "fs")
...

The column’s name in the database storing the cluster sharing tag in [tag_name/cluster_id] format (not mandatory). If a cluster sharing tag is provided, the REGISTER requests will be fired out only when the tag is active.

Default value is “cluster_shtag”.

Set 'cluster_shtag_column' parameter
...
modparam("uac_registrant", "cluster_shtag_column", "sh")
...

The column’s name in the database storing the current state of the registrant. When a registrant is disabled, OpenSIPS will no longer send REGISTERs for it. A value of 0 for this column means enabled and 1 disabled.

Default value is “state”.

Set 'state_column' parameter
...
modparam("uac_registrant", "state_column", "status")
...

None to be used in configuration file.

Lists the registrant records and their status.

Name: reg_list

Parameters:

  • aor (optional) - URI defining the address of record. If provided, contact and registrar parameters are also required and only a specific record will be listed.
  • contact (optional) - Contact URI. If provided, aor and registrar parameters are also required and only a specific record will be listed.
  • registrar (optional) - URI pointing to the remote registrar. If provided, aor and contact parameters are also required and only a specific record will be listed.

MI FIFO Command Format:

Terminal window
opensips-cli -x mi reg_list
...
opensips-cli -x mi reg_list sip:alice@opensips.org sip:alice@127.0.0.1:5060 sip:opensips.org

Reloads the registrant records from the database.

Name: reg_reload

Parameters: none

  • aor (optional) - URI defining the address of record. If provided, contact and registrar parameters are also required and only a specific record will be reloaded.
  • contact (optional) - Contact URI. If provided, aor and registrar parameters are also required and only a specific record will be reloaded.
  • registrar (optional) - URI pointing to the remote registrar. If provided, aor and contact parameters are also required and only a specific record will be reloaded.

MI FIFO Command Format:

Terminal window
opensips-cli -x mi reg_reload
...
opensips-cli -x mi reg_leload sip:alice@opensips.org sip:alice@127.0.0.1:5060 sip:opensips.org

Enables a specific registrant. OpenSIPS will immediately send a REGISTER if the registrant was previously disabled and will update the state in the database.

Name: reg_enable

Parameters: none

  • aor - URI defining the address of record.
  • contact - Contact URI.
  • registrar - URI pointing to the remote registrar.

MI FIFO Command Format:

Terminal window
opensips-cli -x mi reg_enable sip:alice@opensips.org sip:alice@127.0.0.1:5060 sip:opensips.org

Disables a specific registrant. OpenSIPS will immediately send an unREGISTER if the registrant was previously enabled and will update the state in the database.

Name: reg_disable

Parameters: none

  • aor - URI defining the address of record. If provided, contact and registrar parameters are also required and only a specific record will be reloaded.
  • contact - Contact URI. If provided, aor and registrar parameters are also required and only a specific record will be reloaded.
  • registrar - URI pointing to the remote registrar. If provided, aor and contact parameters are also required and only a specific record will be reloaded.

MI FIFO Command Format:

Terminal window
opensips-cli -x mi reg_disable sip:alice@opensips.org sip:alice@127.0.0.1:5060 sip:opensips.org

Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)

#NameDevScoreCommitsLines++Lines—
1.Ovidiu Sas (@ovidiusas)1464058063385
2.Vlad Patrascu (@rvlad-patrascu)187796182
3.Liviu Chircu (@liviuchircu)17145970
4.Bogdan-Andrei Iancu (@bogdan-iancu)151132031
5.Stefan Darius (@dariusstefan)135681115
6.Razvan Crainea (@razvancrainea)1192625
7.Nick Altmann (@nikbyte)42365
8.Vlad Paiu (@vladpaiu)421310
9.Maksym Sobolyev (@sobomax)311612
10.sagarmalam31151

All remaining contributors: Peter Lemenkov (@lemenkov).

(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)

(2) including any documentation-related commits, excluding merge commits

(3) ignoring whitespace edits, renamed files and auto-generated files

#NameCommit Activity
1.Stefan Darius (@dariusstefan)Jun 2026 - Jul 2026
2.Razvan Crainea (@razvancrainea)Sep 2011 - Jun 2026
3.Bogdan-Andrei Iancu (@bogdan-iancu)Dec 2012 - Jun 2023
4.Liviu Chircu (@liviuchircu)Mar 2014 - Jul 2021
5.Maksym Sobolyev (@sobomax)Mar 2021 - Mar 2021
6.sagarmalamJan 2021 - Jan 2021
7.Vlad Patrascu (@rvlad-patrascu)May 2017 - Dec 2020
8.Ovidiu Sas (@ovidiusas)Feb 2011 - Mar 2019
9.Peter Lemenkov (@lemenkov)Jun 2018 - Jun 2018
10.Nick Altmann (@nikbyte)Nov 2015 - Dec 2015

All remaining contributors: Vlad Paiu (@vladpaiu).

(1) including any documentation-related commits, excluding merge commits

Last edited by: Razvan Crainea (@razvancrainea), Vlad Patrascu (@rvlad-patrascu), Ovidiu Sas (@ovidiusas), Bogdan-Andrei Iancu (@bogdan-iancu), Peter Lemenkov (@lemenkov), Liviu Chircu (@liviuchircu).

All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0