Bladeren bron

htable: documentation fix for expires_column parameter

Ovidiu Sas 8 jaren geleden
bovenliggende
commit
f07fc80df5
2 gewijzigde bestanden met toevoegingen van 98 en 194 verwijderingen
  1. 97 193
      src/modules/htable/README
  2. 1 1
      src/modules/htable/doc/htable_admin.xml

+ 97 - 193
src/modules/htable/README

@@ -30,58 +30,58 @@ Ovidiu Sas
 
    1. Admin Guide
 
-        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.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>
 
    List of Examples
 
@@ -114,62 +114,7 @@ Ovidiu Sas
 
 Chapter 1. Admin Guide
 
-   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
+1.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
@@ -353,25 +298,21 @@ $ kamcmd htable.dump htable
         }
 }
 
-2. Dependencies
+1.2. Dependencies
 
-   2.1. Kamailio Modules
-   2.2. External Libraries or Applications
-   2.3. Loading from database
-
-2.1. Kamailio Modules
+1.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..
 
-2.2. External Libraries or Applications
+1.2.2. External Libraries or Applications
 
    The following libraries or applications must be installed before
    running Kamailio with this module loaded:
      * None.
 
-2.3. Loading from database
+1.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.
@@ -390,24 +331,9 @@ $ kamcmd htable.dump htable
           + 1 - value is integer.
      * key value - string containing the value of the key.
 
-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)
+1.3. Parameters
+
+1.3.1. htable (str)
 
    The definition of a hash table. The value of the parameter may have the
    following format:
