CONFIG module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”The config module enables dynamic, runtime configuration of OpenSIPS parameters by loading them from persistent storage at startup and exposing them to the script level via the config pseudo-variable.
All configuration variables are stored in OpenSIPS’ internal cache, allowing fast access during SIP processing to maintain high performance. The cache can be updated in three ways:
- Script – Assigning a value to the config pseudo-variable updates the in-memory cache, but this change is not persisted to the database.
- MI Commands – Using mi config push or mi config push bulk updates one or more variables in the runtime cache. These updates are also not saved to the database.
- Database – Manually modifying values in the database, then triggering the mi config reload command, will refresh the in-memory cache with updated values from the database.
Restart Persistent Memory
Section titled “Restart Persistent Memory”By default, the configuration cache is initialized at startup by reading from the database and persists only during the runtime. Any temporary changes made through the script or MI commands that are not explicitly flushed to the database using the mi config flush command will be lost after a restart.
In such cases, restart persistent memory becomes useful. When enabled via the enable rpm parameter, OpenSIPS no longer loads configuration values from the database on startup. Instead, it restores the previously saved in-memory cache, preserving runtime changes across restarts.
If needed, you can still manually re-initialize the cache from the database by running the mi config reload MI command.
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- A database module is needed to read the initial cache.
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- None.
Exported Parameters
Section titled “Exported Parameters”db_url (string)
Section titled “db_url (string)”Database URL used to load the initial configuration values, and flush them at runtime using the mi config flush MI command.
Default value is “mysql://opensips:opensipsrw@localhost/opensips”.
...modparam("config", "db_url", "dbdriver://username:password@dbhost/dbname")...table_name (string)
Section titled “table_name (string)”Name of the table where configuration entries are stored.
Default value is “config”.
...modparam("config", "table_name", "configuration")...name_column (string)
Section titled “name_column (string)”Name of the column storing configuration variable names.
Default value is “name”.
...modparam("config", "name_column", "key")...value_column (string)
Section titled “value_column (string)”Name of the column storing configuration variable values.
Default value is “value”.
...modparam("config", "value_column", "val")...description_column (string)
Section titled “description_column (string)”Name of the column storing variable descriptions.
Default value is “description”.
...modparam("config", "description_column", "desc")...enable_restart_persistency (integer)
Section titled “enable_restart_persistency (integer)”Enables restart persistency. Check the restart persistent memory for more information.
Default value is “0 / disabled”.
...modparam("config", "restart_persistent_memory", yes)...hash_size (integer)
Section titled “hash_size (integer)”Size of the internal hash table used to store config variables. Must be a power of 2 number, otherwise its value will be rounded to the closest value of 2 smaller than the provided value.
Default value is “16”.
...modparam("config", "hash_size", 32)...Exported Pseudo-Variables
Section titled “Exported Pseudo-Variables”$config(name)
Section titled “$config(name)”Returns the value of the given config variable by name. Can also be used for temporarily changing the value.
...xlog("Config value: $config(debug_mode)\n"); # reading the value$config(debug_mode) = 1; # temporarily changing the value...$config.description(name)
Section titled “$config.description(name)”Returns the description of a config variable if available.
This variable is read-only.
...xlog("Description: $config.description(debug_mode)\n");...Exported MI Functions
Section titled “Exported MI Functions”config_reload
Section titled “config_reload”Reloads all configuration variables from the database.
MI FIFO Command Format:
## reload configuration cache from the databaseopensips-mi config_reloadopensips-cli -x mi config_reloadconfig_list
Section titled “config_list”Lists all config variables currently loaded in cache, printing temporary values as well. If the optional description parameter is provided and different than 0, it returns an array containing the description of the values as well.
MI FIFO Command Format:
## list all configuration cacheopensips-mi config_listopensips-cli -x mi config_list 1config_push
Section titled “config_push”Temporarily pushes a single configuration variable.
Expected parameters are:
- name – (string) the name of the variable
- value – (string) the value of the variable
- description – (string, optional) the description of the variable; if missing the description is inheritted, or a null value is used if the variable is new.
MI FIFO Command Format:
## push temporarily debug_mode configuration valueopensips-mi config_push debug_mode 1 "Enable Debug mode"opensips-cli -x mi config_list 1config_push_bulk
Section titled “config_push_bulk”Pushes multiple temporarily configuration variables in memory.
Expected parameters are:
- configs – (json) a JSON
array containing a set of variables to be pushed. Each
variable should be described as a JSON object with the following
keys:
- name – (string) the name of the variable to be changed.
- value – (string or null) the new value of the variable.
- description – (string, optional) the description of the variable.
MI FIFO Command Format:
## push bulk temporarily values to the config cacheopensips-mi config_push_bulk -j '[[{"name":"debug_mode","value":"1"},{"name":"debug_level","value":"5"}]]'The command returns the number of values successfully pushed.
config_flush
Section titled “config_flush”Flushes the variables from the memory to the database.
Expected parameters are:
- name – (string, optional) if present, flushes only a specific config variable in database, otherwise the entire cache.
MI FIFO Command Format:
## Flush config variables to the databaseopensips-mi config_flushopensips-cli -x mi config_flush debug_modeThe command returns the number of values successfully flushed.
Contributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Razvan Crainea (@razvancrainea) | 16 | 2 | 1439 | 2 |
| 2. | Stefan Darius (@dariusstefan) | 11 | 5 | 472 | 105 |
(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
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | May 2025 - Jun 2026 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0