Browse code

htable: documentation fix for expires_column parameter

Ovidiu Sas authored on 01/03/2017 21:03:19
Showing 2 changed files
... ...
@@ -30,58 +30,58 @@ Ovidiu Sas
30 30
 
31 31
    1. Admin Guide
32 32
 
33
-        1. Overview
34
-        2. Dependencies
35
-
36
-              2.1. Kamailio Modules
37
-              2.2. External Libraries or Applications
38
-              2.3. Loading from database
39
-
40
-        3. Parameters
41
-
42
-              3.1. htable (str)
43
-              3.2. db_url (str)
44
-              3.3. key_name_column (str)
45
-              3.4. key_type_column (str)
46
-              3.5. value_type_column (str)
47
-              3.6. key_value_column (str)
48
-              3.7. expires_column (str)
49
-              3.8. array_size_suffix (str)
50
-              3.9. fetch_rows (integer)
51
-              3.10. timer_interval (integer)
52
-              3.11. db_expires (integer)
53
-              3.12. enable_dmq (integer)
54
-              3.13. timer_procs (integer)
55
-              3.14. event_callback (str)
56
-
57
-        4. Functions
58
-
59
-              4.1. sht_print()
60
-              4.2. sht_rm_name_re(htable=>regexp)
61
-              4.3. sht_rm_value_re(htable=>regexp)
62
-              4.4. sht_reset(htable)
63
-              4.5. sht_lock(htable=>key)
64
-              4.6. sht_unlock(htable=>key)
65
-              4.7. sht_iterator_start(iname, hname)
66
-              4.8. sht_iterator_end(iname)
67
-              4.9. sht_iterator_next(iname)
68
-
69
-        5. Exported pseudo-variables
70
-        6. RPC Commands
71
-
72
-              6.1. htable.get htable key
73
-              6.2. htable.delete htable key
74
-              6.3. htable.sets htable key value
75
-              6.4. htable.seti htable key value
76
-              6.5. htable.dump htable
77
-              6.6. htable.reload htable
78
-              6.7. htable.listTables
79
-              6.8. htable.stats
80
-
81
-        7. Event routes
82
-
83
-              7.1. htable:mod-init
84
-              7.2. htable:expired:<table>
33
+        1.1. Overview
34
+        1.2. Dependencies
35
+
36
+              1.2.1. Kamailio Modules
37
+              1.2.2. External Libraries or Applications
38
+              1.2.3. Loading from database
39
+
40
+        1.3. Parameters
41
+
42
+              1.3.1. htable (str)
43
+              1.3.2. db_url (str)
44
+              1.3.3. key_name_column (str)
45
+              1.3.4. key_type_column (str)
46
+              1.3.5. value_type_column (str)
47
+              1.3.6. key_value_column (str)
48
+              1.3.7. expires_column (str)
49
+              1.3.8. array_size_suffix (str)
50
+              1.3.9. fetch_rows (integer)
51
+              1.3.10. timer_interval (integer)
52
+              1.3.11. db_expires (integer)
53
+              1.3.12. enable_dmq (integer)
54
+              1.3.13. timer_procs (integer)
55
+              1.3.14. event_callback (str)
56
+
57
+        1.4. Functions
58
+
59
+              1.4.1. sht_print()
60
+              1.4.2. sht_rm_name_re(htable=>regexp)
61
+              1.4.3. sht_rm_value_re(htable=>regexp)
62
+              1.4.4. sht_reset(htable)
63
+              1.4.5. sht_lock(htable=>key)
64
+              1.4.6. sht_unlock(htable=>key)
65
+              1.4.7. sht_iterator_start(iname, hname)
66
+              1.4.8. sht_iterator_end(iname)
67
+              1.4.9. sht_iterator_next(iname)
68
+
69
+        1.5. Exported pseudo-variables
70
+        1.6. RPC Commands
71
+
72
+              1.6.1. htable.get htable key
73
+              1.6.2. htable.delete htable key
74
+              1.6.3. htable.sets htable key value
75
+              1.6.4. htable.seti htable key value
76
+              1.6.5. htable.dump htable
77
+              1.6.6. htable.reload htable
78
+              1.6.7. htable.listTables
79
+              1.6.8. htable.stats
80
+
81
+        1.7. Event routes
82
+
83
+              1.7.1. htable:mod-init
84
+              1.7.2. htable:expired:<table>
85 85
 
86 86
    List of Examples
87 87
 
... ...
@@ -114,62 +114,7 @@ Ovidiu Sas
114 114
 
115 115
 Chapter 1. Admin Guide
116 116
 
