6.53. enable_dmq (int)
6.54. track_cseq_updates (int)
6.55. lreq_callee_headers (string)
+ 6.56. event_callback (str)
7. Functions
1.53. Set enable_dmq parameter
1.54. Set track_cseq_updates parameter
1.55. Set lreq_callee_headers parameter
- 1.56. set_dlg_profile usage
- 1.57. unset_dlg_profile usage
- 1.58. is_in_profile usage
- 1.59. get_profile_size usage
- 1.60. dlg_isflagset usage
- 1.61. dlg_setflag usage
- 1.62. dlg_resetflag usage
- 1.63. dlg_bye usage
- 1.64. dlg_refer usage
- 1.65. dlg_manage usage
- 1.66. dlg_bridge usage
- 1.67. dlg_get usage
- 1.68. is_known_dlg() usage
- 1.69. dlg_set_timeout usage
- 1.70. dlg_set_timeout_by_profile usage
- 1.71. dlg_set_property usage
- 1.72. dlg_remote_profile usage
+ 1.56. Set event_callback parameter
+ 1.57. set_dlg_profile usage
+ 1.58. unset_dlg_profile usage
+ 1.59. is_in_profile usage
+ 1.60. get_profile_size usage
+ 1.61. dlg_isflagset usage
+ 1.62. dlg_setflag usage
+ 1.63. dlg_resetflag usage
+ 1.64. dlg_bye usage
+ 1.65. dlg_refer usage
+ 1.66. dlg_manage usage
+ 1.67. dlg_bridge usage
+ 1.68. dlg_get usage
+ 1.69. is_known_dlg() usage
+ 1.70. dlg_set_timeout usage
+ 1.71. dlg_set_timeout_by_profile usage
+ 1.72. dlg_set_property usage
+ 1.73. dlg_remote_profile usage
Chapter 1. Admin Guide
6.53. enable_dmq (int)
6.54. track_cseq_updates (int)
6.55. lreq_callee_headers (string)
+ 6.56. event_callback (str)
7. Functions
6.53. enable_dmq (int)
6.54. track_cseq_updates (int)
6.55. lreq_callee_headers (string)
+ 6.56. event_callback (str)
6.1. enable_stats (integer)
modparam("dialog", "lreq_callee_headers", "TH: dlh\r\n")
...
+6.56. event_callback (str)
+
+ The name of the function in the kemi configuration file (embedded
+ scripting language such as Lua, Python, ...) to be executed instead of
+ event_route[...] blocks.
+
+ The function receives a string parameter with the name of the event,
+ the values are: 'dialog:start', 'dialog:end', 'dialog:failed'. It is
+ also executed if '$dlg_ctx(timeout_route)' is set, the callback
+ function being executed with the variable value as parameter.
+
+ Default value is 'empty' (no function is executed for events).
+
+ Example 1.56. Set event_callback parameter
+...
+modparam("dialog", "event_callback", "ksr_dialog_event")
+...
+-- event callback function implemented in Lua
+function ksr_dialog_event(evname)
+ KSR.info("===== dialog module triggered event: " .. evname .. "\n");
+ return 1;
+end
+...
+
7. Functions
7.1. set_dlg_profile(profile,[value])
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
and FAILURE_ROUTE.
- Example 1.56. set_dlg_profile usage
+ Example 1.57. set_dlg_profile usage
...
set_dlg_profile("inbound_call");
set_dlg_profile("caller","$fu");
This function can be used from BRANCH_ROUTE, REPLY_ROUTE and
FAILURE_ROUTE.
- Example 1.57. unset_dlg_profile usage
+ Example 1.58. unset_dlg_profile usage
...
unset_dlg_profile("inbound_call");
unset_dlg_profile("caller","$fu");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
and FAILURE_ROUTE.
- Example 1.58. is_in_profile usage
+ Example 1.59. is_in_profile usage
...
if (is_in_profile("inbound_call")) {
log("this request belongs to a inbound call\n");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
and FAILURE_ROUTE.
- Example 1.59. get_profile_size usage
+ Example 1.60. get_profile_size usage
...
if(get_profile_size("inbound_call","$avp(size)"))
xlog("currently there are $avp(size) inbound calls\n");
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
- Example 1.60. dlg_isflagset usage
+ Example 1.61. dlg_isflagset usage
...
if(dlg_isflagset("1"))
{
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
- Example 1.61. dlg_setflag usage
+ Example 1.62. dlg_setflag usage
...
dlg_setflag("1");
...
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
- Example 1.62. dlg_resetflag usage
+ Example 1.63. dlg_resetflag usage
...
redlg_setflag("1");
...
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
- Example 1.63. dlg_bye usage
+ Example 1.64. dlg_bye usage
...
dlg_bye("all");
...
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
- Example 1.64. dlg_refer usage
+ Example 1.65. dlg_refer usage
...
dlg_refer("caller", "sip:announcement@kamailio.org");
...
This function can be used from REQUEST_ROUTE.
- Example 1.65. dlg_manage usage
+ Example 1.66. dlg_manage usage
...
modparam("dialog", "default_timeout", 100)
...
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
- Example 1.66. dlg_bridge usage
+ Example 1.67. dlg_bridge usage
...
dlg_bridge("sip:user@kamailio.org", "sip:annoucement@kamailio.org",
"sip:kamailio.org:5080");
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
- Example 1.67. dlg_get usage
+ Example 1.68. dlg_get usage
...
if(dlg_get("abcdef", "123", "456"))
{
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
and FAILURE_ROUTE.
- Example 1.68. is_known_dlg() usage
+ Example 1.69. is_known_dlg() usage
...
if(!uri == myself) {
if(is_known_dlg()) {
This function can be used from ANY_ROUTE.
- Example 1.69. dlg_set_timeout usage
+ Example 1.70. dlg_set_timeout usage
...
if(dlg_set_timeout("180", "123", "456"))
{
This function can be used from ANY_ROUTE.
- Example 1.70. dlg_set_timeout_by_profile usage
+ Example 1.71. dlg_set_timeout_by_profile usage
...
# All dialogs belonging to user abc123 (tracked via set_dlg_profile())
# will be timed out in 3 seconds.
This function can be used from ANY_ROUTE.
- Example 1.71. dlg_set_property usage
+ Example 1.72. dlg_set_property usage
...
dlg_set_property("ka-src");
dlg_set_property("ka-dst");
This function can be used from ANY_ROUTE.
- Example 1.72. dlg_remote_profile usage
+ Example 1.73. dlg_remote_profile usage
...
$var(exp) = 3600 + $Ts;
dlg_remote_profile("add", "caller", "test", "$sruid", "$var(exp)");
3.31. outbound_proxy (str)
3.32. ds_default_socket (str)
3.33. ds_timer_mode (int)
+ 3.34. event_callback (str)
4. Functions
1.32. Set the “outbound_proxy” parameter
1.33. Set the “ds_default_socket” parameter
1.34. Set the “ds_timer_mode” parameter
- 1.35. ds_select_dst usage
- 1.36. ds_select_domain usage
- 1.37. ds_select usage
- 1.38. ds_mark_dst usage
- 1.39. ds_list_exist usage
- 1.40. ds_is_from_list usage
- 1.41. ds_load_unset usage
- 1.42. dispatcher list file
- 1.43. Kamailio config script - sample dispatcher usage
+ 1.35. Set event_callback parameter
+ 1.36. ds_select_dst usage
+ 1.37. ds_select_domain usage
+ 1.38. ds_select usage
+ 1.39. ds_mark_dst usage
+ 1.40. ds_list_exist usage
+ 1.41. ds_is_from_list usage
+ 1.42. ds_load_unset usage
+ 1.43. dispatcher list file
+ 1.44. Kamailio config script - sample dispatcher usage
Chapter 1. Admin Guide
3.31. outbound_proxy (str)
3.32. ds_default_socket (str)
3.33. ds_timer_mode (int)
+ 3.34. event_callback (str)
4. Functions
3.31. outbound_proxy (str)
3.32. ds_default_socket (str)
3.33. ds_timer_mode (int)
+ 3.34. event_callback (str)
3.1. list_file (string)
modparam("dispatcher", "ds_timer_mode", 1)
...
+3.34. event_callback (str)
+
+ The name of the function in the kemi configuration file (embedded
+ scripting language such as Lua, Python, ...) to be executed instead of
+ event_route[...] blocks.
+
+ The function receives a string parameter with the name of the event,
+ the values are: 'dispatcher:dst-down', 'dispatcher:dst-up'.
+
+ Default value is 'empty' (no function is executed for events).
+
+ Example 1.35. Set event_callback parameter
+...
+modparam("dispatcher", "event_callback", "ksr_dispatcher_event")
+...
+-- event callback function implemented in Lua
+function ksr_dispatcher_event(evname)
+ KSR.info("===== dispatcher module triggered event: " .. evname .. "\n");
+ return 1;
+end
+...
+
4. Functions
4.1. ds_select_dst(set, alg[, limit])
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
- Example 1.35. ds_select_dst usage
+ Example 1.36. ds_select_dst usage
...
ds_select_dst("1", "0");
...
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
- Example 1.36. ds_select_domain usage
+ Example 1.37. ds_select_domain usage
...
$var(a) = 4;
if(ds_select_domain("1", "$var(a)")) {
This function can be used from ANY_ROUTE.
- Example 1.37. ds_select usage
+ Example 1.38. ds_select usage
...
$var(a) = 4;
if(ds_select("1", "$var(a)")) {
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
- Example 1.38. ds_mark_dst usage
+ Example 1.39. ds_mark_dst usage
...
failure_route[tryagain] {
...
This function can be used from ANY_ROUTE.
- Example 1.39. ds_list_exist usage
+ Example 1.40. ds_list_exist usage
...
if(ds_list_exist("10")) {
...
This function can be used from ANY_ROUTE.
- Example 1.40. ds_is_from_list usage
+ Example 1.41. ds_is_from_list usage
...
if(ds_is_from_list()) {
...
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE and ONREPLY_ROUTE.
- Example 1.41. ds_load_unset usage
+ Example 1.42. ds_load_unset usage
...
route {
...
For database, each element of a line resides in a different column.
Next is a dispatcher.list file example:
- Example 1.42. dispatcher list file
+ Example 1.43. dispatcher list file
...
# $Id$
# dispatcher destination sets
Next listing shows a sample config for using the dispatcher module.
- Example 1.43. Kamailio config script - sample dispatcher usage
+ Example 1.44. Kamailio config script - sample dispatcher usage
...
#!KAMAILIO
#
1. Admin Guide
- 1.1. Overview
- 1.2. Dependencies
-
- 1.2.1. Kamailio Modules
- 1.2.2. External Libraries or Applications
- 1.2.3. Loading from database
-
- 1.3. Parameters
-
- 1.3.1. htable (str)
- 1.3.2. db_url (str)
- 1.3.3. key_name_column (str)
- 1.3.4. key_type_column (str)
- 1.3.5. value_type_column (str)
- 1.3.6. key_value_column (str)
- 1.3.7. expires_column (str)
- 1.3.8. array_size_suffix (str)
- 1.3.9. fetch_rows (integer)
- 1.3.10. timer_interval (integer)
- 1.3.11. db_expires (integer)
- 1.3.12. enable_dmq (integer)
- 1.3.13. timer_procs (integer)
- 1.3.14. event_callback (str)
-
- 1.4. Functions
-
- 1.4.1. sht_print()
- 1.4.2. sht_rm_name_re(htable=>regexp)
- 1.4.3. sht_rm_value_re(htable=>regexp)
- 1.4.4. sht_reset(htable)
- 1.4.5. sht_lock(htable=>key)
- 1.4.6. sht_unlock(htable=>key)
- 1.4.7. sht_iterator_start(iname, hname)
- 1.4.8. sht_iterator_end(iname)
- 1.4.9. sht_iterator_next(iname)
-
- 1.5. Exported pseudo-variables
- 1.6. RPC Commands
-
- 1.6.1. htable.get htable key
- 1.6.2. htable.delete htable key
- 1.6.3. htable.sets htable key value
- 1.6.4. htable.seti htable key value
- 1.6.5. htable.dump htable
- 1.6.6. htable.reload htable
- 1.6.7. htable.listTables
- 1.6.8. htable.stats
-
- 1.7. Event routes
-
- 1.7.1. htable:mod-init
- 1.7.2. htable:expired:<table>
+ 1. Overview
+ 2. Dependencies
+
+ 2.1. Kamailio Modules
+ 2.2. External Libraries or Applications
+ 2.3. Loading from database
+
+ 3. Parameters
+
+ 3.1. htable (str)
+ 3.2. db_url (str)
+ 3.3. key_name_column (str)
+ 3.4. key_type_column (str)
+ 3.5. value_type_column (str)
+ 3.6. key_value_column (str)
+ 3.7. expires_column (str)
+ 3.8. array_size_suffix (str)
+ 3.9. fetch_rows (integer)
+ 3.10. timer_interval (integer)
+ 3.11. db_expires (integer)
+ 3.12. enable_dmq (integer)
+ 3.13. timer_procs (integer)
+ 3.14. event_callback (str)
+
+ 4. Functions
+
+ 4.1. sht_print()
+ 4.2. sht_rm_name_re(htable=>regexp)
+ 4.3. sht_rm_value_re(htable=>regexp)
+ 4.4. sht_reset(htable)
+ 4.5. sht_lock(htable=>key)
+ 4.6. sht_unlock(htable=>key)
+ 4.7. sht_iterator_start(iname, hname)
+ 4.8. sht_iterator_end(iname)
+ 4.9. sht_iterator_next(iname)
+
+ 5. Exported pseudo-variables
+ 6. RPC Commands
+
+ 6.1. htable.get htable key
+ 6.2. htable.delete htable key
+ 6.3. htable.sets htable key value
+ 6.4. htable.seti htable key value
+ 6.5. htable.dump htable
+ 6.6. htable.reload htable
+ 6.7. htable.listTables
+ 6.8. htable.stats
+
+ 7. Event routes
+
+ 7.1. htable:mod-init
+ 7.2. htable:expired:<table>
List of Examples
Chapter 1. Admin Guide
-1.1. Overview
+ Table of Contents
+
+ 1. Overview
+ 2. Dependencies
+
+ 2.1. Kamailio Modules
+ 2.2. External Libraries or Applications
+ 2.3. Loading from database
+
+ 3. Parameters
+
+ 3.1. htable (str)
+ 3.2. db_url (str)
+ 3.3. key_name_column (str)
+ 3.4. key_type_column (str)
+ 3.5. value_type_column (str)
+ 3.6. key_value_column (str)
+ 3.7. expires_column (str)
+ 3.8. array_size_suffix (str)
+ 3.9. fetch_rows (integer)
+ 3.10. timer_interval (integer)
+ 3.11. db_expires (integer)
+ 3.12. enable_dmq (integer)
+ 3.13. timer_procs (integer)
+ 3.14. event_callback (str)
+
+ 4. Functions
+
+ 4.1. sht_print()
+ 4.2. sht_rm_name_re(htable=>regexp)
+ 4.3. sht_rm_value_re(htable=>regexp)
+ 4.4. sht_reset(htable)
+ 4.5. sht_lock(htable=>key)
+ 4.6. sht_unlock(htable=>key)
+ 4.7. sht_iterator_start(iname, hname)
+ 4.8. sht_iterator_end(iname)
+ 4.9. sht_iterator_next(iname)
+
+ 5. Exported pseudo-variables
+ 6. RPC Commands
+
+ 6.1. htable.get htable key
+ 6.2. htable.delete htable key
+ 6.3. htable.sets htable key value
+ 6.4. htable.seti htable key value
+ 6.5. htable.dump htable
+ 6.6. htable.reload htable
+ 6.7. htable.listTables
+ 6.8. htable.stats
+
+ 7. Event routes
+
+ 7.1. htable:mod-init
+ 7.2. htable:expired:<table>
+
+1. Overview
The module adds a hash table container to the configuration language.
The hash table is stored in shared memory and the access to it can be
}
}
-1.2. Dependencies
+2. Dependencies
-1.2.1. Kamailio Modules
+ 2.1. Kamailio Modules
+ 2.2. External Libraries or Applications
+ 2.3. Loading from database
+
+2.1. Kamailio Modules
The following modules must be loaded before this module:
* If DMQ replication is enabled, the DMQ module must be loaded
first..
-1.2.2. External Libraries or Applications
+2.2. External Libraries or Applications
The following libraries or applications must be installed before
running Kamailio with this module loaded:
* None.
-1.2.3. Loading from database
+2.3. Loading from database
The module is able to load values in a hash table at startup upon
providing a DB URL and table name.
+ 1 - value is integer.
* key value - string containing the value of the key.
-1.3. Parameters
-
-1.3.1. htable (str)
+3. Parameters
+
+ 3.1. htable (str)
+ 3.2. db_url (str)
+ 3.3. key_name_column (str)
+ 3.4. key_type_column (str)
+ 3.5. value_type_column (str)
+ 3.6. key_value_column (str)
+ 3.7. expires_column (str)
+ 3.8. array_size_suffix (str)
+ 3.9. fetch_rows (integer)
+ 3.10. timer_interval (integer)
+ 3.11. db_expires (integer)
+ 3.12. enable_dmq (integer)
+ 3.13. timer_procs (integer)
+ 3.14. event_callback (str)
+
+3.1. htable (str)
The definition of a hash table. The value of the parameter may have the
following format:
;")
...
-1.3.2. db_url (str)
+3.2. db_url (str)
The URL to connect to database for loading values in hash table at
start up.
modparam("htable", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
...
-1.3.3. key_name_column (str)
+3.3. key_name_column (str)
The name of the column containing the hash table key name.
modparam("htable", "key_name_column", "kname")
...
-1.3.4. key_type_column (str)
+3.4. key_type_column (str)
The name of the column containing the hash table key type.
modparam("htable", "key_type_column", "ktype")
...
-1.3.5. value_type_column (str)
+3.5. value_type_column (str)
The name of the column containing the hash table value type.
modparam("htable", "value_type_column", "vtype")
...
-1.3.6. key_value_column (str)
+3.6. key_value_column (str)
The name of the column containing hash table key value.
modparam("htable", "key_value_column", "kvalue")
...
-1.3.7. expires_column (str)
+3.7. expires_column (str)
The name of the column containing the expires value.
modparam("htable", "expires_column", "expiry")
...
-1.3.8. array_size_suffix (str)
+3.8. array_size_suffix (str)
The suffix to be added to store the number of items in an array (see
key type).
modparam("htable", "array_size_suffix", "-count")
...
-1.3.9. fetch_rows (integer)
+3.9. fetch_rows (integer)
How many rows to fetch at once from database.
modparam("htable", "fetch_rows", 1000)
...
-1.3.10. timer_interval (integer)
+3.10. timer_interval (integer)
Interval in seconds to check for expired htable values.
modparam("htable", "timer_interval", 10)
...
-1.3.11. db_expires (integer)
+3.11. db_expires (integer)
If set to 1, the module will load/save the expires values of the items
in hash table from/to database. It applies only to hash tables that
modparam("htable", "db_expires", 1)
...
-1.3.12. enable_dmq (integer)
+3.12. enable_dmq (integer)
If set to 1, will enable DMQ replication of actions performed upon
entries in all tables having "dmqreplicate" parameter set. Any update
modparam("htable", "enable_dmq", 1)
...
-1.3.13. timer_procs (integer)
+3.13. timer_procs (integer)
If set to 1 or greater, the module will create its own timer processes
to scan for expired items in hash tables. If set to zero, it will use
modparam("htable", "timer_procs", 4)
...
-1.3.14. event_callback (str)
+3.14. event_callback (str)
The name of the function in the kemi configuration file (embedded
scripting language such as Lua, Python, ...) to be executed instead of
- event_route[...] blocks. The function receives a string parameter with
- the name of the event.
+ event_route[...] blocks.
+
+ The function receives a string parameter with the name of the event,
+ the values can be: 'htable:mod-init', 'htable:expired:htname' ('htname'
+ being the name of hash table).
Default value is 'empty' (no function is executed for events).
end
...
-1.4. Functions
+4. Functions
+
+ 4.1. sht_print()
+ 4.2. sht_rm_name_re(htable=>regexp)
+ 4.3. sht_rm_value_re(htable=>regexp)
+ 4.4. sht_reset(htable)
+ 4.5. sht_lock(htable=>key)
+ 4.6. sht_unlock(htable=>key)
+ 4.7. sht_iterator_start(iname, hname)
+ 4.8. sht_iterator_end(iname)
+ 4.9. sht_iterator_next(iname)
-1.4.1. sht_print()
+4.1. sht_print()
Dump content of hash table to L_ERR log level. Intended for debug
purposes.
sht_print();
...
-1.4.2. sht_rm_name_re(htable=>regexp)
+4.2. sht_rm_name_re(htable=>regexp)
Delete all entries in the htable that match the name against regular
expression.
sht_rm_name_re("ha=>.*");
...
-1.4.3. sht_rm_value_re(htable=>regexp)
+4.3. sht_rm_value_re(htable=>regexp)
Delete all entries in the htable that match the value against regular
expression.
sht_rm_value_re("ha=>.*");
...
-1.4.4. sht_reset(htable)
+4.4. sht_reset(htable)
Delete all entries in the htable. The name of the hash table can be a
dynamic string with variables.
sht_reset("ha$var(x)");
...
-1.4.5. sht_lock(htable=>key)
+4.5. sht_lock(htable=>key)
Lock the slot in htable corresponding to the key item. Note that the
locking is re-entrant for the process, therefore the lock and unlock
sht_lock("ha=>test");
...
-1.4.6. sht_unlock(htable=>key)
+4.6. sht_unlock(htable=>key)
Unlock the slot in htable corespoding to the key item. Note that the
locking is re-entrant for the process, therefore the lock and unlock
sht_unlock("ha=>test");
...
-1.4.7. sht_iterator_start(iname, hname)
+4.7. sht_iterator_start(iname, hname)
Start an iterator for hash table named by the value of parameter hname.
The parameter iname is used to identify the iterator. There can be up
sht_iterator_start("i1", "h1");
...
-1.4.8. sht_iterator_end(iname)
+4.8. sht_iterator_end(iname)
Close the iterator identified by iname parameter and release the hash
table slot aquired by the iterator. The iname value must be the same
sht_iterator_end("i1");
...
-1.4.9. sht_iterator_next(iname)
+4.9. sht_iterator_next(iname)
Move the iterator to the next item in hash table. It must be called
also after sht_iterator_start() to get the first item in the hash
sht_iterator_end("i1");
...
-1.5. Exported pseudo-variables
+5. Exported pseudo-variables
* $sht(htable=>key)
* $shtex(htable=>key)
Exported pseudo-variables are documented at
http://www.kamailio.org/wiki/.
-1.6. RPC Commands
+6. RPC Commands
-1.6.1. htable.get htable key
+ 6.1. htable.get htable key
+ 6.2. htable.delete htable key
+ 6.3. htable.sets htable key value
+ 6.4. htable.seti htable key value
+ 6.5. htable.dump htable
+ 6.6. htable.reload htable
+ 6.7. htable.listTables
+ 6.8. htable.stats
+
+6.1. htable.get htable key
Lists one value in a hash table
kamcmd htable.get students course[0]
...
-1.6.2. htable.delete htable key
+6.2. htable.delete htable key
Delete one value in a hash table
kamcmd htable.delete students course[0]
...
-1.6.3. htable.sets htable key value
+6.3. htable.sets htable key value
Set an item in hash table to string value.
kamcmd htable.sets test x[0] abc
...
-1.6.4. htable.seti htable key value
+6.4. htable.seti htable key value
Set an item in hash table to integer value.
kamcmd htable.sets test x[0] 123
...
-1.6.5. htable.dump htable
+6.5. htable.dump htable
Lists all the values in a hash table
kamcmd htable.dump ipban
...
-1.6.6. htable.reload htable
+6.6. htable.reload htable
Reload hash table from database.
kamcmd htable.reload ipban
...
-1.6.7. htable.listTables
+6.7. htable.listTables
Lists all defined tables
kamcmd htable.listTables
...
-1.6.8. htable.stats
+6.8. htable.stats
Get statistics for hash tables - name, number of slots, number of
items, max number of items per slot, min number of items per slot.
kamcmd htable.stats
...
-1.7. Event routes
+7. Event routes
+
+ 7.1. htable:mod-init
+ 7.2. htable:expired:<table>
-1.7.1. htable:mod-init
+7.1. htable:mod-init
When defined, the module calls event_route[htable:mod-init] after all
modules have been initialized. A typical use case is to initialise
}
...
-1.7.2. htable:expired:<table>
+7.2. htable:expired:<table>
When defined, the module calls event_route[htable:expired:<table>] when
an entry in the given table expires. In this event route, the key and
<misak@uni-tel.dk>
+Carsten Bock
+
+ <carsten@ng-voice.com>
+
Copyright © 2011 asipto.com
Copyright © 2012 www.systemonenoc.com
+
+ Copyright © 2017 ng-voice GmbH
__________________________________________________________________
Table of Contents
3.2. init_without_redis (integer)
3.3. connect_timeout (int)
3.4. cmd_timeout (int)
+ 3.5. cluster (integer)
4. Functions
1.2. Set init_without_redis parameter
1.3. Set connect_timeout parameter
1.4. Set cmd_timeout parameter
- 1.5. redis_cmd usage
- 1.6. redis_free usage
+ 1.5. Set cluster parameter
+ 1.6. redis_cmd usage
+ 1.7. redis_free usage
Chapter 1. Admin Guide
3.2. init_without_redis (integer)
3.3. connect_timeout (int)
3.4. cmd_timeout (int)
+ 3.5. cluster (integer)
4. Functions
3.2. init_without_redis (integer)
3.3. connect_timeout (int)
3.4. cmd_timeout (int)
+ 3.5. cluster (integer)
3.1. server (str)
modparam("ndb_redis", "cmd_timeout", 500)
...
+3.5. cluster (integer)
+
+ If set to 1, the module will connect to servers indicated in the
+ "MOVED" reply.
+
+ Default value is “0” (disabled).
+
+ Example 1.5. Set cluster parameter
+...
+modparam("ndb_redis", "cluster", 1)
+...
+
4. Functions
4.1. redis_cmd(srvname, command, ..., replyid)
* value[n] - returns value of the nth element. value - returns null
for an array. You need to get each element by index.
- Example 1.5. redis_cmd usage
+ Example 1.6. redis_cmd usage
...
if(redis_cmd("srvN", "INCR cnt", "r")) {
# success - the incremented value is in $redis(r=>value)
function. When ndb_redis module closes, all pending replies are freed
automatically.
- Example 1.6. redis_free usage
+ Example 1.7. redis_free usage
...
After a redis command call:
redis_cmd("srvN", "INCR cnt", "r");
2. Dependencies
3. Functions
- 3.1. sipt_destination(destination, hops, nai)
+ 3.1. sipt_destination(destination, hops, nai[,
+ terminator=1])
+
3.2. sipt_set_bci_1(charge_indicator, called_status,
called_category, e2e_indicator)
2. Dependencies
3. Functions
- 3.1. sipt_destination(destination, hops, nai)
+ 3.1. sipt_destination(destination, hops, nai[, terminator=1])
3.2. sipt_set_bci_1(charge_indicator, called_status,
called_category, e2e_indicator)
3. Functions
- 3.1. sipt_destination(destination, hops, nai)
+ 3.1. sipt_destination(destination, hops, nai[, terminator=1])
3.2. sipt_set_bci_1(charge_indicator, called_status, called_category,
e2e_indicator)
3.3. sipt_set_calling(origin, nai, presentation, screening)
-3.1. sipt_destination(destination, hops, nai)
+3.1. sipt_destination(destination, hops, nai[, terminator=1])
updates the IAM in the body if it exists, setting the called party
number to “destination” with the nature address specified in “nai” and
decrementing the hop counter value if present. If the hop counter
- header is missing it will be added with the value of “hops”.
+ header is missing it will be added with the value of “hops”. If
+ “terminator” is set to 1, then F will be appened to digit string to
+ indicate the number is complete (default).
Example 1.1. sipt_destination(destination, hops, nai) usage
...
3.23. timer_interval (integer)
3.24. db_url (string)
3.25. db_mode (integer)
- 3.26. matching_mode (integer)
- 3.27. cseq_delay (integer)
- 3.28. fetch_rows (integer)
- 3.29. hash_size (integer)
- 3.30. preload (string)
- 3.31. db_update_as_insert (string)
- 3.32. db_check_update (string)
- 3.33. timer_procs (string)
- 3.34. xavp_contact (string)
- 3.35. db_ops_ruid (int)
- 3.36. handle_lost_tcp (int)
- 3.37. close_expired_tcp (int)
- 3.38. expires_type (int)
- 3.39. db_raw_fetch_type (int)
- 3.40. db_insert_null (int)
- 3.41. skip_remote_socket (int)
- 3.42. db_timer_clean (int)
+ 3.26. db_load (integer)
+ 3.27. db_insert_update (integer)
+ 3.28. matching_mode (integer)
+ 3.29. cseq_delay (integer)
+ 3.30. fetch_rows (integer)
+ 3.31. hash_size (integer)
+ 3.32. preload (string)
+ 3.33. db_update_as_insert (string)
+ 3.34. db_check_update (string)
+ 3.35. timer_procs (string)
+ 3.36. xavp_contact (string)
+ 3.37. db_ops_ruid (int)
+ 3.38. handle_lost_tcp (int)
+ 3.39. close_expired_tcp (int)
+ 3.40. expires_type (int)
+ 3.41. db_raw_fetch_type (int)
+ 3.42. db_insert_null (int)
+ 3.43. skip_remote_socket (int)
+ 3.44. db_timer_clean (int)
4. RPC Commands
1.23. Set timer_interval parameter
1.24. Set db_url parameter
1.25. Set db_mode parameter
- 1.26. Set matching_mode parameter
- 1.27. Set cseq_delay parameter
- 1.28. Set fetch_rows parameter
- 1.29. Set hash_size parameter
- 1.30. Set preload parameter
- 1.31. Set db_update_as_insert parameter
- 1.32. Set db_check_update parameter
- 1.33. Set timer_procs parameter
- 1.34. Set xavp_contact parameter
- 1.35. Set db_ops_ruid parameter
- 1.36. Set handle_lost_tcp parameter
- 1.37. Set close_expired_tcp parameter
- 1.38. Set expires_type parameter
- 1.39. Set db_raw_fetch_type parameter
- 1.40. Set db_insert_null parameter
- 1.41. Set skip_remote_socket parameter
- 1.42. Set db_timer_clean parameter
+ 1.26. Set db_load parameter
+ 1.27. Set db_insert_update parameter
+ 1.28. Set matching_mode parameter
+ 1.29. Set cseq_delay parameter
+ 1.30. Set fetch_rows parameter
+ 1.31. Set hash_size parameter
+ 1.32. Set preload parameter
+ 1.33. Set db_update_as_insert parameter
+ 1.34. Set db_check_update parameter
+ 1.35. Set timer_procs parameter
+ 1.36. Set xavp_contact parameter
+ 1.37. Set db_ops_ruid parameter
+ 1.38. Set handle_lost_tcp parameter
+ 1.39. Set close_expired_tcp parameter
+ 1.40. Set expires_type parameter
+ 1.41. Set db_raw_fetch_type parameter
+ 1.42. Set db_insert_null parameter
+ 1.43. Set skip_remote_socket parameter
+ 1.44. Set db_timer_clean parameter
Chapter 1. Admin Guide
3.23. timer_interval (integer)
3.24. db_url (string)
3.25. db_mode (integer)
- 3.26. matching_mode (integer)
- 3.27. cseq_delay (integer)
- 3.28. fetch_rows (integer)
- 3.29. hash_size (integer)
- 3.30. preload (string)
- 3.31. db_update_as_insert (string)
- 3.32. db_check_update (string)
- 3.33. timer_procs (string)
- 3.34. xavp_contact (string)
- 3.35. db_ops_ruid (int)
- 3.36. handle_lost_tcp (int)
- 3.37. close_expired_tcp (int)
- 3.38. expires_type (int)
- 3.39. db_raw_fetch_type (int)
- 3.40. db_insert_null (int)
- 3.41. skip_remote_socket (int)
- 3.42. db_timer_clean (int)
+ 3.26. db_load (integer)
+ 3.27. db_insert_update (integer)
+ 3.28. matching_mode (integer)
+ 3.29. cseq_delay (integer)
+ 3.30. fetch_rows (integer)
+ 3.31. hash_size (integer)
+ 3.32. preload (string)
+ 3.33. db_update_as_insert (string)
+ 3.34. db_check_update (string)
+ 3.35. timer_procs (string)
+ 3.36. xavp_contact (string)
+ 3.37. db_ops_ruid (int)
+ 3.38. handle_lost_tcp (int)
+ 3.39. close_expired_tcp (int)
+ 3.40. expires_type (int)
+ 3.41. db_raw_fetch_type (int)
+ 3.42. db_insert_null (int)
+ 3.43. skip_remote_socket (int)
+ 3.44. db_timer_clean (int)
4. RPC Commands
check the Call-ID only (independent of the Contact-Header or Path).
To find out how to control/select the contact maching algorithm, please
- see the module parameter matching_mode - Section 3.26, “matching_mode
+ see the module parameter matching_mode - Section 3.28, “matching_mode
(integer)”.
2. Dependencies
3.23. timer_interval (integer)
3.24. db_url (string)
3.25. db_mode (integer)
- 3.26. matching_mode (integer)
- 3.27. cseq_delay (integer)
- 3.28. fetch_rows (integer)
- 3.29. hash_size (integer)
- 3.30. preload (string)
- 3.31. db_update_as_insert (string)
- 3.32. db_check_update (string)
- 3.33. timer_procs (string)
- 3.34. xavp_contact (string)
- 3.35. db_ops_ruid (int)
- 3.36. handle_lost_tcp (int)
- 3.37. close_expired_tcp (int)
- 3.38. expires_type (int)
- 3.39. db_raw_fetch_type (int)
- 3.40. db_insert_null (int)
- 3.41. skip_remote_socket (int)
- 3.42. db_timer_clean (int)
+ 3.26. db_load (integer)
+ 3.27. db_insert_update (integer)
+ 3.28. matching_mode (integer)
+ 3.29. cseq_delay (integer)
+ 3.30. fetch_rows (integer)
+ 3.31. hash_size (integer)
+ 3.32. preload (string)
+ 3.33. db_update_as_insert (string)
+ 3.34. db_check_update (string)
+ 3.35. timer_procs (string)
+ 3.36. xavp_contact (string)
+ 3.37. db_ops_ruid (int)
+ 3.38. handle_lost_tcp (int)
+ 3.39. close_expired_tcp (int)
+ 3.40. expires_type (int)
+ 3.41. db_raw_fetch_type (int)
+ 3.42. db_insert_null (int)
+ 3.43. skip_remote_socket (int)
+ 3.44. db_timer_clean (int)
3.1. nat_bflag (integer)
modparam("usrloc", "db_mode", 2)
...
-3.26. matching_mode (integer)
+3.26. db_load (integer)
+
+ Determine if the usrloc module should load contacts from the database
+ storage during module initialization A value of 0 disable the loading
+ from the database, this parameter is ignored if db_mode 4 is set
+
+ Default value is 1.
+
+ Example 1.26. Set db_load parameter
+...
+modparam("usrloc", "db_load", "0")
+...
+
+3.27. db_insert_update (integer)
+
+ Determine if the usrloc module should do an update when a duplicate key
+ is found while inserting A value of 1 will activate update on duplicate
+ key
+
+ Default value is 0.
+
+ Example 1.27. Set db_insert_update parameter
+...
+modparam("usrloc", "db_insert_update", "1")
+...
+
+3.28. matching_mode (integer)
What contact matching algorithm to be used. Refer to section
Section 1.1, “Contact matching” for the description of the algorithms.
Default value is 0 (CONTACT_ONLY).
- Example 1.26. Set matching_mode parameter
+ Example 1.28. Set matching_mode parameter
...
modparam("usrloc", "matching_mode", 1)
...
-3.27. cseq_delay (integer)
+3.29. cseq_delay (integer)
Delay (in seconds) for accepting as retransmissions register requests
with same Call-ID and Cseq. The delay is calculated starting from the
Default value is “20 seconds”.
- Example 1.27. Set cseq_delay parameter
+ Example 1.29. Set cseq_delay parameter
...
modparam("usrloc", "cseq_delay", 5)
...
-3.28. fetch_rows (integer)
+3.30. fetch_rows (integer)
The number of the rows to be fetched at once from database when loading
the location records. This value can be used to tune the load time at
Default value is “2000”.
- Example 1.28. Set fetch_rows parameter
+ Example 1.30. Set fetch_rows parameter
...
modparam("usrloc", "fetch_rows", 3000)
...
-3.29. hash_size (integer)
+3.31. hash_size (integer)
The number of entries of the hash table used by usrloc to store the
location records is 2^hash_size. For hash_size=4, the number of slots
Default value is “10” (1024 slots).
- Example 1.29. Set hash_size parameter
+ Example 1.31. Set hash_size parameter
...
modparam("usrloc", "hash_size", 12)
...
-3.30. preload (string)
+3.32. preload (string)
Preload location table given as value. A location table is loaded based
on fixup of registrar functions, therefore you need to use this
Default value is “NULL”.
- Example 1.30. Set preload parameter
+ Example 1.32. Set preload parameter
...
modparam("usrloc", "preload", "location")
...
-3.31. db_update_as_insert (string)
+3.33. db_update_as_insert (string)
Set this parameter if you want to do INSERT DB operations instead of
UPDATE DB operations. It is recommended to set this parameter if you
Default value is “0”.
- Example 1.31. Set db_update_as_insert parameter
+ Example 1.33. Set db_update_as_insert parameter
...
modparam("usrloc", "db_update_as_insert", 1)
...
-3.32. db_check_update (string)
+3.34. db_check_update (string)
Set this parameter to 1 if you want to do DB INSERT if the number of
affected rows by contact DB UPDATE operation is 0. The database module
Default value is “0” (no DB INSERT).
- Example 1.32. Set db_check_update parameter
+ Example 1.34. Set db_check_update parameter
...
modparam("usrloc", "db_check_update", 1)
...
-3.33. timer_procs (string)
+3.35. timer_procs (string)
Number of timer processes to be started by module. Timer processes take
care of checking expired records and syncronization with database. If
Default value is “0”.
- Example 1.33. Set timer_procs parameter
+ Example 1.35. Set timer_procs parameter
...
modparam("usrloc", "timer_procs", 4)
...
-3.34. xavp_contact (string)
+3.36. xavp_contact (string)
The name of XAVP storing the attributes per contact. They are saved in
location record and restored at lookup. The tm module parameter
Default value is “NULL”.
- Example 1.34. Set xavp_contact parameter
+ Example 1.36. Set xavp_contact parameter
...
modparam("usrloc", "xavp_contact", "ulattrs")
...
-3.35. db_ops_ruid (int)
+3.37. db_ops_ruid (int)
If set to 1, database queries for update or delete are done using ruid
value. If it is set to 0, the old style using aor, contact and call-id
Default value is “1”.
- Example 1.35. Set db_ops_ruid parameter
+ Example 1.37. Set db_ops_ruid parameter
...
modparam("usrloc", "db_ops_ruid", 0)
...
-3.36. handle_lost_tcp (int)
+3.38. handle_lost_tcp (int)
If set to 1, Kamailio will remove location records made via
TCP/TLS/WS/WSS transports when it looses corresponding tcp connections.
Default value is “0”.
- Example 1.36. Set handle_lost_tcp parameter
+ Example 1.38. Set handle_lost_tcp parameter
...
modparam("usrloc", "handle_lost_tcp", 1)
...
-3.37. close_expired_tcp (int)
+3.39. close_expired_tcp (int)
If set to 1, Kamailio will close the TCP connection when a contact has
expired, if the corresponding transport is TCP/TLS/WS/WSS.
Default value is “0”.
- Example 1.37. Set close_expired_tcp parameter
+ Example 1.39. Set close_expired_tcp parameter
...
modparam("usrloc", "close_expired_tcp", 1)
...
-3.38. expires_type (int)
+3.40. expires_type (int)
If set to 1, Kamailio expects to deal with BIGINT type on database
columns for expires and last modified values. It allows to handle
Default value is “0”.
- Example 1.38. Set expires_type parameter
+ Example 1.40. Set expires_type parameter
...
modparam("usrloc", "expires_type", 1)
...
-3.39. db_raw_fetch_type (int)
+3.41. db_raw_fetch_type (int)
This affect DB-only mode and controls what kind of raw query is used to
fetch the contacts from database for specific needs (e.g., sending NAT
Default value is “0”.
- Example 1.39. Set db_raw_fetch_type parameter
+ Example 1.41. Set db_raw_fetch_type parameter
...
modparam("usrloc", "db_raw_fetch_type", 1)
...
-3.40. db_insert_null (int)
+3.42. db_insert_null (int)
If set to 1, the insert operation to database will add null values in
the sql statement.
Default value is “0” (don't add null fields in insert statement).
- Example 1.40. Set db_insert_null parameter
+ Example 1.42. Set db_insert_null parameter
...
modparam("usrloc", "db_insert_null", 1)
...
-3.41. skip_remote_socket (int)
+3.43. skip_remote_socket (int)
If set to 1, Kamailio will skip location record when loading from
database, if socket value of the record does not in kamailio listening
Default value is “0”.
- Example 1.41. Set skip_remote_socket parameter
+ Example 1.43. Set skip_remote_socket parameter
...
modparam("usrloc", "skip_remote_socket", 1)
...
-3.42. db_timer_clean (int)
+3.44. db_timer_clean (int)
Enable (1) or disable (0) cleaning of expired db records on timer basis
for db_mode WRITE-BACK and WRITE-THROUGH. It uses the secondary timer
Default value is “0”.
- Example 1.42. Set db_timer_clean parameter
+ Example 1.44. Set db_timer_clean parameter
...
modparam("usrloc", "db_timer_clean", 1)
...