|
@@ -1,4 +1,4 @@
|
|
|
-1. cfg_db module
|
|
|
+The configuration database module - cfg_db
|
|
|
|
|
|
Tomas Mandys
|
|
|
|
|
@@ -7,33 +7,28 @@ Tomas Mandys
|
|
|
Copyright © 2008 Tomas Mandys
|
|
|
__________________________________________________________________
|
|
|
|
|
|
- 1.1. Overview
|
|
|
- 1.2. Dependencies
|
|
|
- 1.3. Parameters
|
|
|
+ List of Examples
|
|
|
|
|
|
- 1.3.1. db_url (string)
|
|
|
- 1.3.2. transl_tbl (string) := "cfg_transl"
|
|
|
- 1.3.3. custom_tbl (string) := "cfg_custom"
|
|
|
+ 1. Example db_url
|
|
|
+ 2. Content of tables
|
|
|
|
|
|
- 1.4. Examples
|
|
|
-
|
|
|
-1.1. Overview
|
|
|
+1. Overview
|
|
|
|
|
|
The module implements a database driver for the configuration
|
|
|
parameters API. When configuration parameters are being declared
|
|
|
(typically when starting) API then driver is notified and has chance to
|
|
|
set value (of any parameter) based on value taken from database. It's
|
|
|
primarily targeted for interfacing with 3rd party software which is
|
|
|
- aware of configuration.
|
|
|
+ aware of the Kamailio configuration.
|
|
|
|
|
|
- Parameter is uniquely identified by group_name plus name, which is used
|
|
|
- by the driver to check if a value can be found. Because configuration
|
|
|
- parameters may be spread in many tables, a translation table is used to
|
|
|
- indicate where to start searching. Multiple look-up tables may be
|
|
|
- defined for single parameter, tables are searched in the first round by
|
|
|
- exact match until parameter is found, all tables listed with wildcard
|
|
|
- (asterisk) in group name are searched in the second round. If a
|
|
|
- parameter is not found then its value is left unchanged.
|
|
|
+ A parameter is uniquely identified by a group_name plus a name, which
|
|
|
+ is used by the driver to check if a value can be found. Because
|
|
|
+ configuration parameters may be spread in many tables, a translation
|
|
|
+ table is used to indicate where to start searching. Multiple look-up
|
|
|
+ tables may be defined for single parameter, tables are searched in the
|
|
|
+ first round by exact match until parameter is found, all tables listed
|
|
|
+ with wildcard (asterisk) in group name are searched in the second
|
|
|
+ round. If a parameter is not found then its value is left unchanged.
|
|
|
|
|
|
Configuration parameters are normally declared in C code and this
|
|
|
module additionally supports also declaring custom parameters in extra
|
|
@@ -46,13 +41,17 @@ Tomas Mandys
|
|
|
running. It just declares variables and assigns values when SER is
|
|
|
starting. That's all.
|
|
|
|
|
|
-1.2. Dependencies
|
|
|
+2. Dependencies
|
|
|
|
|
|
A loaded database module.
|
|
|
|
|
|
-1.3. Parameters
|
|
|
+3. Parameters
|
|
|
+
|
|
|
+ 3.1. db_url (string)
|
|
|
+ 3.2. transl_tbl (string) := "cfg_transl"
|
|
|
+ 3.3. custom_tbl (string) := "cfg_custom"
|
|
|
|
|
|
-1.3.1. db_url (string)
|
|
|
+3.1. db_url (string)
|
|
|
|
|
|
Default database URL.
|
|
|
|
|
@@ -66,7 +65,7 @@ loadmodule("cfg_db.so");
|
|
|
modparam("cfg_db", "db_url", "mysql://SER:[email protected]:12345/SER");
|
|
|
...
|
|
|
|
|
|
-1.3.2. transl_tbl (string) := "cfg_transl"
|
|
|
+3.2. transl_tbl (string) := "cfg_transl"
|
|
|
|
|
|
Name of table used for pointing group_name+name into configuration
|
|
|
table. If empty/null field values are found then default values will be
|
|
@@ -76,12 +75,12 @@ modparam("cfg_db", "db_url", "mysql://SER:[email protected]:12345/SER");
|
|
|
matches all parameters and will be used if parameter is not explicitely
|
|
|
mentioned.
|
|
|
|
|
|
-1.3.3. custom_tbl (string) := "cfg_custom"
|
|
|
+3.3. custom_tbl (string) := "cfg_custom"
|
|
|
|
|
|
Name of table used for extra param declaration (group_name, name, type,
|
|
|
min/max value, description).
|
|
|
|
|
|
-1.4. Examples
|
|
|
+4. Examples
|
|
|
|
|
|
Example 2. Content of tables
|
|
|
cfg_transl table:
|