117
-   Table of Contents
118
-
119
-   1. Overview
120
-   2. Dependencies
121
-
122
-        2.1. Kamailio Modules
123
-        2.2. External Libraries or Applications
124
-        2.3. Loading from database
125
-
126
-   3. Parameters
127
-
128
-        3.1. htable (str)
129
-        3.2. db_url (str)
130
-        3.3. key_name_column (str)
131
-        3.4. key_type_column (str)
132
-        3.5. value_type_column (str)
133
-        3.6. key_value_column (str)
134
-        3.7. expires_column (str)
135
-        3.8. array_size_suffix (str)
136
-        3.9. fetch_rows (integer)
137
-        3.10. timer_interval (integer)
138
-        3.11. db_expires (integer)
139
-        3.12. enable_dmq (integer)
140
-        3.13. timer_procs (integer)
141
-        3.14. event_callback (str)
142
-
143
-   4. Functions
144
-
145
-        4.1. sht_print()
146
-        4.2. sht_rm_name_re(htable=>regexp)
147
-        4.3. sht_rm_value_re(htable=>regexp)
148
-        4.4. sht_reset(htable)
149
-        4.5. sht_lock(htable=>key)
150
-        4.6. sht_unlock(htable=>key)
151
-        4.7. sht_iterator_start(iname, hname)
152
-        4.8. sht_iterator_end(iname)
153
-        4.9. sht_iterator_next(iname)
154
-
155
-   5. Exported pseudo-variables
156
-   6. RPC Commands
157
-
158
-        6.1. htable.get htable key
159
-        6.2. htable.delete htable key
160
-        6.3. htable.sets htable key value
161
-        6.4. htable.seti htable key value
162
-        6.5. htable.dump htable
163
-        6.6. htable.reload htable
164
-        6.7. htable.listTables
165
-        6.8. htable.stats
166
-
167
-   7. Event routes
168
-
169
-        7.1. htable:mod-init
170
-        7.2. htable:expired:<table>
171
-
172
-1. Overview
117
+1.1. Overview
173 118
 
174 119
    The module adds a hash table container to the configuration language.
175 120
    The hash table is stored in shared memory and the access to it can be
... ...
@@ -353,25 +298,21 @@ $ kamcmd htable.dump htable
353 298
         }
354 299
 }
355 300
 
356
-2. Dependencies
301
+1.2. Dependencies
357 302
 
358
-   2.1. Kamailio Modules
359
-   2.2. External Libraries or Applications
360
-   2.3. Loading from database
361
-
362
-2.1. Kamailio Modules
303
+1.2.1. Kamailio Modules
363 304
 
364 305
    The following modules must be loaded before this module:
365 306
      * If DMQ replication is enabled, the DMQ module must be loaded
366 307
        first..
367 308
 
368
-2.2. External Libraries or Applications
309
+1.2.2. External Libraries or Applications
369 310
 
370 311
    The following libraries or applications must be installed before
371 312
    running Kamailio with this module loaded:
372 313
      * None.
373 314
 
374
-2.3. Loading from database
315
+1.2.3. Loading from database
375 316
 
376 317
    The module is able to load values in a hash table at startup upon
377 318
    providing a DB URL and table name.
... ...
@@ -390,24 +331,9 @@ $ kamcmd htable.dump htable
390 331
           + 1 - value is integer.
391 332
      * key value - string containing the value of the key.
392 333
 
393
-3. Parameters
394
-
395
-   3.1. htable (str)
396
-   3.2. db_url (str)
397
-   3.3. key_name_column (str)
398
-   3.4. key_type_column (str)
399
-   3.5. value_type_column (str)
400
-   3.6. key_value_column (str)
401
-   3.7. expires_column (str)
402
-   3.8. array_size_suffix (str)
403
-   3.9. fetch_rows (integer)
404
-   3.10. timer_interval (integer)
405
-   3.11. db_expires (integer)
406
-   3.12. enable_dmq (integer)
407
-   3.13. timer_procs (integer)
408
-   3.14. event_callback (str)
409
-
410
-3.1. htable (str)
334
+1.3. Parameters
335
+
336
+1.3.1. htable (str)
411 337
 
412 338
    The definition of a hash table. The value of the parameter may have the
413 339
    following format:
