src/modules/htable/doc/htable_admin.xml
33d03d8d
 <?xml version="1.0" encoding='ISO-8859-1'?>
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
 
 <!-- Include general documentation entities -->
6deb5fcf
 <!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
33d03d8d
 %docentities;
 
 ]>
d02426aa
 <!-- Module User's Guide -->
 
 <chapter>
6dd359e3
 
d02426aa
 	<title>&adminguide;</title>
6dd359e3
 
d02426aa
 	<section>
 	<title>Overview</title>
 	<para>
3cefc3b3
 		The module adds a hash table container to the configuration language. The
d02426aa
 		hash table is stored in shared memory and the access to it can be
8431de38
 		done via pseudo-variables: $sht(htname=&gt;name). The module supports
 		definition of many hash tables and can load values at startup from
 		a database table.
 	</para>
 	<para>
 		A typical use case for the SIP server is to implement a cache system
 		in configuration file - if a value is not found in hash table, load
 		it from database and store it in hash table so next time the access to
 		it is very fast. In the definition of the table you can define the
 		default expiration time of cached items. The expiration time can
3cefc3b3
 		be adjusted per item via assignment operation at runtime.
8431de38
 	</para>
c9395e69
 	<para>
6dd359e3
 		Replication between multiple servers is performed automatically (if
c9395e69
 		enabled) via the DMQ module.
 	</para>
8431de38
 	<para>
 		You can read more about hash tables at:
 		http://en.wikipedia.org/wiki/Hash_table.
d02426aa
 	</para>
 	<para>
 		The <quote>name</quote> can be a static string or can include pseudo-
 		variables that will be replaced at runtime.
 	</para>
 	<example>
58fa97dd
 		<title>Accessing $sht(htname=&gt;key)</title>
d02426aa
 	<programlisting format="linespecific">
 ...
1962f98b
 modparam("htable", "htable", "a=&gt;size=8;")
58fa97dd
 ...
 $sht(a=&gt;test) = 1;
 $sht(a=&gt;$ci::srcip) = $si;
d02426aa
 ...
 </programlisting>
 	</example>
 	<para>
9bf13e03
 		The next example shows a way to protect against dictionary attacks. If
 		someone fails to authenticate 3 times, it is forbidden for 15 minutes.
9d48bb4a
 		Authentication against database is expensive as it does a select
9bf13e03
 		on the <quote>subscriber</quote> table. By disabling the DB auth for 15 minutes,
3cefc3b3
 		resources on the server are saved and time to discover the password is increased
d02426aa
 		substantially. Additional alerting can be done by writing a message
 		to syslog or sending email, etc.
 	</para>
 	<para>
3cefc3b3
 		To implement the logic, two hash table variables are used: one counting
9bf13e03
 		the failed authentications per user and one for storing the time of the
3cefc3b3
 		last authentication attempt. To ensure a unique name per user, the
d02426aa
 		hash table uses a combination of authentication username and text
 		<quote>::auth_count</quote> and <quote>::last_auth</quote>.
 	</para>
 	<example>
 	<title>Dictionary attack limitation</title>
 	<programlisting format="linespecific">
 ...
1962f98b
 modparam("htable", "htable", "a=&gt;size=8;")
58fa97dd
 ...
d02426aa
 if(is_present_hf("Authorization"))
 {
1b55a522
     if($sht(a=&gt;$au::auth_count)==3)
     {
fb47a505
 		$var(exp) = $Ts - 900;
         if($sht(a=&gt;$au::last_auth) &gt; $var(exp))
1b55a522
         {
             sl_send_reply("403", "Try later");
             exit;
         } else {
             $sht(a=&gt;$au::auth_count) = 0;
         }
     }
8431de38
     if(!www_authenticate("$td", "subscriber"))
1b55a522
     {
         switch ($retcode) {
             case -1:
                 sl_send_reply("403", "Forbidden");
             exit;
             case -2:
62c8fbb7
                 if($sht(a=&gt;$au::auth_count) == $null)
1b55a522
                     $sht(a=&gt;$au::auth_count) = 0;
                 $sht(a=&gt;$au::auth_count) = $sht(a=&gt;$au::auth_count) + 1;
                 if($sht(a=&gt;$au::auth_count) == 3)
                     xlog("auth failed 3rd time - src ip: $si\n");
                 $sht(a=&gt;$au::last_auth) = $Ts;
             break;
         }
8431de38
         www_challenge("$td"/*realm*/,"0"/*qop*/);
1b55a522
         exit;
     }
     $sht(a=&gt;$au::auth_count) = 0;
d02426aa
 } else {
8431de38
     www_challenge("$td","0");
1b55a522
     exit;
d02426aa
 }
 ...
2847c47d
 </programlisting>
 	</example>
 	<para>
 		The module also provides a way to store multiple values for a single key.
 		This is emulated by storing individual keys as 'key_name[n]', where n is
3cefc3b3
 		incremented for each key. The total number of keys is stored in a
2847c47d
 		dedicated key, by default: 'key_name::size'.
 	</para>
 	<para>
 		The array is built when the table is loaded in memory and afterwards all
 		the keys are treated as individual keys.
3cefc3b3
 		If a particular entry in the array is deleted, it is the administrator's
 		responsibility to update the size of the array and any other elements
2847c47d
 		(if required).
 	</para>
 	<example>
3cefc3b3
 	<title>Storing array values</title>
