Browse code

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

Kamailio Dev authored on 26/03/2021 12:46:37
Showing 1 changed files
... ...
@@ -52,8 +52,6 @@ Elena-Ramona Modroiu
52 52
               5.1. pdt.list
53 53
               5.2. pdt.reload
54 54
 
55
-        6. Installation and Running
56
-
57 55
    List of Examples
58 56
 
59 57
    1.1. prefix-domain translation
... ...
@@ -103,8 +101,6 @@ Chapter 1. Admin Guide
103 101
         5.1. pdt.list
104 102
         5.2. pdt.reload
105 103
 
106
-   6. Installation and Running
107
-
108 104
 1. Overview
109 105
 
110 106
    This module translates a numerical prefix into a domain and updates
... ...
@@ -431,8 +427,3 @@ kamcmd pdt.list kamailio.org 123
431 427
 ...
432 428
 kamcmd pdt.reload
433 429
 ...
434
-
435
-6. Installation and Running
436
-
437
-   Example shell scripts for MI FIFO commands are placed in './doc/'
438
-   (pdt_fifo_add.sh, pdt_fifo_delete.sh, pdt_fifo_list.sh).
Browse code

modules: readme files regenerated - benchmark ...

Kamailio Dev authored on 14/01/2017 12:16:33
Showing 1 changed files
... ...
@@ -407,8 +407,7 @@ pd_translate("*", "$var(a)");
407 407
 
408 408
    RPC Command Example:
409 409
 ...
410
-# kamcmd _sdomain_ _prefix_ _domain_
411
-kamcmd kamailio.org 123
410
+kamcmd pdt.list kamailio.org 123
412 411
 ...
413 412
 
414 413
    Examples:
Browse code

modules: readme files regenerated - pdt ...

Kamailio Dev authored on 02/01/2017 11:31:16
Showing 1 changed files
... ...
@@ -47,10 +47,10 @@ Elena-Ramona Modroiu
47 47
               4.3. prefix2domain()
48 48
               4.4. pd_translate(sdomain, rewrite_mode)
49 49
 
50
-        5. MI Commands
50
+        5. RPC Commands
51 51
 
52
-              5.1. pdt_list
53
-              5.2. pdt_reload
52
+              5.1. pdt.list
53
+              5.2. pdt.reload
54 54
 
55 55
         6. Installation and Running
56 56
 
... ...
@@ -98,10 +98,10 @@ Chapter 1. Admin Guide
98 98
         4.3. prefix2domain()
99 99
         4.4. pd_translate(sdomain, rewrite_mode)
100 100
 
101
-   5. MI Commands
101
+   5. RPC Commands
102 102
 
103
-        5.1. pdt_list
104
-        5.2. pdt_reload
103
+        5.1. pdt.list
104
+        5.2. pdt.reload
105 105
 
106 106
    6. Installation and Running
107 107
 
... ...
@@ -378,22 +378,22 @@ pd_translate("$fd", "2");
378 378
 pd_translate("*", "$var(a)");
379 379
 ...
380 380
 
381
-5. MI Commands
381
+5. RPC Commands
382 382
 
383
-   5.1. pdt_list
384
-   5.2. pdt_reload
383
+   5.1. pdt.list
384
+   5.2. pdt.reload
385 385
 
386 386
    The database is loaded by Kamailio at start up time. The module uses
387 387
    only the cache to look up domains. If you want to add or delete a new
388
-   prefix-domain pair at runtime you have to use MI FIFO commands. All
389
-   changes made via these commands are applied to database and the cache
390
-   is updated correspondingly.
388
+   prefix-domain pair at runtime you have to use RPC commands. All changes
389
+   made via these commands are applied to database and the cache is
390
+   updated correspondingly.
391 391
 
392
-5.1.  pdt_list
392
+5.1.  pdt.list
393 393
 
394 394
    Produces a listing of the entries prefixes/domains/sdomains.
395 395
 
396
-   Name: pdt_list
396
+   Name: pdt.list
397 397
 
398 398
    Parameters:
399 399
      * _sdomain_ : a source domain value.
... ...
@@ -405,33 +405,33 @@ pd_translate("*", "$var(a)");
405 405
    The comparison operation is 'START WITH' -- if domain is 'a' then all
406 406
    domains starting with 'a' are listed.
