<osas@voipembedded.com>
+Edited by
+
Daniel-Constantin Mierla
<miconda@gmail.com>
+Edited by
+
Olle E. Johansson
<oej@edvina.net>
- Copyright © 2003, 2004 FhG FOKUS
+ Copyright © 2003, 2004 FhG FOKUS
__________________________________________________________________
Table of Contents
* A database is represented by a directory in the local file system.
NOTE: when you use dbtext in Kamailio, the database URL for modules
must be the path to the directory where the table-files are
- located, prefixed by “text://”, e.g., “text:///var/dbtext/ser”. If
- there is no “/” after “text://” then “CFG_DIR/” is inserted at the
+ located, prefixed by "text://", e.g., "text:///var/dbtext/ser". If
+ there is no "/" after "text://" then "CFG_DIR/" is inserted at the
beginning of the database path. So, either you provide an absolute
- path to database directory or a relative one to “CFG_DIR”
+ path to database directory or a relative one to "CFG_DIR"
directory.
- Do not forget that all databases in Kamailio needs the “version”
+ Do not forget that all databases in Kamailio needs the "version"
table.
* A table is represented by a text file inside database directory.
* the name of column must not include white spaces.
* the format of a column definition is: name(type,attr).
* between two column definitions must be a white space, e.g.,
- “first_name(str) last_name(str)”.
+ "first_name(str) last_name(str)".
* the type of a column can be:
+ int - integer numbers.
+ double - real numbers with two decimals.
+ null - accept null values in column fields.
+ if no attribute is set, the fields of the column cannot have
null value.
- * each other line is a row with data. The line ends with “\n”.
- * the fields are separated by “:”.
+ * each other line is a row with data. The line ends with "\n".
+ * the fields are separated by ":".
* no value between two ':' (or between ':' and start/end of a row)
- means “null” value. If the parameter "emptystring" is enabled,
+ means "null" value. If the parameter "emptystring" is enabled,
db_text sets a NULL string to an empty string value.
- * next characters must be escaped in strings: “\n”, “\r”, “\t”, “:”.
+ * next characters must be escaped in strings: "\n", "\r", "\t", ":".
* 0 -- the zero value must be escaped too.
Example 1.1. Sample of a dbtext table
table is requested whether the corresponding file on disk has changed,
and if yes, will re-load the table from file.
- Default value is “0”.
+ Default value is "0".
Example 1.4. Set db_mode parameter
...
enable emptystring an empty string will not be NULL, but an empty
string.
- Default value is “0” (off).
+ Default value is "0" (off).
Example 1.5. Set emptystring parameter
...
size of the buffer used to read the text file. Some presence tables
have columns with large content.
- Default value is “16384” (off).
+ Default value is "16384" (off).
Example 1.6. Set file_buffer_size parameter
...
5.1. db_text.dump
-5.1. db_text.dump
+5.1. db_text.dump
Write back to hard drive all modified tables.
REMINDER: when you use text in Kamailio, the database URL for modules
must be the path to the directory where the table-files are located,
- prefixed by “text://”, e.g., “text:///var/dbtext/ser”. If there is no
- “/” after “text://” then “CFG_DIR/” is inserted at the beginning of the
+ prefixed by "text://", e.g., "text:///var/dbtext/ser". If there is no
+ "/" after "text://" then "CFG_DIR/" is inserted at the beginning of the
database path. So, either you provide an absolute path to database
- directory or a relative one to “CFG_DIR” directory.
+ directory or a relative one to "CFG_DIR" directory.
Example 1.7. Load the dbtext module
...
Here are definitions for the most important tables as well as a basic
configuration file to use db_text with Kamailio. The table structures
may change in time and you will have to adjust these examples. Check
- the source code directory “utils/kamctl/dbtxt/kamailio” for current
+ the source code directory "utils/kamctl/dbtxt/kamailio" for current
definitions.
You have to populate the table 'subscriber' by hand with user profiles