2847c47d
 	<programlisting format="linespecific">
 # Example of dbtext with multiple keys
 $ cat /usr/local/etc/kamailio/dbtext/htable
 1:key:1:0:value3:0
 2:key:1:0:value2:0
 3:key:1:0:value1:0
 
 # The array key will be loaded in memory in the following format:
 $ kamcmd htable.dump htable
 {
         entry: 35
         size: 1
         slot: {
                 item: {
                         name: key[0]
                         value: value1
                 }
         }
 }
 {
         entry: 50
         size: 1
         slot: {
                 item: {
                         name: key::size
                         value: 3
                 }
         }
 }
 {
         entry: 67
         size: 1
         slot: {
                 item: {
                         name: key[1]
                         value: value2
                 }
         }
 }
 {
         entry: 227
         size: 1
         slot: {
                 item: {
                         name: key[2]
                         value: value3
                 }
         }
 }
 
 # Now let's delete a particular entry in the array: key[0].
 $ kamcmd htable.delete htable key[0]
 
 # The array key will look like this after a key was deleted:
 $ kamcmd htable.dump htable
 {
         entry: 50
         size: 1
         slot: {
                 item: {
                         name: key::size
                         value: 3
                 }
         }
 }
 {
         entry: 67
         size: 1
         slot: {
                 item: {
                         name: key[1]
                         value: value2
                 }
         }
 }
 {
         entry: 227
         size: 1
         slot: {
                 item: {
                         name: key[2]
                         value: value3
                 }
         }
 }
d02426aa
 </programlisting>
 	</example>
 
 	</section>
 	<section>
 	<title>Dependencies</title>
 	<section>
 		<title>&kamailio; Modules</title>
 		<para>
 		The following modules must be loaded before this module:
 			<itemizedlist>
 			<listitem>
 			<para>
c9395e69
 				<emphasis>If DMQ replication is enabled, the DMQ module must be loaded first.</emphasis>.
d02426aa
 			</para>
 			</listitem>
 			</itemizedlist>
 		</para>
 	</section>
 	<section>
 		<title>External Libraries or Applications</title>
 		<para>
 		The following libraries or applications must be installed before running
 		&kamailio; with this module loaded:
 			<itemizedlist>
 			<listitem>
 			<para>
 				<emphasis>None</emphasis>.
 			</para>
 			</listitem>
 			</itemizedlist>
 		</para>
 	</section>
4c2338d3
 	<section>
 		<title>Loading from database</title>
 		<para>
3cefc3b3
 		The module is able to load values in a hash table at startup upon
4c2338d3
 		providing a DB URL and table name.
 		</para>
 		<para>
 			The structure of the table must contain:
 		</para>
 			<itemizedlist>
 			<listitem>
 			<para>
 				<emphasis>key name</emphasis> - string containing the name of
 				the key.
 			</para>
 			</listitem>
 			<listitem>
 			<para>
 				<emphasis>key type</emphasis> - the type of the key
 			</para>
 			<itemizedlist>
 				<listitem>
 				<para>
 					<emphasis>0</emphasis> - simple key - the key is added
 					as 'key_name'.
 				</para>
 				</listitem>
 				<listitem>
 				<para>
 					<emphasis>1</emphasis> - array key - the key is added
2847c47d
 					as 'key_name[n]' - n is incremented for each key with this
 					name to build an array in hash table.  In addition, an additional
 					key is built to hold the total number of key in the array,
 					by default key_name::size (see array_size_suffix parameter).
4c2338d3
 				</para>
 				</listitem>
 			</itemizedlist>
 			</listitem>
 			<listitem>
 			<para>
 				<emphasis>value type</emphasis> - the type of the key value
 			</para>
 			<itemizedlist>
 				<listitem>
 				<para>
 					<emphasis>0</emphasis> - value is string.
 				</para>
 				</listitem>
 				<listitem>
 				<para>
 					<emphasis>1</emphasis> - value is integer.
 				</para>
 				</listitem>
 			</itemizedlist>
 			</listitem>
 			<listitem>
 			<para>
 				<emphasis>key value</emphasis> - string containing the value of
 				the key.
 			</para>
 			</listitem>
 			</itemizedlist>
 	</section>
 
d02426aa
 	</section>
 	<section>
9114eebc
 	<title>Parameters</title>
0e0b8cd8
 	<section id="htable.p.htable">
58fa97dd
 		<title><varname>htable</varname> (str)</title>
d02426aa
 		<para>
6260bd81
 		The definition of a hash table. The value of the parameter may have the
58fa97dd
 		following format:
d02426aa
 		</para>
58fa97dd
 		<itemizedlist>
 		<listitem>
 		<para>
 		"htname=&gt;size=_number_;autoexpire=_number_;dbtable=_string_"
 		</para>
 		</listitem>
 		</itemizedlist>
 		<para>
 			The parameter can be set multiple times to get more hash tables in
 			same configuration file.
 		</para>
 		<itemizedlist>
 		<listitem>
 		<para>
 			<emphasis>htname</emphasis> - string specifying the name of
3cefc3b3
 			the hash table. This string is used by <emphasis>$sht(...)</emphasis>
 			to refer to the hash table.
58fa97dd
 		</para>
 		</listitem>
 		<listitem>
 		<para>
35f711e6
 			<emphasis>size</emphasis> - number to control how many slots
 			(buckets) to create for the hash table. Larger value means more
 			slots with higher probability for less collisions. The actual number
 			slots (or buckets) created for the table is 2^size. The possible range
ee7dcac5
 			for this value is from 2 to 31, smaller or larger values will be
35f711e6
 			increased to 3 (8 slots) or decreased to 14 (16384 slots). Note
 			that each slot can store more than one item, when there are
 			collisions of hash ids computed for keys. The items in the same
 			slot are stored in a linked list. In other words, the size is not
 			setting a limit of how many items can be stored in a hash table, as
 			long as there is enough free shared memory, new items can be added.