407 407
 
408
-   MI FIFO Command Format:
409
-                :pdt_list:_reply_fifo_file_
410
-                _sdomain_
411
-                _prefix_
412
-                _domain_
413
-                _empty_line_
408
+   RPC Command Example:
409
+...
410
+# kamcmd _sdomain_ _prefix_ _domain_
411
+kamcmd kamailio.org 123
412
+...
414 413
 
415 414
    Examples:
416
-     * “pdt_list siph 2 .” : Lists the entries where sdomain is starting
415
+     * “pdt.list siph 2 .” : Lists the entries where sdomain is starting
417 416
        with 'siph', prefix is starting with '2' and domain is anything
418
-     * “pdt_list siph 2” : Lists the entries where sdomain is starting
417
+     * “pdt.list siph 2” : Lists the entries where sdomain is starting
419 418
        with 'siph', prefix is starting with '2' and domain is anything
420
-     * “pdt_list . 2 open” : Lists the entries where sdomain is anything,
419
+     * “pdt.list . 2 open” : Lists the entries where sdomain is anything,
421 420
        prefix starts with '2' and domain starts with 'open'.
422 421
 
423
-5.2.  pdt_reload
422
+5.2.  pdt.reload
424 423
 
425 424
    Reload all sdomain-prefix-domain records from database.
426 425
 
427
-   Name: pdt_reload
426
+   Name: pdt.reload
428 427
 
429 428
    Parameters:
430 429
      * none
431 430
 
432
-   MI FIFO Command Format:
433
-                :pdt_reload:_reply_fifo_file_
434
-                _empty_line_
431
+   RPC Command Example:
432
+...
433
+kamcmd pdt.reload
434
+...
435 435
 
436 436
 6. Installation and Running
