Browse code

modules: readme files regenerated - mtree ... [skip ci]

Kamailio Dev authored on 29/05/2021 14:01:22
Showing 1 changed files
... ...
@@ -45,9 +45,12 @@ Juha Heinanen
45 45
               3.8. char_list (string)
46 46
               3.9. pv_value (string)
47 47
               3.10. pv_values (string)
48
-              3.11. mt_tree_type (integer)
49
-              3.12. mt_ignore_duplicates (integer)
50
-              3.13. mt_allow_duplicates (integer)
48
+              3.11. pv_dstid (string)
49
+              3.12. pv_weight (string)
50
+              3.13. pv_count (string)
51
+              3.14. mt_tree_type (integer)
52
+              3.15. mt_ignore_duplicates (integer)
53
+              3.16. mt_allow_duplicates (integer)
51 54
 
52 55
         4. Functions
53 56
 
... ...
@@ -79,11 +82,14 @@ Juha Heinanen
79 82
    1.8. Set char_list parameter
80 83
    1.9. Set pv_value parameter
81 84
    1.10. Set pv_values parameter
82
-   1.11. Set mt_tree_type parameter
83
-   1.12. Set mt_ignore_duplicates parameter
84
-   1.13. Set mt_allow_duplicates parameter
85
-   1.14. mt_match usage
86
-   1.15. mtree.list rpc usage
85
+   1.11. Set pv_dstid parameter
86
+   1.12. Set pv_weight parameter
87
+   1.13. Set pv_count parameter
88
+   1.14. Set mt_tree_type parameter
89
+   1.15. Set mt_ignore_duplicates parameter
90
+   1.16. Set mt_allow_duplicates parameter
91
+   1.17. mt_match usage
92
+   1.18. mtree.list rpc usage
87 93
 
88 94
 Chapter 1. Admin Guide
89 95
 
... ...
@@ -107,9 +113,12 @@ Chapter 1. Admin Guide
107 113
         3.8. char_list (string)
108 114
         3.9. pv_value (string)
109 115
         3.10. pv_values (string)
110
-        3.11. mt_tree_type (integer)
111
-        3.12. mt_ignore_duplicates (integer)
112
-        3.13. mt_allow_duplicates (integer)
116
+        3.11. pv_dstid (string)
117
+        3.12. pv_weight (string)
118
+        3.13. pv_count (string)
119
+        3.14. mt_tree_type (integer)
120
+        3.15. mt_ignore_duplicates (integer)
121
+        3.16. mt_allow_duplicates (integer)
113 122
 
114 123
    4. Functions
115 124
 
... ...
@@ -163,9 +172,12 @@ Chapter 1. Admin Guide
163 172
    3.8. char_list (string)
164 173
    3.9. pv_value (string)
165 174
    3.10. pv_values (string)
166
-   3.11. mt_tree_type (integer)
167
-   3.12. mt_ignore_duplicates (integer)
168
-   3.13. mt_allow_duplicates (integer)
175
+   3.11. pv_dstid (string)
176
+   3.12. pv_weight (string)
177
+   3.13. pv_count (string)
178
+   3.14. mt_tree_type (integer)
179
+   3.15. mt_ignore_duplicates (integer)
180
+   3.16. mt_allow_duplicates (integer)
169 181
 
170 182
 3.1. db_url (string)
171 183
 
... ...
@@ -209,9 +221,16 @@ modparam("mtree", "db_table", "mtrees")
209 221
        separated string, which will be associated with the prefix (string
210 222
        transformation {s.select,...) can be used in configuration file to
211 223
        extract a specific column value).
212
-     * type - the type of tree elements (0 = string, 2 = integer). It is
213
-       valid only when the (tprefix, tvalue) pairs are loaded (not for
214
-       multi-column values).
224
+     * type - the type of tree elements (0 = string, 1 = d:w, 2 =
225
+       integer). None-zero is valid only when the (tprefix, tvalue) pairs
226
+       are loaded (not for multi-column values).
227
+       When the type is 1, the value in database has to be two integers
228
+       separated by colon, the first one (d - dstid) will be stored in
229
+       pv_dstid AVP and the second (w - weight) will be stored in
230
+       pv_weight AVP. If in the matching records are many with the same
231
+       dstid, it will keep only the one with the longest prefix. Then the
232
+       records are ordered by the weight and stored in the specified AVPs.
233
+       The number of stored records is saved in pv_count variable.
215 234
      * multi - tells if dbtable can contain more than one tree (0 = one
216 235
        tree, 1 = more than one tree identified by tname column). It is