58fa97dd
 		</para>
 		</listitem>
 		<listitem>
 		<para>
 			<emphasis>autoexpire</emphasis> -time in seconds to delete an item
9bf13e03
 			from a hash table if no update was done to it. If is missing or set
58fa97dd
 			to 0, the items won't expire.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
 			<emphasis>dbtable</emphasis> - name of database to be loaded at
 			startup in hash table. If empty or missing, no data will be loaded.
 		</para>
 		</listitem>
15c87249
 		<listitem>
6260bd81
 		<para>
 			<emphasis>cols</emphasis> - the column names of the database table.
 			They must be enclosed in quotes in order to form a valid SIP
 			parameter value and be separated by comma. The first column
 			corresponds to key_name. When specified, there must be at least
 			two columns. If this attribute is not specified, then the global
 			module parameters for column names are used. If more than one
 			value columns are specified, the hash table will pack the column
 			values in a comma separated string, which will be associated
 			with the key (string transformation {s.select,...} can be
 			used in configuration file to extract a specific column value).
 			When cols attribute is present, writing back to database table
 			is disabled.
 			</para>
 		</listitem>
 		<listitem>
15c87249
 		<para>
 			<emphasis>dbmode</emphasis> - if set to 1, the content of hash
 			table is written to database table when the SIP server is stopped
 			(i.e., ensure persistency over restarts). Default value is 0 (no
 			write back to db table).
 		</para>
 		</listitem>
bd6a3df6
 		<listitem>
 		<para>
 			<emphasis>initval</emphasis> - the integer value to be returned
0fa81acc
 			instead of $null when a requested key is not set.
bd6a3df6
 		</para>
 		</listitem>
aa5a8463
 		<listitem>
 		<para>
3cefc3b3
 			<emphasis>updateexpire</emphasis> - if set to 1 (default), the time until
 			expiration of an item is reset when that item is updated.  Certain uses of
 			htable may dictate that updates should not reset the expiration timeout, however,
 			in which case this attribute can be set to 0.
aa5a8463
 		</para>
 		</listitem>
c9395e69
 		<listitem>
 		<para>
3cefc3b3
 			<emphasis>dmqreplicate</emphasis> - if set to 1, any actions (set, update, delete
 			etc.) performed upon entries in this table will be replicated to other nodes (htable
 			peers). Please note, module parameter <quote>enable_dmq</quote> must also be set in
 			order for this to apply (see below). Default is 0 (no replication).
c9395e69
 		</para>
 		</listitem>
58fa97dd
 		</itemizedlist>
d02426aa
 		<para>
 		<emphasis>
58fa97dd
 			Default value is NULL.
d02426aa
 		</emphasis>
 		</para>
 		<example>
65cb844f
 		<title>Set <varname>htable</varname> parameter</title>
d02426aa
 		<programlisting format="linespecific">
 ...
58fa97dd
 modparam("htable", "htable", "a=&gt;size=4;autoexpire=7200;dbtable=htable_a;")
8431de38
 modparam("htable", "htable", "b=&gt;size=5;")
c9395e69
 modparam("htable", "htable", "c=&gt;size=4;autoexpire=7200;initval=1;dmqreplicate=1;")
d02426aa
 ...
4c2338d3
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.db_url">
4c2338d3
 		<title><varname>db_url</varname> (str)</title>
 		<para>
3cefc3b3
 			The <acronym>URL</acronym> to connect to database for loading values in hash
4c2338d3
 			table at start up.
 		</para>
 		<para>
 		<emphasis>
 			Default value is NULL (do not connect).
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>db_url</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
0d9eec94
 modparam("htable", "db_url", "&defaultdb;")
4c2338d3
 ...
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.key_name_column">
4c2338d3
 		<title><varname>key_name_column</varname> (str)</title>
 		<para>
3cefc3b3
 			The name of the column containing the hash table key name.
4c2338d3
 		</para>
 		<para>
 		<emphasis>
 			Default value is 'key_name'.
 		</emphasis>
 		</para>
 		<example>
279d82c5
 		<title>Set <varname>key_name_column</varname> parameter</title>
4c2338d3
 		<programlisting format="linespecific">
 ...
 modparam("htable", "key_name_column", "kname")
 ...
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.key_type_column">
4c2338d3
 		<title><varname>key_type_column</varname> (str)</title>
 		<para>
3cefc3b3
 			The name of the column containing the hash table key type.
4c2338d3
 		</para>
 		<para>
 		<emphasis>
 			Default value is 'key_type'.
 		</emphasis>
 		</para>
 		<example>
279d82c5
 		<title>Set <varname>key_type_column</varname> parameter</title>
4c2338d3
 		<programlisting format="linespecific">
 ...
 modparam("htable", "key_type_column", "ktype")
 ...
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.value_type_column">
4c2338d3
 		<title><varname>value_type_column</varname> (str)</title>
 		<para>
3cefc3b3
 			The name of the column containing the hash table value type.
4c2338d3
 		</para>
 		<para>
 		<emphasis>
 			Default value is 'value_type'.
 		</emphasis>
 		</para>
 		<example>
279d82c5
 		<title>Set <varname>value_type_column</varname> parameter</title>
4c2338d3
 		<programlisting format="linespecific">
 ...
279d82c5
 modparam("htable", "value_type_column", "vtype")
4c2338d3
 ...
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.key_value_column">
4c2338d3
 		<title><varname>key_value_column</varname> (str)</title>
 		<para>
 			The name of the column containing hash table key value.
 		</para>
 		<para>
 		<emphasis>
 			Default value is 'key_value'.
 		</emphasis>
 		</para>
 		<example>
279d82c5
 		<title>Set <varname>key_value_column</varname> parameter</title>