437 437
 
Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,439 @@
1
+pdt Module
2
+
3
+Elena-Ramona Modroiu
4
+
5
+   asipto.com
6
+   <ramona@asipto.com>
7
+
8
+Edited by
9
+
10
+Elena-Ramona Modroiu
11
+
12
+   <ramona@asipto.com>
13
+
14
+   Copyright © 2003 FhG FOKUS
15
+
16
+   Copyright © 2004 Voice Sistem SRL
17
+
18
+   Copyright © 2008 Elena-Ramona Modroiu
19
+     __________________________________________________________________
20
+
21
+   Table of Contents
22
+
23
+   1. Admin Guide
24
+
25
+        1. Overview
26
+        2. Dependencies
27
+
28
+              2.1. Kamailio Modules
29
+              2.2. External Libraries or Applications
30
+
31
+        3. Parameters
32
+
33
+              3.1. db_url (string)
34
+              3.2. db_table (string)
35
+              3.3. sdomain_column (string)
36
+              3.4. prefix_column (string)
37
+              3.5. domain_column (string)
38
+              3.6. prefix (string)
39
+              3.7. fetch_rows (integer)
40
+              3.8. char_list (string)
41
+              3.9. check_domain (integer)
42
+
43
+        4. Functions
44
+
45
+              4.1. prefix2domain(rewrite_mode, multidomain_mode)
46
+              4.2. prefix2domain(rewrite_mode)
47
+              4.3. prefix2domain()
48
+              4.4. pd_translate(sdomain, rewrite_mode)
49
+
50
+        5. MI Commands
51
+
52
+              5.1. pdt_list
53
+              5.2. pdt_reload
54
+
55
+        6. Installation and Running
56
+
57
+   List of Examples
58
+
59
+   1.1. prefix-domain translation
60
+   1.2. Set db_url parameter
61
+   1.3. Set db_table parameter
62
+   1.4. Set sdomain_column parameter
63
+   1.5. Set prefix_column parameter
64
+   1.6. Set domain_column parameter
65
+   1.7. Set prefix parameter
66
+   1.8. Set fetch_rows parameter
67
+   1.9. Set char_list parameter
68
+   1.10. Set check_domain parameter
69
+   1.11. prefix2domain usage
70
+   1.12. pd_translate usage
71
+
72
+Chapter 1. Admin Guide
73
+
74
+   Table of Contents
75
+
76
+   1. Overview
77
+   2. Dependencies
78
+
79
+        2.1. Kamailio Modules
80
+        2.2. External Libraries or Applications
81
+
82
+   3. Parameters
83
+
84
+        3.1. db_url (string)
85
+        3.2. db_table (string)
86
+        3.3. sdomain_column (string)
87
+        3.4. prefix_column (string)
88
+        3.5. domain_column (string)
89
+        3.6. prefix (string)
90
+        3.7. fetch_rows (integer)
91
+        3.8. char_list (string)
92
+        3.9. check_domain (integer)
93
+
94
+   4. Functions
95
+
96
+        4.1. prefix2domain(rewrite_mode, multidomain_mode)
97
+        4.2. prefix2domain(rewrite_mode)
98
+        4.3. prefix2domain()
99
+        4.4. pd_translate(sdomain, rewrite_mode)
100
+
101
+   5. MI Commands
102
+
103
+        5.1. pdt_list
104
+        5.2. pdt_reload
105
+
106
+   6. Installation and Running
107
+
108
+1. Overview
109
+
110
+   This module translates a numerical prefix into a domain and updates
111
+   accordingly the request URI.
112
+
113
+   The module looks up at the R-URI part of a message and if the user part
114
+   begins with an established prefix it will update the URI. Updating the
115
+   uri consists of: remove the prefix from the user part of the uri and
116
+   keep the rest as the user part of the new uri. The host and port are
117
+   changed with the domain matched for the leading prefix and the domain
118
+   in From URI.
119
+
120
+   <prefix><userid><:password>@<mydomain.com> ...
121
+
122
+   and the result will be:
123
+
124
+   <userid><:password>@<domain[:port]>...
125
+
126
+   Example 1.1. prefix-domain translation
127
+prefix=123, domain(FROM)=siphub.org
128
+
129
+entry in database:
130
+ sdomain=siphub.org
131
+    domain[123]=alpha.org
132
+    domain[124]=beta.org
133
+    domain[125]=gamma.org
134
+
135
+The RURI will be updated in the following way"
136
+sip:12391001@mydomain.com  => sip:91001@alpha.org
137
+
138
+   The prefix could be prefixed by other digits. These digits will not be
139
+   used to look up the domain (the classic example, 00 used for
140
+   international calls, then follows the country prefix). For more
141
+   information on this, see 'prefix' parameter.
142
+     * A sample config file is located in './doc/'.
143
+     * MySQL script to create the database needed by PDT is located in
144
+       '../../scripts/mysql/pdt-create.sql'
145
+       The database is loaded by Kamailio only at start up time and only
146
+       cache is used to lookup domains. Check the MI Functions for
147
+       adding/deleting prefix-domain pairs or reloading from database at
148
+       runtime.
149
+     * Sample shell scripts to manage prefix-domain pairs are also located
150
+       in './doc/' (pdt_fifo_list.sh).
151
+
152
+2. Dependencies
153
+
154
+   2.1. Kamailio Modules
155
+   2.2. External Libraries or Applications
156
+
157
+2.1. Kamailio Modules
158
+
159
+   The following modules must be loaded before this module:
160
+     * A Kamailio database module (e.g., mysql, dbtext).
161
+
162
+2.2. External Libraries or Applications
163
+
164
+   The following libraries or applications must be installed before
165
+   running Kamailio with this module loaded:
166
+     * None.
167
+
168
+3. Parameters
169
+
170
+   3.1. db_url (string)
171
+   3.2. db_table (string)
172
+   3.3. sdomain_column (string)
173
+   3.4. prefix_column (string)
174
+   3.5. domain_column (string)
175
+   3.6. prefix (string)
176
+   3.7. fetch_rows (integer)
177
+   3.8. char_list (string)
178
+   3.9. check_domain (integer)
179
+
180
+3.1. db_url (string)
181
+
182
+   URL of the database table to be used.
183
+
184
+   Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”.
185
+
186
+   Example 1.2. Set db_url parameter
187
+...
188
+modparam("pdt", "db_url", "dbdriver://username:password@dbhost/dbname")
189
+...
190
+
191
+3.2. db_table (string)
192
+
193
+   Table name.
194
+
195
+   Default value is “pdt”.
196
+
197
+   Example 1.3. Set db_table parameter
198
+...
199
+modparam("pdt", "db_table", "pdt")
200
+...
201
+
202
+3.3. sdomain_column (string)
203
+
204
+   Name of 'sdomain' column.
205
+
206
+   Default value is “sdomain”.
207
+
208
+   Example 1.4. Set sdomain_column parameter
209
+...
210
+modparam("pdt", "domain_column", "source_domain")
211
+...
212
+
213
+3.4. prefix_column (string)
214
+
215
+   Name of 'prefix' column.
216
+
217
+   Default value is “prefix”.
218
+
219
+   Example 1.5. Set prefix_column parameter
220
+...
221
+modparam("pdt", "prefix_column", "prefix")
222
+...
223
+
224
+3.5. domain_column (string)
225
+
226
+   Name of 'domain' column.
227
+
228
+   Default value is “domain”.
229
+
230
+   Example 1.6. Set domain_column parameter
231
+...
232
+modparam("pdt", "domain_column", "hostname")
233
+...
234
+
235
+3.6. prefix (string)
236
+
237
+   Default leading prefix who denotes what URI needs to be translated - if
238
+   it is NULL the module will not check the R-URI against it and the PDT
239
+   prefix is considered starting from the first digit. Otherwise, the
240
+   module will check first if the R-URI starts with it and will skip it to
241
+   look up the domain.
242
+
243
+   Default value is NULL.
244
+
245
+   Example 1.7. Set prefix parameter
246
+...
247
+modparam("pdt", "prefix", "00")
248
+...
249
+
250
+3.7. fetch_rows (integer)
251
+
252
+   Number of rows to be loaded in one step from database.
253
+
254
+   Default value is 1000.
255
+
256
+   Example 1.8. Set fetch_rows parameter
257
+...
258
+modparam("pdt", "fetch_rows", 4000)
259
+...
260
+
261
+3.8. char_list (string)
262
+
263
+   The list with characters allowed in prefix.
264
+
265
+   Default value is “0123456789”.
266
+
267
+   Example 1.9. Set char_list parameter
268
+...
269
+modparam("pdt", "char_list", "0123456789*+")
270
+...
271
+
272
+3.9. check_domain (integer)
273
+
274
+   Module will check if destination domain is duplicated for same source
275
+   domain (1 - check; 0 - don't check).
276
+
277
+   Default value is 1.
278
+
279
+   Example 1.10. Set check_domain parameter
280
+...
281
+modparam("pdt", "check_domain", 0)
282
+...
283
+
284
+4. Functions
285
+
286
+   4.1. prefix2domain(rewrite_mode, multidomain_mode)
287
+   4.2. prefix2domain(rewrite_mode)
288
+   4.3. prefix2domain()
289
+   4.4. pd_translate(sdomain, rewrite_mode)
290
+
291
+4.1.  prefix2domain(rewrite_mode, multidomain_mode)
292
+
293
+   Build a new URI if it is necessary. Returns 1 when the translation was
294
+   made or there was nothing to translate (user part of the URI is empty,
295
+   it does not match the prefix parameter or there is no domain associated
296
+   with a possible prefix from user part). Returns -1 in error cases.
297
+
298
+   The translation is done based on lookup up for a entry in the database
299
+   where the sdomain equals the domain in FROM uri, and the prefix matches
300
+   the beginning of the user part of the RURI. If such an entry is found,
301
+   then the domain in RURI is updated with the domain of this entry
302
+   (sdomain, prefix, domain).
303
+
304
+   There is also the possibility to have the translation of URI regardless
305
+   of source domain. This can be achieved inserting in the database
306
+   entries where sdomain has the value "*".
307
+
308
+   The “rewrite_mode” parameter specifies whether to strip or not the
309
+   prefix from user part. The possible values are:
310
+     * 0: the prefix is removed along with the leading prefix.
311
+     * 1: only the leading prefix is removed.
312
+     * 2: the user part of the URI is not changed.
313
+     * $PV : any PV holding one of the above values.
314
+
315
+   The “multidomain_mode” parameter specifies the kind of multidomain
316
+   support to use. The possible values are:
317
+     * 0 : Translation of URI regardless of source domain.
318
+     * 1 : Translation of URI using as source domain the domain in
319
+       From-URI.
320
+     * 2 : Translation of URI using as source domain the domain in
321
+       From-URI. In case there is no entry for the required sdomain, it
322
+       tries the translation using "*" as sdomain.
323
+     * $PV : any PV holding one of the above values.
324
+
325
+   This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
326
+
327
+   Example 1.11. prefix2domain usage
328
+...
329
+prefix2domain("2", "2");
330
+...
331
+$var(a) = 1;
332
+prefix2domain("$var(a)", "2");
333
+...
334
+
335
+4.2.  prefix2domain(rewrite_mode)
336
+
337
+   The same as prefix2domain(rewrite_mode, "0"), that is without
338
+   multidomain support, translation of URI being done regardless of the
339
+   source domain.
340
+...
341
+prefix2domain("2");
342
+...
343
+
344
+4.3.  prefix2domain()
345
+
346
+   The same as prefix2domain("0", "0").
347
+...
348
+prefix2domain();
349
+...
350
+
351
+4.4.  pd_translate(sdomain, rewrite_mode)
352
+
353
+   Translate R-URI based on source domain and longest prefix matching.
354
+   Returns 1 when the translation was made or there was nothing to
355
+   translate. Returns -1 in error cases.
356
+
357
+   The translation is done based on lookup up for an entry in the database
358
+   where the sdomain parameter equals the sdomain in database table.
359
+
360
+   The “sdomain” parameter specifies the source domain to be used to match
361
+   the longest prefix. Can be a static string or dynamic parameter with
362
+   variables inside.
363
+
364
+   The “rewrite_mode” parameter specifies whether to strip or not the
365
+   prefix from user part. The possible values are:
366
+     * 0: the prefix is removed along with the leading prefix.
367
+     * 1: only the leading prefix is removed.
368
+     * 2: the user part of the URI is not changed.
369
+     * $PV : any PV holding one of the above values.
370
+
371
+   This function can be used from REQUEST_ROUTE, FAILURE_ROUTE or
372
+   BRANCH_ROUTE.
373
+
374
+   Example 1.12. pd_translate usage
375
+...
376
+pd_translate("$fd", "2");
377
+...
378
+pd_translate("*", "$var(a)");
379
+...
380
+
381
+5. MI Commands
382
+
383
+   5.1. pdt_list
384
+   5.2. pdt_reload
385
+
386
+   The database is loaded by Kamailio at start up time. The module uses
387
+   only the cache to look up domains. If you want to add or delete a new
388
+   prefix-domain pair at runtime you have to use MI FIFO commands. All
389
+   changes made via these commands are applied to database and the cache
390
+   is updated correspondingly.
391
+
392
+5.1.  pdt_list
393
+
394
+   Produces a listing of the entries prefixes/domains/sdomains.
395
+
396
+   Name: pdt_list
397
+
398
+   Parameters:
399
+     * _sdomain_ : a source domain value.
400
+     * _prefix_ : a prefix value
401
+     * _domain_: a domain value
402
+
403
+   "." (dot) means NULL value
404
+
405
+   The comparison operation is 'START WITH' -- if domain is 'a' then all
406
+   domains starting with 'a' are listed.
407
+
408
+   MI FIFO Command Format:
409
+                :pdt_list:_reply_fifo_file_
410
+                _sdomain_
411
+                _prefix_
412
+                _domain_
413
+                _empty_line_
414
+
415
+   Examples:
416
+     * “pdt_list siph 2 .” : Lists the entries where sdomain is starting
417
+       with 'siph', prefix is starting with '2' and domain is anything
418
+     * “pdt_list siph 2” : Lists the entries where sdomain is starting
419
+       with 'siph', prefix is starting with '2' and domain is anything
420
+     * “pdt_list . 2 open” : Lists the entries where sdomain is anything,
421
+       prefix starts with '2' and domain starts with 'open'.
422
+
423
+5.2.  pdt_reload
424
+
425
+   Reload all sdomain-prefix-domain records from database.
426
+
427
+   Name: pdt_reload
428
+
429
+   Parameters:
430
+     * none
431
+
432
+   MI FIFO Command Format:
433
+                :pdt_reload:_reply_fifo_file_
434
+                _empty_line_
435
+
436
+6. Installation and Running
437
+
438
+   Example shell scripts for MI FIFO commands are placed in './doc/'
439
+   (pdt_fifo_add.sh, pdt_fifo_delete.sh, pdt_fifo_list.sh).