217 236
        valid only when the (tprefix, tvalue) pairs are loaded (not for
... ...
@@ -308,36 +327,72 @@ modparam("mtree", "pv_value", "$var(mtval)")
308 327
 modparam("mtree", "pv_values", "$avp(mtvals)")
309 328
 ...
310 329
 
311
-3.11. mt_tree_type (integer)
330
+3.11. pv_dstid (string)
331
+
332
+   The AVP name where to store the first integer value when tree type is
333
+   1.
334
+
335
+   Default value is “$avp(tdstid)”.
336
+
337
+   Example 1.11. Set pv_dstid parameter
338
+...
339
+modparam("mtree", "pv_dstid", "$var(dstid)")
340
+...
341
+
342
+3.12. pv_weight (string)
343
+
344
+   The AVP name where to store the second integer value when tree type is
345
+   1.
346
+
347
+   Default value is “$avp(tweight)”.
348
+
349
+   Example 1.12. Set pv_weight parameter
350
+...
351
+modparam("mtree", "pv_dstid", "$var(weight)")
352
+...
353
+
354
+3.13. pv_count (string)
355
+
356
+   The PV spec where to store the count of matched values when tree type
357
+   is 1. It can be any writable PV.
358
+
359
+   Default value is “$avp(tcount)”.
360
+
361
+   Example 1.13. Set pv_count parameter
362
+...
363
+modparam("mtree", "pv_count", "$var(count)")
364
+...
365
+
366
+3.14. mt_tree_type (integer)
312 367
 
313 368
    Default payload type for trees data stored in 'db_table'. Documented
314 369
    values are 0 for string payloads and 2 for integer payloads.
315 370
 
316 371
    Default value is 0.
317 372
 
318
-   Example 1.11. Set mt_tree_type parameter
373
+   Example 1.14. Set mt_tree_type parameter
319 374
 ...
320 375
 modparam("mtree", "mt_tree_type", 2)
321 376
 ...
322 377
 
323
-3.12. mt_ignore_duplicates (integer)
378
+3.15. mt_ignore_duplicates (integer)
324 379
 
325 380
    Ignore duplicated prefixes when loading data.
326 381
 
327 382
    Default value is 0.
328 383
 
329
-   Example 1.12. Set mt_ignore_duplicates parameter
384
+   Example 1.15. Set mt_ignore_duplicates parameter
330 385
 ...
331 386
 modparam("mtree", "mt_ignore_duplicates", 1)
332 387
 ...
333 388
 
334
-3.13. mt_allow_duplicates (integer)
389
+3.16. mt_allow_duplicates (integer)
335 390
 
336 391
    Allow duplicate prefixes when loading data.
337 392
 
338 393
    Default value is 0.
339 394
 
340
-   Example 1.13. Set mt_allow_duplicates parameter
395
+   Example 1.16. Set mt_allow_duplicates parameter
341 396
 ...
342 397
 modparam("mtree", "mt_allow_duplicates", 1)
343 398
 ...
... ...
@@ -349,16 +404,16 @@ modparam("mtree", "mt_allow_duplicates", 1)
349 404
 4.1.  mt_match(mtree, pv, mode)
350 405
 
351 406
    Match 'pv' value against 'mtree'. If 'mtree' type is 0 or 2 and value
352
-   of 'mode' is NOT 2, sets a value of the longest matching prefix to
353
-   pseudo variable specified by pv_value parameter. If 'mtree' type is 0
354
-   or 2 and value of 'mode' is 2, sets values of all matching prefixes to
355
-   avp specified by pv_values parameter so that a value of longest
356
-   matching prefix is in avp index 0. Parameter 'mode' can be an integer
357
-   constant or a pseudo variable with integer value.
407
+   of 'mode' is NOT 2, sets associated value of the longest matching
408
+   prefix to pseudo variable specified by pv_value parameter. If 'mtree'
409
+   type is 0 or 2 and value of 'mode' is 2, sets values of all matching
410
+   prefixes to avp specified by pv_values parameter so that a value of
411
+   longest matching prefix is in avp index 0. Parameter 'mode' can be an
412
+   integer constant or a pseudo variable with integer value.
358 413
 
359 414
    Returns 1 if match succeeded and -1 otherwise.
360 415
 
361
-   Example 1.14. mt_match usage
416
+   Example 1.17. mt_match usage
362 417
 ...
363 418
 mt_match("mytree", "$rU", "0");
364 419
 ...
... ...
@@ -379,7 +434,7 @@ mt_match("mytree", "$rU", "0");
379 434
    Parameters:
380 435
      * _mtree_ : name of tree to list (optional).
381 436
 
382
-   Example 1.15. mtree.list rpc usage
437
+   Example 1.18. mtree.list rpc usage
383 438
 ...
384 439
 kamcmd mtree.list
385 440
 kamcmd mtree.list mytree