4c2338d3
 		<programlisting format="linespecific">
 ...
279d82c5
 modparam("htable", "key_value_column", "kvalue")
4c2338d3
 ...
0fa81acc
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.expires_column">
0fa81acc
 		<title><varname>expires_column</varname> (str)</title>
 		<para>
3cefc3b3
 			The name of the column containing the expires value.
0fa81acc
 		</para>
 		<para>
 		<emphasis>
 			Default value is 'expires'.
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>expires_column</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
f07fc80d
 modparam("htable", "expires_column", "expiry")
0fa81acc
 ...
4c2338d3
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.array_size_suffix">
4c2338d3
 		<title><varname>array_size_suffix</varname> (str)</title>
 		<para>
 			The suffix to be added to store the number of items in an
2847c47d
 			array (see key type).
4c2338d3
 		</para>
 		<para>
 		<emphasis>
 			Default value is '::size'.
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>array_size_suffix</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
 modparam("htable", "array_size_suffix", "-count")
 ...
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.fetch_rows">
4c2338d3
 		<title><varname>fetch_rows</varname> (integer)</title>
 		<para>
 		How many rows to fetch at once from database.
 		</para>
 		<para>
 		<emphasis>
 			Default value is 100.
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>fetch_rows</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
 modparam("htable", "fetch_rows", 1000)
 ...
32d44d14
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.timer_interval">
32d44d14
 		<title><varname>timer_interval</varname> (integer)</title>
 		<para>
 		Interval in seconds to check for expired htable values.
 		</para>
 		<para>
 		<emphasis>
 			Default value is 20.
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>timer_interval</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
 modparam("htable", "timer_interval", 10)
 ...
ab423c7f
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.db_expires">
ab423c7f
 		<title><varname>db_expires</varname> (integer)</title>
 		<para>
f87adf6a
 			If set to 1, the module loads/saves the value for expire of
 			the items in hash table from/to database. It applies only to hash
 			tables that have the auto-expires attribute defined. If set to 0,
 			only the key name and the value are loaded, the expires for each
 			item being set to 0.
 		</para>
 		<para>
 			Note that the module is not reloading automatically the items from
 			database when they expire, the reloading can be done only via RPC
 			command.
ab423c7f
 		</para>
 		<para>
 		<emphasis>
 			Default value is 0.
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>db_expires</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
 modparam("htable", "db_expires", 1)
 ...
c9395e69
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.p.enable_dmq">
c9395e69
 		<title><varname>enable_dmq</varname> (integer)</title>
 		<para>
6dd359e3
 			If set to 1, will enable DMQ replication of actions performed upon
 			entries in all tables having "dmqreplicate" parameter set. Any update
1b7bc211
 			action performed via pseudo-variables and RPC commands will be
c9395e69
 			repeated on all other nodes. Therefore, it is important to ensure the
 			table definition (size, autoexpire etc.) is identical across all instances.
 		</para>
95a7d147
 		<para>
 		<emphasis>
 			Important: If this parameter is enabled, the DMQ module must be loaded first - otherwise, startup will fail.
 		</emphasis>
 		</para>
c9395e69
 		<para>
6dd359e3
 			Currently, values are not replicated on load from DB as it is expected
c9395e69
 			that in these cases, all servers will load their values from the same DB.
 		</para>
 		<para>
 		<emphasis>
 			Default value is 0.
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>enable_dmq</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
 modparam("htable", "enable_dmq", 1)
 ...
57f87fcb
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.p.dmq_init_sync">
 		<title><varname>dmq_init_sync</varname> (integer)</title>
 		<para>
 			If set to 1, will request synchronization from other nodes at startup. It applies
 			to all tables having the "dmqreplicate" parameter set. As above, it is important to 
 			ensure the definition (size, autoexpire etc.) of replicated tables is identical 
 			across all instances.
 		</para>
 		<para>
 		<emphasis>
 			Default value is 0.
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>dmq_init_sync</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
 modparam("htable", "dmq_init_sync", 1)
 ...
e1a40492
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.p.timer_procs">
 		<title><varname>timer_procs</varname> (integer)</title>
 		<para>
3a723206
 			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 the core timer for this task. Set it to 1 if you store
 			a lot of items with autoexpire property.
e1a40492
 		</para>
 		<para>
 		<emphasis>
 			Default value is 0.
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>timer_procs</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
3a723206
 modparam("htable", "timer_procs", 4)
e1a40492
 ...
6dd359e3
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.p.event_callback">
 		<title><varname>event_callback</varname> (str)</title>
 		<para>
 			The name of the function in the kemi configuration file (embedded
 			scripting language such as Lua, Python, ...) to be executed instead
bb24683b
 			of event_route[...] blocks.
 		</para>
 		<para>
 			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).
6dd359e3
 		</para>
 		<para>
 		<emphasis>
 			Default value is 'empty' (no function is executed for events).
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>event_callback</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
 modparam("htable", "event_callback", "ksr_htable_event")
 ...
 -- event callback function implemented in Lua
 function ksr_htable_event(evname)
 	KSR.info("===== htable module triggered event: " .. evname .. "\n");
 	return 1;
 end
 ...
e72a4190
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.p.event_callback_mode">
 		<title><varname>event_callback_mode</varname> (int)</title>
 		<para>
 			Control when event_route[htable:init] is executed: 0 - after all
 			modules were initialized; 1 - in first worker process.
 		</para>
 		<para>
 			Set it to 1 if used in a KEMI script or when needing to use database
 			(e.g., via sqlops) inside event_route[htable:init].
 		</para>
 		<para>
 		<emphasis>
 			Default value is 0.
 		</emphasis>
 		</para>
 		<example>
 		<title>Set <varname>event_callback_mode</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
 modparam("htable", "event_callback_mode", 1)
 ...