@@ -464,7 +390,7 @@ modparam("htable", "htable", "c=>size=4;autoexpire=7200;initval=1;dmqreplicate=1
 ;")
 ...
 
-3.2. db_url (str)
+1.3.2. db_url (str)
 
    The URL to connect to database for loading values in hash table at
    start up.
@@ -476,7 +402,7 @@ modparam("htable", "htable", "c=>size=4;autoexpire=7200;initval=1;dmqreplicate=1
 modparam("htable", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
 ...
 
-3.3. key_name_column (str)
+1.3.3. key_name_column (str)
 
    The name of the column containing the hash table key name.
 
@@ -487,7 +413,7 @@ modparam("htable", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
 modparam("htable", "key_name_column", "kname")
 ...
 
-3.4. key_type_column (str)
+1.3.4. key_type_column (str)
 
    The name of the column containing the hash table key type.
 
@@ -498,7 +424,7 @@ modparam("htable", "key_name_column", "kname")
 modparam("htable", "key_type_column", "ktype")
 ...
 
-3.5. value_type_column (str)
+1.3.5. value_type_column (str)
 
    The name of the column containing the hash table value type.
 
@@ -509,7 +435,7 @@ modparam("htable", "key_type_column", "ktype")
 modparam("htable", "value_type_column", "vtype")
 ...
 
-3.6. key_value_column (str)
+1.3.6. key_value_column (str)
 
    The name of the column containing hash table key value.
 
@@ -520,7 +446,7 @@ modparam("htable", "value_type_column", "vtype")
 modparam("htable", "key_value_column", "kvalue")
 ...
 
-3.7. expires_column (str)
+1.3.7. expires_column (str)
 
    The name of the column containing the expires value.
 
@@ -528,10 +454,10 @@ modparam("htable", "key_value_column", "kvalue")
 
    Example 1.10. Set expires_column parameter
 ...
-modparam("htable", "expires", "expiry")
+modparam("htable", "expires_column", "expiry")
 ...
 
-3.8. array_size_suffix (str)
+1.3.8. array_size_suffix (str)
 
    The suffix to be added to store the number of items in an array (see
    key type).
@@ -543,7 +469,7 @@ modparam("htable", "expires", "expiry")
 modparam("htable", "array_size_suffix", "-count")
 ...
 
-3.9. fetch_rows (integer)
+1.3.9. fetch_rows (integer)
 
    How many rows to fetch at once from database.
 
@@ -554,7 +480,7 @@ modparam("htable", "array_size_suffix", "-count")
 modparam("htable", "fetch_rows", 1000)
 ...
 
-3.10. timer_interval (integer)
+1.3.10. timer_interval (integer)
 
    Interval in seconds to check for expired htable values.
 
@@ -565,7 +491,7 @@ modparam("htable", "fetch_rows", 1000)
 modparam("htable", "timer_interval", 10)
 ...
 
-3.11. db_expires (integer)
+1.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
@@ -578,7 +504,7 @@ modparam("htable", "timer_interval", 10)
 modparam("htable", "db_expires", 1)
 ...
 
-3.12. enable_dmq (integer)
+1.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
@@ -600,7 +526,7 @@ modparam("htable", "db_expires", 1)
 modparam("htable", "enable_dmq", 1)
 ...
 
-3.13. timer_procs (integer)
+1.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
@@ -614,7 +540,7 @@ modparam("htable", "enable_dmq", 1)
 modparam("htable", "timer_procs", 4)
 ...
 
-3.14. event_callback (str)
+1.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
@@ -634,19 +560,9 @@ function ksr_htable_event(evname)
 end
 ...
 
-4. Functions
+1.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)
-
-4.1.  sht_print()
+1.4.1.  sht_print()
 
    Dump content of hash table to L_ERR log level. Intended for debug
    purposes.
@@ -659,7 +575,7 @@ end
 sht_print();
 ...
 
-4.2.  sht_rm_name_re(htable=>regexp)
+1.4.2.  sht_rm_name_re(htable=>regexp)
 
    Delete all entries in the htable that match the name against regular
    expression.
@@ -672,7 +588,7 @@ sht_print();
 sht_rm_name_re("ha=>.*");
 ...
 
-4.3.  sht_rm_value_re(htable=>regexp)
+1.4.3.  sht_rm_value_re(htable=>regexp)
 
    Delete all entries in the htable that match the value against regular
    expression.
@@ -685,7 +601,7 @@ sht_rm_name_re("ha=>.*");
 sht_rm_value_re("ha=>.*");
 ...
 
-4.4.  sht_reset(htable)
+1.4.4.  sht_reset(htable)
 
    Delete all entries in the htable. The name of the hash table can be a
    dynamic string with variables.
@@ -697,7 +613,7 @@ sht_rm_value_re("ha=>.*");
 sht_reset("ha$var(x)");
 ...
 
-4.5.  sht_lock(htable=>key)
+1.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
@@ -710,7 +626,7 @@ sht_reset("ha$var(x)");
 sht_lock("ha=>test");
 ...
 
-4.6.  sht_unlock(htable=>key)
+1.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
@@ -725,7 +641,7 @@ $sht(ha=>test) = $sht(ha=>test) + 10;
 sht_unlock("ha=>test");
 ...
 
-4.7.  sht_iterator_start(iname, hname)
+1.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
@@ -745,7 +661,7 @@ sht_unlock("ha=>test");
 sht_iterator_start("i1", "h1");
 ...
 
-4.8.  sht_iterator_end(iname)
+1.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
@@ -760,7 +676,7 @@ sht_iterator_start("i1", "h1");
 sht_iterator_end("i1");
 ...
 
-4.9.  sht_iterator_next(iname)
+1.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
@@ -786,7 +702,7 @@ sht_iterator_end("i1");
     sht_iterator_end("i1");
 ...
 
-5. Exported pseudo-variables
+1.5. Exported pseudo-variables
 
      * $sht(htable=>key)
      * $shtex(htable=>key)
@@ -800,18 +716,9 @@ sht_iterator_end("i1");
    Exported pseudo-variables are documented at
    http://www.kamailio.org/wiki/.
 
-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
+1.6. RPC Commands
 
-6.1.  htable.get htable key
+1.6.1.  htable.get htable key
 
    Lists one value in a hash table
 
@@ -830,7 +737,7 @@ kamcmd htable.get students alice
 kamcmd htable.get students course[0]
 ...
 
-6.2.  htable.delete htable key
+1.6.2.  htable.delete htable key
 
    Delete one value in a hash table
 
@@ -849,7 +756,7 @@ kamcmd htable.delete students alice
 kamcmd htable.delete students course[0]
 ...
 
-6.3.  htable.sets htable key value
+1.6.3.  htable.sets htable key value
 
    Set an item in hash table to string value.
 
@@ -869,7 +776,7 @@ kamcmd htable.sets test x abc
 kamcmd htable.sets test x[0] abc
 ...
 
-6.4.  htable.seti htable key value
+1.6.4.  htable.seti htable key value
 
    Set an item in hash table to integer value.
 
@@ -889,7 +796,7 @@ kamcmd htable.seti test x 123
 kamcmd htable.sets test x[0] 123
 ...
 
-6.5.  htable.dump htable
+1.6.5.  htable.dump htable
 
    Lists all the values in a hash table
 
@@ -903,7 +810,7 @@ kamcmd htable.sets test x[0] 123
 kamcmd htable.dump ipban
 ...
 
-6.6.  htable.reload htable
+1.6.6.  htable.reload htable
 
    Reload hash table from database.
 
@@ -917,7 +824,7 @@ kamcmd htable.dump ipban
 kamcmd htable.reload ipban
 ...
 
-6.7.  htable.listTables
+1.6.7.  htable.listTables
 
    Lists all defined tables
 
@@ -931,7 +838,7 @@ kamcmd htable.reload ipban
 kamcmd htable.listTables
 ...
 
-6.8.  htable.stats
+1.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.
@@ -946,12 +853,9 @@ kamcmd htable.listTables
 kamcmd htable.stats
 ...
 
-7. Event routes
-
-   7.1. htable:mod-init
-   7.2. htable:expired:<table>
+1.7. Event routes
 
-7.1.  htable:mod-init
+1.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
@@ -964,7 +868,7 @@ event_route[htable:mod-init] {
 }
 ...
 
-7.2.  htable:expired:<table>
+1.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

+ 1 - 1
src/modules/htable/doc/htable_admin.xml

@@ -534,7 +534,7 @@ modparam("htable", "key_value_column", "kvalue")
 		<title>Set <varname>expires_column</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
-modparam("htable", "expires", "expiry")
+modparam("htable", "expires_column", "expiry")
 ...
 </programlisting>
 		</example>