Table of Contents
db_url
(string)
db_table
(string)
mtree
(string)
tname_column
(string)
tprefix_column
(string)
tvalue_column
(string)
fetch_rows
(integer)
char_list
(string)
pv_value
(string)
pv_values
(string)
mt_tree_type
(integer)
mt_ignore_duplicates
(integer)
mt_allow_duplicates
(integer)
List of Examples
db_url
parameterdb_table
parametermtree
parametertname_column
parametertprefix_column
parametertvalue_column
parameterfetch_rows
parameterchar_list
parameterpv_value
parameterpv_values
parametermt_tree_type
parametermt_ignore_duplicates
parametermt_allow_duplicates
parametermt_match
usageTable of Contents
db_url
(string)
db_table
(string)
mtree
(string)
tname_column
(string)
tprefix_column
(string)
tvalue_column
(string)
fetch_rows
(integer)
char_list
(string)
pv_value
(string)
pv_values
(string)
mt_tree_type
(integer)
mt_ignore_duplicates
(integer)
mt_allow_duplicates
(integer)
This module loads data indexed by prefixes from database and returns associated string or precompiled value.
The following modules must be loaded before this module:
A Kamailio database module (e.g., mysql).
URL of the database server to be used.
Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”.
Example 1.1. Set db_url
parameter
... modparam("mtree", "db_url", "dbdriver://username:password@dbhost/dbname") ...
Name of database table where data for trees is stored. It is ignored if a 'mtree' parameter is defined.
Default value is “mtrees”.
Definition of memory tree
Default value is “none”.
Example 1.3. Set mtree
parameter
... modparam("mtree", "mtree", "name=mytable;dbtable=routes;type=0;") ...
Name of 'tname' column.
Default value is “tname”.
Name of 'tprefix' column.
Default value is “tprefix”.
Name of 'tvalue' column.
Default value is “tvalue”.
Number of rows to be loaded in one step from database.
Default value is 1000.
The list with characters allowed in prefix.
Default value is “0123456789”.
The PV spec where to store the matched value. It can be any writable PV.
Default value is “$avp(s:tvalue)”.
The PV spec where to store the matched values when mtree is of type 0 or 2 and mode of mt_match() call has value 2. It can be any AVP.
Default value is “$avp(s:tvalues)”.
Default payload type for trees data stored in 'db_table'. Documented values are 0 for string payloads and 2 for integer payloads.
Default value is 0.
Match 'pv' value against 'mtree'. If 'mtree' type is 0 or 2 and value of 'mode' is NOT 2, sets a value of the longest matching prefix to pseudo variable specified by pv_value parameter. If 'mtree' type is 0 or 2 and value of 'mode' is 2, sets values of all matching prefixes to avp specified by pv_values parameter so that a value of longest matching prefix is in avp index 0. Parameter 'mode' can be an integer constant or a pseudo variable with integer value.
List content of a tree.
Name: mt_list
Parameters:
_mtree_ : name of tree to list.
MI FIFO Command Format:
:mt_list:_reply_fifo_file_ _mtname_ _empty_line_
Reload mtree from database.
Name: mt_mtree
Parameters:
_mtname_
- name of mem treeMI FIFO Command Format:
:mt_reload:_reply_fifo_file_ _mtname_ _empty_line_