d02426aa
 </programlisting>
 		</example>
 	</section>
 	</section>
 	<section>
9114eebc
 	<title>Functions</title>
0e0b8cd8
 	<section id="htable.f.sht_print">
d02426aa
 		<title>
 		<function moreinfo="none">sht_print()</function>
 		</title>
 		<para>
 			Dump content of hash table to L_ERR log level. Intended for debug
 			purposes.
 		</para>
 		<para>
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
 			ONREPLY_ROUTE, BRANCH_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_print</function> usage</title>
 		<programlisting format="linespecific">
 ...
 sht_print();
 ...
40518b64
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.f.sht_rm">
 		<title>
 		<function moreinfo="none">sht_rm(htname, itname)</function>
 		</title>
 		<para>
 			Delete the item with the name 'itname' from hash table 'htname'.
 			This API function equivaluent to '$sht(htname=&gt;itname) = $null'.
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_rm</function> usage</title>
 		<programlisting format="linespecific">
 ...
 sht_rm("ha", "test"");
 ...
ac585f7c
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.f.sht_rm_name_re">
ac585f7c
 		<title>
 		<function moreinfo="none">sht_rm_name_re(htable=>regexp)</function>
 		</title>
 		<para>
 			Delete all entries in the htable that match the name against
 			regular expression.
 		</para>
 		<para>
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
 			ONREPLY_ROUTE, BRANCH_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_rm_name_re</function> usage</title>
 		<programlisting format="linespecific">
 ...
9cb2c371
 sht_rm_name_re("ha=>.*");
ac585f7c
 ...
 </programlisting>
 		</example>
 	</section>
0e0b8cd8
 	<section id="htable.f.sht_rm_value_re">
ac585f7c
 		<title>
 		<function moreinfo="none">sht_rm_value_re(htable=>regexp)</function>
 		</title>
 		<para>
 			Delete all entries in the htable that match the value against
 			regular expression.
 		</para>
 		<para>
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
 			ONREPLY_ROUTE, BRANCH_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_rm_value_re</function> usage</title>
 		<programlisting format="linespecific">
 ...
9cb2c371
 sht_rm_value_re("ha=>.*");
ac585f7c
 ...
0c69e7bc
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.f.sht_rm_name">
 		<title>
 		<function moreinfo="none">sht_rm_name(htable, op, val)</function>
 		</title>
 		<para>
 			Delete all entries in the htable that match the name against
 			the val parameter.
 		</para>
 		<para>
 			The op parameter can be:
 		</para>
 		<itemizedlist>
 		<listitem>
 		<para>
 			<emphasis>re</emphasis> - match the val parameter as regular
 			expression.
 		</para>
 		</listitem>
df659d2e
 		<listitem>
 		<para>
 			<emphasis>sw</emphasis> - match the val parameter as 'starts
 			with'.
 		</para>
 		</listitem>
0c69e7bc
 		</itemizedlist>
 		<para>
 			All parameters can be static strings or contain variables.
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_rm_name</function> usage</title>
 		<programlisting format="linespecific">
 ...
 sht_rm_name("ha", "re", ".*");
 ...
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.f.sht_rm_value">
 		<title>
 		<function moreinfo="none">sht_rm_value(htable, op, val)</function>
 		</title>
 		<para>
 			Delete all entries in the htable that match the value against
 			the val parameter.
 		</para>
 		<para>
 			The op parameter can be:
 		</para>
 		<itemizedlist>
 		<listitem>
 		<para>
 			<emphasis>re</emphasis> - match the val parameter as regular
 			expression.
 		</para>
 		</listitem>
df659d2e
 		<listitem>
 		<para>
 			<emphasis>sw</emphasis> - match the val parameter as 'starts
 			with'.
 		</para>
 		</listitem>
0c69e7bc
 		</itemizedlist>
 		<para>
 			All parameters can be static strings or contain variables.
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
df659d2e
 		<title><function>sht_rm_value</function> usage</title>
0c69e7bc
 		<programlisting format="linespecific">
 ...
 sht_rm_value("ha", "re", ".*");
 ...
309b25af
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.f.sht_reset">
 		<title>
 		<function moreinfo="none">sht_reset(htable)</function>
 		</title>
 		<para>
 			Delete all entries in the htable. The name of the hash table
 			can be a dynamic string with variables.
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_reset</function> usage</title>
 		<programlisting format="linespecific">
 ...
 sht_reset("ha$var(x)");
 ...
4a425a88
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.f.sht_lock">
 		<title>
 		<function moreinfo="none">sht_lock(htable=>key)</function>
 		</title>
 		<para>
9bf13e03
 			Lock the slot in htable corresponding to the key item. Note that
44269cd6
 			the locking is re-entrant for the process, therefore the lock
 			and unlock should be done by the same process.
4a425a88
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_lock</function> usage</title>
 		<programlisting format="linespecific">
 ...
 sht_lock("ha=>test");
 ...
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.f.sht_unlock">
 		<title>
 		<function moreinfo="none">sht_unlock(htable=>key)</function>
 		</title>
 		<para>
9d48bb4a
 			Unlock the slot in htable corresponding to the key item. Note that
44269cd6
 			the locking is re-entrant for the process, therefore the lock
 			and unlock should be done by the same process.
4a425a88
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_unlock</function> usage</title>
 		<programlisting format="linespecific">
 ...
 sht_lock("ha=>test");
 $sht(ha=>test) = $sht(ha=>test) + 10;
 sht_unlock("ha=>test");
 ...
4776b44e
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.f.sht_iterator_start">
 		<title>
 		<function moreinfo="none">sht_iterator_start(iname, hname)</function>
 		</title>
 		<para>
 			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 to 4 iterators at the same time, with different name.
 		</para>
 		<para>
 			Both parameters can be dynamic strings with variables.
 		</para>
 		<para>
 			IMPORTANT: the slot of the hash table is left locked when
 			retrieving in item. Therefore be sure you do not update the
 			content of the hash table in between sht_iterator_start()
 			and sht_iterator_end(), because it may end up in dead lock.
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_iterator_start</function> usage</title>
 		<programlisting format="linespecific">
 ...
 sht_iterator_start("i1", "h1");
 ...
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.f.sht_iterator_end">
 		<title>
 		<function moreinfo="none">sht_iterator_end(iname)</function>
 		</title>
 		<para>
 			Close the iterator identified by iname parameter and release
9d48bb4a
 			the hash table slot acquired by the iterator. The iname value
4776b44e
 			must be the same used for sht_iterator_start().
 		</para>
 		<para>
 			The parameter can be dynamic string with variables.
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_iterator_end</function> usage</title>
 		<programlisting format="linespecific">
 ...
 sht_iterator_end("i1");
 ...
 </programlisting>
 		</example>
 	</section>
 	<section id="htable.f.sht_iterator_next">
 		<title>
 		<function moreinfo="none">sht_iterator_next(iname)</function>
 		</title>
 		<para>
 			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 table. Items are returned as they are found
 			in the hash table slot, starting with the first slot.
 		</para>
 		<para>
 			The return code is false when there is no (more) item in the
 			hash table.
 		</para>
 		<para>
 			The item name and value are accessible via variables:
 			$shtitkey(iname) and $shtitval(iname).
 		</para>
 		<para>
 			The parameter can be dynamic string with variables.
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
 		<title><function>sht_iterator_next</function> usage</title>
 		<programlisting format="linespecific">
 ...
     sht_iterator_start("i1", "h1");
     while(sht_iterator_next("i1")) {
         xlog("h1[$shtitkey(i1)] is: $shtitval(i1)\n");
     }
     sht_iterator_end("i1");
 ...
232c541a
 </programlisting>
 		</example>
 	</section>
017e4556
 	<section id="htable.f.sht_match_name">
232c541a
 		<title>
017e4556
 		<function moreinfo="none">sht_match_name(htable, op, mval)</function>
232c541a
 		</title>
 		<para>
 			Return greater than 0 (true) if the htable has an item that matches
 			the name against the mval parameter.
 		</para>
 		<para>
 			The op parameter can be:
 		</para>
 		<itemizedlist>
 		<listitem>
 		<para>
 			<emphasis>eq</emphasis> - match the val parameter as string equal
 			expression.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
 			<emphasis>ne</emphasis> - match the val parameter as string not-equal
 			expression.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
 			<emphasis>re</emphasis> - match the val parameter as regular
 			expression.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
 			<emphasis>sw</emphasis> - match the val parameter as 'starts
 			with' expression.
 		</para>
 		</listitem>
 		</itemizedlist>
 		<para>
 			All parameters can be static strings or contain variables.
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
017e4556
 		<title><function>sht_match_name</function> usage</title>
232c541a
 		<programlisting format="linespecific">
 ...
017e4556
 if(sht_match_name("ha", "eq", "alice")) {
232c541a
   ...
 }
 ...
 </programlisting>
 		</example>
 	</section>
737e21fe
 	<section id="htable.f.sht_has_name">
 		<title>
 		<function moreinfo="none">sht_has_name(htable, op, mval)</function>
 		</title>
 		<para>
 			Alias for sht_match_name().
 		</para>
 	</section>
017e4556
 	<section id="htable.f.sht_match_str_value">
232c541a
 		<title>
017e4556
 		<function moreinfo="none">sht_match_str_value(htable, op, mval)</function>
232c541a
 		</title>
 		<para>
 			Return greater than 0 (true) if the htable has an item that matches
 			the string value against the mval parameter.
 		</para>
 		<para>
 			The op parameter can be:
 		</para>
 		<itemizedlist>
 		<listitem>
 		<para>
 			<emphasis>eq</emphasis> - match the val parameter as string equal
 			expression.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
 			<emphasis>ne</emphasis> - match the val parameter as string not-equal
 			expression.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
 			<emphasis>re</emphasis> - match the val parameter as regular
 			expression.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
 			<emphasis>sw</emphasis> - match the val parameter as 'starts
 			with' expression.
 		</para>
 		</listitem>
 		</itemizedlist>
 		<para>
 			All parameters can be static strings or contain variables.
 		</para>
 		<para>
 			This function can be used from ANY_ROUTE.
 		</para>
 		<example>
017e4556
 		<title><function>sht_match_name</function> usage</title>
232c541a
 		<programlisting format="linespecific">
 ...
017e4556
 if(sht_match_str_value("ha", "eq", "alice")) {
232c541a
   ...
 }
 ...
d02426aa
 </programlisting>
 		</example>
 	</section>
737e21fe
 	<section id="htable.f.sht_has_str_value">
 		<title>
 		<function moreinfo="none">sht_has_str_value(htable, op, mval)</function>
 		</title>
 		<para>
 			Alias for sht_match_str_value().
 		</para>
 	</section>
d02426aa
 	</section>
 		<section>
32d44d14
 		<title>Exported pseudo-variables</title>
 		<itemizedlist>
 			<listitem><para>
 				<emphasis>$sht(htable=>key)</emphasis>
 			</para></listitem>
 			<listitem><para>
 				<emphasis>$shtex(htable=>key)</emphasis>
 			</para></listitem>
35eff446
 			<listitem><para>
 				<emphasis>$shtcn(htable=>key)</emphasis>
 			</para></listitem>
 			<listitem><para>
 				<emphasis>$shtcv(htable=>key)</emphasis>
 			</para></listitem>
 			<listitem><para>
 				<emphasis>$shtinc(htable=>key)</emphasis>
 			</para></listitem>
 			<listitem><para>
866270a7
 				<emphasis>$shtitkey(iname)</emphasis>
 			</para></listitem>
 			<listitem><para>
 				<emphasis>$shtitval(iname)</emphasis>
35eff446
 			</para></listitem>
61af5c6b
 			<listitem><para>
 				<emphasis>$shtrecord(attribute)</emphasis>
 			</para></listitem>
32d44d14
 		</itemizedlist>
 		<para>
 		Exported pseudo-variables are documented at &kamwikilink;.
 		</para>
d02426aa
 	</section>
6ff072a3
 	<section>
af298284
         <title>RPC Commands</title>
0fb39b3d
         <section id="htable.rpc.get">
6ff072a3
                 <title>
9b9562a2
                 <function moreinfo="none">htable.get htable key</function>
6ff072a3
                 </title>
                 <para>
0fb39b3d
 					Lists one value in a hash table
6ff072a3
                 </para>
                 <para>
                 Name: <emphasis>htable.get</emphasis>
                 </para>
                 <para>Parameters:</para>
                 <itemizedlist>
9b9562a2
                         <listitem><para>htable : Name of the hash table to dump</para>
6ff072a3
                         </listitem>
                         <listitem><para>key : Key name of the hash table value to dump</para>
                         </listitem>
                 </itemizedlist>
                 <para>
                 Example:
                 </para>
 <programlisting  format="linespecific">
 ...
0fb39b3d
 # Dump $sht(students=>alice)
 kamcmd htable.get students alice
2847c47d
 
 # Dump first entry in array key course $sht(students=>course[0])
 kamcmd htable.get students course[0]
6ff072a3
 ...
 </programlisting>
 	</section>
0fb39b3d
         <section id="htable.rpc.delete">
6ff072a3
                 <title>
9b9562a2
                 <function moreinfo="none">htable.delete htable key</function>
6ff072a3
                 </title>
                 <para>
0fb39b3d
 					Delete one value in a hash table
6ff072a3
                 </para>
                 <para>
                 Name: <emphasis>htable.delete</emphasis>
                 </para>
                 <para>Parameters:</para>
                 <itemizedlist>
9b9562a2
                         <listitem><para>htable : Name of the hash table to delete</para>
6ff072a3
                         </listitem>
                         <listitem><para>key : Key name of the hash table value to delete</para>
                         </listitem>
                 </itemizedlist>
                 <para>
                 Example:
                 </para>
 <programlisting  format="linespecific">
 ...
0fb39b3d
 # Delete $sht(students=>alice)
 kamcmd htable.delete students alice
2847c47d
 
 # Delete first entry in array key course $sht(students=>course[0])
 kamcmd htable.delete students course[0]
6ff072a3
 ...
5d45ea50
 </programlisting>
 	</section>
0fb39b3d
        <section id="htable.rpc.sets">
5d45ea50
                 <title>
                 <function moreinfo="none">htable.sets htable key value</function>
                 </title>
                 <para>
 					Set an item in hash table to string value.
                 </para>
                 <para>
                 Name: <emphasis>htable.sets</emphasis>
                 </para>
                 <para>Parameters:</para>
                 <itemizedlist>
                         <listitem><para>htable : Name of the hash table</para>
                         </listitem>
                         <listitem><para>key : Key name in the hash table</para>
                         </listitem>
                         <listitem><para>Value : String value for the item</para>
                         </listitem>
                 </itemizedlist>
                 <para>
                 Example:
                 </para>
 <programlisting  format="linespecific">
 ...
2e4c1366
 # Set $sht(test=>x) as string
5d45ea50
 kamcmd htable.sets test x abc
2847c47d
 
 # Set firsti entry in array key x $sht(test=>x[0]) as string
 kamcmd htable.sets test x[0] abc
5d45ea50
 ...
 </programlisting>
 	</section>
0fb39b3d
        <section id="htable.rpc.seti">
5d45ea50
                 <title>
                 <function moreinfo="none">htable.seti htable key value</function>
                 </title>
                 <para>
 					Set an item in hash table to integer value.
                 </para>
                 <para>
                 Name: <emphasis>htable.seti</emphasis>
                 </para>
                 <para>Parameters:</para>
                 <itemizedlist>
                         <listitem><para>htable : Name of the hash table</para>
                         </listitem>
                         <listitem><para>key : Key name in the hash table</para>
                         </listitem>
                         <listitem><para>Value : Integer value for the item</para>
                         </listitem>
                 </itemizedlist>
                 <para>
                 Example:
                 </para>
 <programlisting  format="linespecific">
 ...
2e4c1366
 # Set $sht(test=>x) as integer
 kamcmd htable.seti test x 123
2847c47d
 
9d48bb4a
 # Set first entry in array key x $sht(test=>x[0]) as integer
2ea0baf9
 kamcmd htable.seti test x[0] 123
5d45ea50
 ...
6ff072a3
 </programlisting>
 	</section>
0fb39b3d
         <section id="htable.rpc.dump">
6ff072a3
                 <title>
9b9562a2
                 <function moreinfo="none">htable.dump htable</function>
6ff072a3
                 </title>
                 <para>
 		Lists all the values in a hash table
                 </para>
                 <para>
01933ac0
                 Name: <emphasis>htable.dump</emphasis>
6ff072a3
                 </para>
                 <para>Parameters:</para>
                 <itemizedlist>
9b9562a2
                         <listitem><para>htable : Name of the hash table to dump</para>
6ff072a3
                         </listitem>
                 </itemizedlist>
                 <para>
                 Example:
                 </para>
 <programlisting  format="linespecific">
 ...
 kamcmd htable.dump ipban
 ...
cc00df26
 </programlisting>
 	</section>
0fb39b3d
         <section id="htable.rpc.reload">
cc00df26
                 <title>
                 <function moreinfo="none">htable.reload htable</function>
                 </title>
                 <para>
01933ac0
                 Reload hash table from database.
cc00df26
                 </para>
                 <para>
01933ac0
                 Name: <emphasis>htable.reload</emphasis>
cc00df26
                 </para>
                 <para>Parameters:</para>
                 <itemizedlist>
                         <listitem><para>htable : Name of the hash table to reload</para>
                         </listitem>
                 </itemizedlist>
                 <para>
                 Example:
                 </para>
 <programlisting  format="linespecific">
 ...
 kamcmd htable.reload ipban
 ...
01933ac0
 </programlisting>
 	</section>
         <section id="htable.rpc.store">
                 <title>
                 <function moreinfo="none">htable.store htable</function>
                 </title>
                 <para>
                 Store hash table to database.
                 </para>
                 <para>
                 Name: <emphasis>htable.store</emphasis>
                 </para>
                 <para>Parameters:</para>
                 <itemizedlist>
                         <listitem><para>htable : Name of the hash table to store</para>
                         </listitem>
                 </itemizedlist>
                 <para>
                 Example:
                 </para>
 <programlisting  format="linespecific">
 ...
 kamcmd htable.store ipban
 ...
19d25bac
 </programlisting>
 	</section>
 	<section id="htable.rpc.flush">
           <title>
                 <function moreinfo="none">htable.flush htable</function>
           </title>
           <para>
             Empty the hash table
           </para>
           <para>
             Name: <emphasis>htable.flush</emphasis>
           </para>
           <para>Parameters:</para>
           <itemizedlist>
             <listitem><para>htable : Name of the hash table to flush</para></listitem>
           </itemizedlist>
           <para>
           Example:
           </para>
 <programlisting  format="linespecific">
 ...
 kamcmd htable.flush ipban
 ...
2b09c724
 </programlisting>
 	</section>
0fb39b3d
         <section id="htable.rpc.listTables">
2b09c724
                 <title>
                 <function moreinfo="none">htable.listTables</function>
                 </title>
                 <para>
 		Lists all defined tables
                 </para>
                 <para>
64e39dbf
                 Name: <emphasis>htable.listTables</emphasis>
2b09c724
                 </para>
                 <para>Parameters:</para>
                 <itemizedlist>
                         <listitem><para>None</para>
                         </listitem>
                 </itemizedlist>
                 <para>
                 Example:
                 </para>
 <programlisting  format="linespecific">
 ...
 kamcmd htable.listTables
 ...
64e39dbf
 </programlisting>
 	</section>
0fb39b3d
     <section id="htable.rpc.stats">
64e39dbf
           <title>
                 <function moreinfo="none">htable.stats</function>
           </title>
           <para>
 			  Get statistics for hash tables - name, number of slots,
 			  number of items, max number of items per slot, min number
 			  of items per slot.
           </para>
                 <para>
                 Name: <emphasis>htable.stats</emphasis>
                 </para>
                 <para>Parameters:</para>
                 <itemizedlist>
                         <listitem><para>None</para>
                         </listitem>
                 </itemizedlist>
                 <para>
                 Example:
                 </para>
 <programlisting  format="linespecific">
 ...
 kamcmd htable.stats
 ...
6ff072a3
 </programlisting>
 	</section>
 
 	</section><!-- RPC commands -->
 
6f22852f
 	<section>
 	<title>Event routes</title>
 	<section>
 		<title>
 		<function moreinfo="none">htable:mod-init</function>
 		</title>
 		<para>
 			When defined, the module calls event_route[htable:mod-init] after
3376e3b8
 			all modules have been initialized. A typical use case is to
6f22852f
 			initialise items in hash tables. The event route is executed only
3376e3b8
 			once, after core and module initialization, but before &kamailio; forks any
 			child processes.
6f22852f
 		</para>
e0dcb161
 		<para>
 			Note: do not expect to use functions from all other modules here,
 			even if they are loaded before the htable module, because many of
 			them initialize their runtime structures inside child init callbacks,
 			which are executed after this moment, when forking child processes.
 			For example, sqlops cannot be used, connections to database are
 			initialized in child init. Even more, it is recommended not to use
 			functions from other modules, because it can mess up what they
 			created in mod init callback and expect in child init callback. It
 			should be ok to use functions from htable module or assignment
 			operations.
 		</para>
61af5c6b
 <programlisting  format="linespecific">
 ...
6f22852f
 event_route[htable:mod-init] {
     $sht(a=>x) = 1;
 }
 ...
61af5c6b
 </programlisting>
 	</section>
 	<section>
 		<title>
 		<function moreinfo="none">htable:expired:&lt;table&gt;</function>
 		</title>
 		<para>
 			When defined, the module calls event_route[htable:expired:&lt;table&gt;]
 			when an entry in the given table expires. In this event route, the key and value
 			of the expired record are available with the $shtrecord(key) and $shtrecord(value)
 			pseudo-variables.
 		</para>
 <programlisting  format="linespecific">
 ...
 
 event_route[htable:expired:mytable] {
     xlog("mytable record expired $shtrecord(key) => $shtrecord(value)\n");
 }
 ...
 </programlisting>
 	</section>
 	</section>
e15f0668
 
d02426aa
 </chapter>