... ...
@@ -464,7 +390,7 @@ modparam("htable", "htable", "c=>size=4;autoexpire=7200;initval=1;dmqreplicate=1
464 390
 ;")
465 391
 ...
466 392
 
467
-3.2. db_url (str)
393
+1.3.2. db_url (str)
468 394
 
469 395
    The URL to connect to database for loading values in hash table at
470 396
    start up.
... ...
@@ -476,7 +402,7 @@ modparam("htable", "htable", "c=>size=4;autoexpire=7200;initval=1;dmqreplicate=1
476 402
 modparam("htable", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
477 403
 ...
478 404
 
479
-3.3. key_name_column (str)
405
+1.3.3. key_name_column (str)
480 406
 
481 407
    The name of the column containing the hash table key name.
482 408
 
... ...
@@ -487,7 +413,7 @@ modparam("htable", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
487 413
 modparam("htable", "key_name_column", "kname")
488 414
 ...
489 415
 
490
-3.4. key_type_column (str)
416
+1.3.4. key_type_column (str)
491 417
 
492 418
    The name of the column containing the hash table key type.
493 419
 
... ...
@@ -498,7 +424,7 @@ modparam("htable", "key_name_column", "kname")
498 424
 modparam("htable", "key_type_column", "ktype")
499 425
 ...
500 426
 
501
-3.5. value_type_column (str)
427
+1.3.5. value_type_column (str)
502 428
 
503 429
    The name of the column containing the hash table value type.
504 430
 
... ...
@@ -509,7 +435,7 @@ modparam("htable", "key_type_column", "ktype")
509 435
 modparam("htable", "value_type_column", "vtype")
510 436
 ...
511 437
 
512
-3.6. key_value_column (str)
438
+1.3.6. key_value_column (str)
513 439
 
514 440
    The name of the column containing hash table key value.
515 441
 
... ...
@@ -520,7 +446,7 @@ modparam("htable", "value_type_column", "vtype")
520 446
 modparam("htable", "key_value_column", "kvalue")
521 447
 ...
522 448
 
523
-3.7. expires_column (str)
449
+1.3.7. expires_column (str)
524 450
 
525 451
    The name of the column containing the expires value.
526 452
 
... ...
@@ -528,10 +454,10 @@ modparam("htable", "key_value_column", "kvalue")
528 454
 
529 455
    Example 1.10. Set expires_column parameter
530 456
 ...
531
-modparam("htable", "expires", "expiry")
457
+modparam("htable", "expires_column", "expiry")
532 458
 ...
533 459
 
534
-3.8. array_size_suffix (str)
460
+1.3.8. array_size_suffix (str)
535 461
 
536 462
    The suffix to be added to store the number of items in an array (see
537 463
    key type).
... ...
@@ -543,7 +469,7 @@ modparam("htable", "expires", "expiry")
543 469
 modparam("htable", "array_size_suffix", "-count")
544 470
 ...
545 471
 
546
-3.9. fetch_rows (integer)
472
+1.3.9. fetch_rows (integer)
547 473
 
548 474
    How many rows to fetch at once from database.
549 475
 
... ...
@@ -554,7 +480,7 @@ modparam("htable", "array_size_suffix", "-count")
554 480
 modparam("htable", "fetch_rows", 1000)
555 481
 ...
556 482
 
557
-3.10. timer_interval (integer)
483
+1.3.10. timer_interval (integer)
558 484
 
559 485
    Interval in seconds to check for expired htable values.
560 486
 
... ...
@@ -565,7 +491,7 @@ modparam("htable", "fetch_rows", 1000)
565 491
 modparam("htable", "timer_interval", 10)
566 492
 ...
567 493
 
568
-3.11. db_expires (integer)
494
+1.3.11. db_expires (integer)
569 495
 
570 496
    If set to 1, the module will load/save the expires values of the items
571 497
    in hash table from/to database. It applies only to hash tables that
... ...
@@ -578,7 +504,7 @@ modparam("htable", "timer_interval", 10)
578 504
 modparam("htable", "db_expires", 1)
579 505
 ...
580 506
 
581
-3.12. enable_dmq (integer)
507
+1.3.12. enable_dmq (integer)
582 508
 
583 509
    If set to 1, will enable DMQ replication of actions performed upon
584 510
    entries in all tables having "dmqreplicate" parameter set. Any update
... ...
@@ -600,7 +526,7 @@ modparam("htable", "db_expires", 1)
600 526
 modparam("htable", "enable_dmq", 1)
601 527
 ...
602 528
 
603
-3.13. timer_procs (integer)
529
+1.3.13. timer_procs (integer)
604 530
 
605 531
    If set to 1 or greater, the module will create its own timer processes
606 532
    to scan for expired items in hash tables. If set to zero, it will use
... ...
@@ -614,7 +540,7 @@ modparam("htable", "enable_dmq", 1)
614 540
 modparam("htable", "timer_procs", 4)
615 541
 ...
616 542
 
617
-3.14. event_callback (str)
543
+1.3.14. event_callback (str)
618 544
 
619 545
    The name of the function in the kemi configuration file (embedded
620 546
    scripting language such as Lua, Python, ...) to be executed instead of
... ...
@@ -634,19 +560,9 @@ function ksr_htable_event(evname)
634 560
 end
635 561
 ...
636 562
 
637
-4. Functions
563
+1.4. Functions
638 564
 
639
-   4.1. sht_print()
640
-   4.2. sht_rm_name_re(htable=>regexp)
641
-   4.3. sht_rm_value_re(htable=>regexp)
642
-   4.4. sht_reset(htable)
643
-   4.5. sht_lock(htable=>key)
644
-   4.6. sht_unlock(htable=>key)
645
-   4.7. sht_iterator_start(iname, hname)
646
-   4.8. sht_iterator_end(iname)
647
-   4.9. sht_iterator_next(iname)
648
-
649
-4.1.  sht_print()
565
+1.4.1.  sht_print()
650 566
 
651 567
    Dump content of hash table to L_ERR log level. Intended for debug
652 568
    purposes.
... ...
@@ -659,7 +575,7 @@ end
659 575
 sht_print();
660 576
 ...
661 577
 
662
-4.2.  sht_rm_name_re(htable=>regexp)
578
+1.4.2.  sht_rm_name_re(htable=>regexp)
663 579
 
664 580
    Delete all entries in the htable that match the name against regular
665 581
    expression.
... ...
@@ -672,7 +588,7 @@ sht_print();
672 588
 sht_rm_name_re("ha=>.*");
673 589
 ...
674 590
 
675
-4.3.  sht_rm_value_re(htable=>regexp)
591
+1.4.3.  sht_rm_value_re(htable=>regexp)
676 592
 
677 593
    Delete all entries in the htable that match the value against regular
678 594
    expression.
... ...
@@ -685,7 +601,7 @@ sht_rm_name_re("ha=>.*");
685 601
 sht_rm_value_re("ha=>.*");
686 602
 ...
687 603
 
688
-4.4.  sht_reset(htable)
604
+1.4.4.  sht_reset(htable)
689 605
 
690 606
    Delete all entries in the htable. The name of the hash table can be a
691 607
    dynamic string with variables.
... ...
@@ -697,7 +613,7 @@ sht_rm_value_re("ha=>.*");
697 613
 sht_reset("ha$var(x)");
698 614
 ...
699 615
 
700
-4.5.  sht_lock(htable=>key)
616
+1.4.5.  sht_lock(htable=>key)
701 617
 
702 618
    Lock the slot in htable corresponding to the key item. Note that the
703 619
    locking is re-entrant for the process, therefore the lock and unlock
... ...
@@ -710,7 +626,7 @@ sht_reset("ha$var(x)");
710 626
 sht_lock("ha=>test");
711 627
 ...
712 628
 
713
-4.6.  sht_unlock(htable=>key)
629
+1.4.6.  sht_unlock(htable=>key)
714 630
 
715 631
    Unlock the slot in htable corespoding to the key item. Note that the
716 632
    locking is re-entrant for the process, therefore the lock and unlock
... ...
@@ -725,7 +641,7 @@ $sht(ha=>test) = $sht(ha=>test) + 10;
725 641
 sht_unlock("ha=>test");
726 642
 ...
727 643
 
728
-4.7.  sht_iterator_start(iname, hname)
644
+1.4.7.  sht_iterator_start(iname, hname)
729 645
 
730 646
    Start an iterator for hash table named by the value of parameter hname.
731 647
    The parameter iname is used to identify the iterator. There can be up
... ...
@@ -745,7 +661,7 @@ sht_unlock("ha=>test");
745 661
 sht_iterator_start("i1", "h1");
746 662
 ...
747 663
 
748
-4.8.  sht_iterator_end(iname)
664
+1.4.8.  sht_iterator_end(iname)
749 665
 
750 666
    Close the iterator identified by iname parameter and release the hash
751 667
    table slot aquired by the iterator. The iname value must be the same
... ...
@@ -760,7 +676,7 @@ sht_iterator_start("i1", "h1");
760 676
 sht_iterator_end("i1");
761 677
 ...
762 678
 
763
-4.9.  sht_iterator_next(iname)
679
+1.4.9.  sht_iterator_next(iname)
764 680
 
765 681
    Move the iterator to the next item in hash table. It must be called
766 682
    also after sht_iterator_start() to get the first item in the hash
... ...
@@ -786,7 +702,7 @@ sht_iterator_end("i1");
786 702
     sht_iterator_end("i1");
787 703
 ...
788 704
 
789
-5. Exported pseudo-variables
705
+1.5. Exported pseudo-variables
790 706
 
791 707
      * $sht(htable=>key)
792 708
      * $shtex(htable=>key)
... ...
@@ -800,18 +716,9 @@ sht_iterator_end("i1");
800 716
    Exported pseudo-variables are documented at
801 717
    http://www.kamailio.org/wiki/.
802 718
 
803
-6. RPC Commands
804
-
805
-   6.1. htable.get htable key
806
-   6.2. htable.delete htable key
807
-   6.3. htable.sets htable key value
808
-   6.4. htable.seti htable key value
809
-   6.5. htable.dump htable
810
-   6.6. htable.reload htable
811
-   6.7. htable.listTables
812
-   6.8. htable.stats
719
+1.6. RPC Commands
813 720
 
814
-6.1.  htable.get htable key
721
+1.6.1.  htable.get htable key
815 722
 
816 723
    Lists one value in a hash table
817 724
 
... ...
@@ -830,7 +737,7 @@ kamcmd htable.get students alice
830 737
 kamcmd htable.get students course[0]
831 738
 ...
832 739
 
833
-6.2.  htable.delete htable key
740
+1.6.2.  htable.delete htable key
834 741
 
835 742
    Delete one value in a hash table
836 743
 
... ...
@@ -849,7 +756,7 @@ kamcmd htable.delete students alice
849 756
 kamcmd htable.delete students course[0]
850 757
 ...
851 758
 
852
-6.3.  htable.sets htable key value
759
+1.6.3.  htable.sets htable key value
853 760
 
854 761
    Set an item in hash table to string value.
855 762
 
... ...
@@ -869,7 +776,7 @@ kamcmd htable.sets test x abc
869 776
 kamcmd htable.sets test x[0] abc
870 777
 ...
871 778
 
872
-6.4.  htable.seti htable key value
779
+1.6.4.  htable.seti htable key value
873 780
 
874 781
    Set an item in hash table to integer value.
875 782
 
... ...
@@ -889,7 +796,7 @@ kamcmd htable.seti test x 123
889 796
 kamcmd htable.sets test x[0] 123
890 797
 ...
891 798
 
892
-6.5.  htable.dump htable
799
+1.6.5.  htable.dump htable
893 800
 
894 801
    Lists all the values in a hash table
895 802
 
... ...
@@ -903,7 +810,7 @@ kamcmd htable.sets test x[0] 123
903 810
 kamcmd htable.dump ipban
904 811
 ...
905 812
 
906
-6.6.  htable.reload htable
813
+1.6.6.  htable.reload htable
907 814
 
908 815
    Reload hash table from database.
909 816
 
... ...
@@ -917,7 +824,7 @@ kamcmd htable.dump ipban
917 824
 kamcmd htable.reload ipban
918 825
 ...
919 826
 
920
-6.7.  htable.listTables
827
+1.6.7.  htable.listTables
921 828
 
922 829
    Lists all defined tables
923 830
 
... ...
@@ -931,7 +838,7 @@ kamcmd htable.reload ipban
931 838
 kamcmd htable.listTables
932 839
 ...
933 840
 
934
-6.8.  htable.stats
841
+1.6.8.  htable.stats
935 842
 
936 843
    Get statistics for hash tables - name, number of slots, number of
937 844
    items, max number of items per slot, min number of items per slot.
... ...
@@ -946,12 +853,9 @@ kamcmd htable.listTables
946 853
 kamcmd htable.stats
947 854
 ...
948 855
 
949
-7. Event routes
950
-
951
-   7.1. htable:mod-init
952
-   7.2. htable:expired:<table>
856
+1.7. Event routes
953 857
 
954
-7.1.  htable:mod-init
858
+1.7.1.  htable:mod-init
955 859
 
956 860
    When defined, the module calls event_route[htable:mod-init] after all
957 861
    modules have been initialized. A typical use case is to initialise
... ...
@@ -964,7 +868,7 @@ event_route[htable:mod-init] {
964 868
 }
965 869
 ...
966 870
 
967
-7.2.  htable:expired:<table>
871
+1.7.2.  htable:expired:<table>
968 872
 
969 873
    When defined, the module calls event_route[htable:expired:<table>] when
970 874
    an entry in the given table expires. In this event route, the key and
... ...
@@ -534,7 +534,7 @@ modparam("htable", "key_value_column", "kvalue")
534 534
 		<title>Set <varname>expires_column</varname> parameter</title>
535 535
 		<programlisting format="linespecific">
536 536
 ...
537
-modparam("htable", "expires", "expiry")
537
+modparam("htable", "expires_column", "expiry")
538 538
 ...
539 539
 </programlisting>
540 540
 		</example>