Browse code

- regenerated all READMEs (make modules-readme exclude_modules="")

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4596 689a6050-402a-0410-94f2-e92a70836424

Klaus Darilion authored on 06/08/2008 10:49:19
Showing 33 changed files
... ...
@@ -1,3 +1,4 @@
1
+
1 2
 Auth_radius Module
2 3
 
3 4
 Jan Janak
... ...
@@ -28,8 +29,8 @@ Jan Janak
28 29
    Copyright � 2005 voice-system.ro
29 30
    Revision History
30 31
    Revision $Revision$ $Date: 2008-03-08 00:03:56 +0100
31
-                              (Sa, 08 Mär 2008) $
32
-     __________________________________________________________
32
+   (Sat, 08 Mar 2008) $
33
+     _________________________________________________________
33 34
 
34 35
    Table of Contents
35 36
 
... ...
@@ -81,16 +82,16 @@ Chapter 1. Admin Guide
81 82
 
82 83
 1.2. Additional Credentials
83 84
 
84
-   When performing authentification, the RADIUS server may include
85
-   in the response additional credentials. This scheme is very
86
-   useful in fetching additional user information from the RADIUS
87
-   server without making extra queries.
85
+   When performing authentification, the RADIUS server may
86
+   include in the response additional credentials. This scheme is
87
+   very useful in fetching additional user information from the
88
+   RADIUS server without making extra queries.
88 89
 
89 90
    The additional credentials are embedded in the RADIUS reply as
90 91
    AVPs "SIP-AVP". The syntax of the value is:
91
-     * value = SIP_AVP_NAME SIP_AVP_VALUE
92
-     * SIP_AVP_NAME = STRING_NAME | '#'ID_NUMBER
93
-     * SIP_AVP_VALUE = ':'STRING_VALUE | '#'NUMBER_VALUE
92
+     * value = SIP_AVP_NAME SIP_AVP_VALUE 
93
+     * SIP_AVP_NAME = STRING_NAME | '#'ID_NUMBER 
94
+     * SIP_AVP_VALUE = ':'STRING_VALUE | '#'NUMBER_VALUE 
94 95
 
95 96
    All additional credentials will be stored as Kamailio AVPs
96 97
    (SIP_AVP_NAME = SIP_AVP_VALUE).
... ...
@@ -113,8 +114,8 @@ Chapter 1. Admin Guide
113 114
 
114 115
 1.3.1. Kamailio Modules
115 116
 
116
-   The module depends on the following modules (in the other words
117
-   the listed modules must be loaded before this module):
117
+   The module depends on the following modules (in the other
118
+   words the listed modules must be loaded before this module):
118 119
      * auth -- Generic authentication functions
119 120
 
120 121
 1.3.2. External Libraries or Applications
... ...
@@ -129,8 +130,8 @@ Chapter 1. Admin Guide
129 130
 
130 131
 1.4.1. radius_config (string)
131 132
 
132
-   This is the location of the configuration file of radius client
133
-   libraries.
133
+   This is the location of the configuration file of radius
134
+   client libraries.
134 135
 
135 136
    Default value is
136 137
    "/usr/local/etc/radiusclient-ng/radiusclient.conf".
... ...
@@ -152,21 +153,22 @@ modparam("auth_radius", "service_type", 15)
152 153
 
153 154
 1.4.3. use_ruri_flag (integer)
154 155
 
155
-   When this parameter is set to the value other than "-1" and the
156
-   request being authenticated has flag with matching number set
157
-   via setflag() function, use Request URI instead of uri
156
+   When this parameter is set to the value other than "-1" and
157
+   the request being authenticated has flag with matching number
158
+   set via setflag() function, use Request URI instead of uri
158 159
    parameter value from the Authorization / Proxy-Authorization
159
-   header field to perform RADIUS authentication. This is intended
160
-   to provide workaround for misbehaving NAT / routers / ALGs that
161
-   alter request in the transit, breaking authentication. At the
162
-   time of this writing, certain versions of Linksys WRT54GL are
163
-   known to do that.
160
+   header field to perform RADIUS authentication. This is
161
+   intended to provide workaround for misbehaving NAT / routers /
162
+   ALGs that alter request in the transit, breaking
163
+   authentication. At the time of this writing, certain versions
164
+   of Linksys WRT54GL are known to do that.
164 165
 
165 166
    Default value is "-1".
166 167
 
167 168
    Example 1.4. use_ruri_flag parameter usage
168 169
 modparam("auth_radius", "use_ruri_flag", 22)
169 170
 
171
+
170 172
 1.5. Exported Functions
171 173
 
172 174
 1.5.1. radius_www_authorize(realm)
... ...
@@ -192,15 +194,15 @@ modparam("auth_radius", "use_ruri_flag", 22)
192 194
    they are valid or not.
193 195
 
194 196
    Meaning of the parameter is as follows:
195
-     * realm - Realm is a opaque string that the user agent should
196
-       present to the user so he can decide what username and
197
-       password to use. Usually this is domain of the host the
198
-       server is running on.
199
-       If an empty string "" is used then the server will generate
200
-       it from the request. In case of REGISTER requests To header
201
-       field domain will be used (because this header field
202
-       represents a user being registered), for all other messages
203
-       From header field domain will be used.
197
+     * realm - Realm is a opaque string that the user agent
198
+       should present to the user so he can decide what username
199
+       and password to use. Usually this is domain of the host
200
+       the server is running on.
201
+       If an empty string "" is used then the server will
202
+       generate it from the request. In case of REGISTER requests
203
+       To header field domain will be used (because this header
204
+       field represents a user being registered), for all other
205
+       messages From header field domain will be used.
204 206
        The string may contain pseudo variables.
205 207
 
206 208
    This function can be used from REQUEST_ROUTE.
... ...
@@ -229,12 +231,12 @@ if (!radius_www_authorize("siphub.net")) {
229 231
    they are valid or not.
230 232
 
231 233
    Meaning of the parameters is as follows:
232
-     * realm - Realm is a opaque string that the user agent should
233
-       present to the user so he can decide what username and
234
-       password to use. This is usually one of the domains the
235
-       proxy is responsible for. If an empty string "" is used
236
-       then the server will generate realm from host part of From
237
-       header field URI.
234
+     * realm - Realm is a opaque string that the user agent
235
+       should present to the user so he can decide what username
236
+       and password to use. This is usually one of the domains
237
+       the proxy is responsible for. If an empty string "" is
238
+       used then the server will generate realm from host part of
239
+       From header field URI.
238 240
        The string may contain pseudo variables.
239 241
      * uri_user - Uri_user is an optional pseudo variable
240 242
        parameter whose value, if present, will be given to Radius
... ...
@@ -247,13 +249,14 @@ if (!radius_www_authorize("siphub.net")) {
247 249
 
248 250
    Example 1.6. proxy_authorize usage
249 251
 ...
250
-if (!radius_proxy_authorize("")) {   # Realm and URI user will be autoge
251
-nerated
252
+if (!radius_proxy_authorize("")) {   # Realm and URI user will be autog
253
+enerated
252 254
         proxy_challenge("", "1");
253 255
 };
254 256
 ...
255
-if (!radius_proxy_authorize("$pd", "$pU")) { # Realm and URI user are ta
256
-ken
257
-        proxy_challenge("$pd", "1");         # from P-Preferred-Identity
257
+if (!radius_proxy_authorize("$pd", "$pU")) { # Realm and URI user are t
258
+aken
259
+        proxy_challenge("$pd", "1");         # from P-Preferred-Identit
260
+y
258 261
 };                                           # header field
259 262
 ...
... ...
@@ -1,3 +1,4 @@
1
+
1 2
 avp_radius Module
2 3
 
3 4
 Juha Heinanen
... ...
@@ -13,8 +14,8 @@ Daniel-Constantin Mierla
13 14
    Copyright � 2004 Juha Heinanen
14 15
    Revision History
15 16
    Revision $Revision$ $Date: 2008-03-08 00:03:56 +0100
16
-                              (Sa, 08 Mär 2008) $
17
-     __________________________________________________________
17
+   (Sat, 08 Mar 2008) $
18
+     _________________________________________________________
18 19
 
19 20
    Table of Contents
20 21
 
... ...
@@ -48,15 +49,15 @@ Chapter 1. Admin Guide
48 49
 
49 50
 1.1. Overview
50 51
 
51
-   avp_radius module allows loading of user's attributes into AVPs
52
-   from Radius. User's name and domain can be based on From URI,
53
-   Request URI, or authenticated credentials.
52
+   avp_radius module allows loading of user's attributes into
53
+   AVPs from Radius. User's name and domain can be based on From
54
+   URI, Request URI, or authenticated credentials.
54 55
 
55 56
    The module assumes that Radius returns the AVPs as values of
56 57
    reply attribute SIP-AVP. Its value must be a string of form:
57
-     * value = SIP_AVP_NAME SIP_AVP_VALUE
58
-     * SIP_AVP_NAME = STRING_NAME | '#'ID_NUMBER
59
-     * SIP_AVP_VALUE = ':'STRING_VALUE | '#'NUMBER_VALUE
58
+     * value = SIP_AVP_NAME SIP_AVP_VALUE 
59
+     * SIP_AVP_NAME = STRING_NAME | '#'ID_NUMBER 
60
+     * SIP_AVP_VALUE = ':'STRING_VALUE | '#'NUMBER_VALUE 
60 61
 
61 62
    Example 1.1. "SIP-AVP" RADIUS AVP exmaples
62 63
 ....
... ...
@@ -78,8 +79,8 @@ Chapter 1. Admin Guide
78 79
 
79 80
 1.2.1. Kamailio Modules
80 81
 
81
-   The module depends on the following modules (in the other words
82
-   the listed modules must be loaded before this module):
82
+   The module depends on the following modules (in the other
83
+   words the listed modules must be loaded before this module):
83 84
      * none
84 85
 
85 86
 1.2.2. External Libraries or Applications
... ...
@@ -94,8 +95,8 @@ Chapter 1. Admin Guide
94 95
 
95 96
 1.3.1. radius_config (string)
96 97
 
97
-   This is the location of the configuration file of radius client
98
-   libraries.
98
+   This is the location of the configuration file of radius
99
+   client libraries.
99 100
 
100 101
    Default value is
101 102
    "/usr/local/etc/radiusclient-ng/radiusclient.conf".
... ...
@@ -1,3 +1,4 @@
1
+
1 2
 carrierroute
2 3
 
3 4
 Jonas Appel
... ...
@@ -14,9 +15,9 @@ Henning Westerholt
14 15
 
15 16
    Copyright � 2007 1&1 Internet AG
16 17
    Revision History
17
-   Revision $Revision: 3912 $ $Date: 2008-03-10 16:13:24 +0100
18
-                              (Mo, 10 Mär 2008) $
19
-     __________________________________________________________
18
+   Revision $Revision: 4594 $ $Date: 2008-08-06 12:08:33 +0200
19
+   (Wed, 06 Aug 2008) $
20
+     _________________________________________________________
20 21
 
21 22
    Table of Contents
22 23
 
... ...
@@ -70,16 +71,16 @@ Henning Westerholt
70 71
 
71 72
         1.4. Exported Functions
72 73
 
73
-              1.4.1. cr_user_carrier(user, domain, dstavp)
74
+              1.4.1. cr_user_carrier(user, domain, dstavp) 
74 75
               1.4.2. cr_route(carrier, domain, prefix_matching,
75
-                      rewrite_user, hash_source, dstavp)
76
+                      rewrite_user, hash_source, dstavp) 
76 77
 
77 78
               1.4.3. cr_prime_route(carrier, domain,
78 79
                       prefix_matching, rewrite_user, hash_source,
79
-                      dstavp)
80
+                      dstavp) 
80 81
 
81 82
               1.4.4. cr_next_domain(carrier, domain,
82
-                      prefix_matching, host, reply_code, dstavp)
83
+                      prefix_matching, host, reply_code, dstavp) 
83 84
 
84 85
         1.5. MI Commands
85 86
 
... ...
@@ -169,25 +170,27 @@ Chapter 1. Admin Guide
169 170
    e.g. for failback routes or different routing rules for VoIP
170 171
    and PSTN targets.
171 172
 
172
-   Based on the tree, the module decides which number prefixes are
173
-   forwarded to which gateway. It can also distribute the traffic
174
-   by ratio parameters. Furthermore, the requests can be
173
+   Based on the tree, the module decides which number prefixes
174
+   are forwarded to which gateway. It can also distribute the
175
+   traffic by ratio parameters. Furthermore, the requests can be
175 176
    distributed by a hash funcion to predictable destinations. The
176 177
    hash source is configurable, two different hash functions are
177 178
    available.
178 179
 
179
-   This modules scales up to more than a few million users, and is
180
-   able to handle more than several hundred thousand routing table
181
-   entries. It should be able to handle more, but this is not that
182
-   much tested at the moment. In load balancing scenarios the
183
-   usage of the config file mode is recommended, to avoid the
184
-   additional complexity that the database driven routing creates.
185
-
186
-   Routing tables can be reloaded and edited (in config file mode)
187
-   with the MI interface, the config file is updated according the
188
-   changes. This is not implemented for the db interface, because
189
-   its easier to do the changes directly on the db. But the reload
190
-   and dump functions works of course here too.
180
+   This modules scales up to more than a few million users, and
181
+   is able to handle more than several hundred thousand routing
182
+   table entries. It should be able to handle more, but this is
183
+   not that much tested at the moment. In load balancing
184
+   scenarios the usage of the config file mode is recommended, to
185
+   avoid the additional complexity that the database driven
186
+   routing creates.
187
+
188
+   Routing tables can be reloaded and edited (in config file
189
+   mode) with the MI interface, the config file is updated
190
+   according the changes. This is not implemented for the db
191
+   interface, because its easier to do the changes directly on
192
+   the db. But the reload and dump functions works of course here
193
+   too.
191 194
 
192 195
    Some module functionality is not fully available in the config
193 196
    file mode, as it is not possible to specify all information
... ...
@@ -197,14 +200,15 @@ Chapter 1. Admin Guide
197 200
    database mode.
198 201
 
199 202
    Basically this module could be used as an replacement for the
200
-   lcr and the dispatcher module, if you have certain performance,
201
-   flexibility and/or integration requirements that these modules
202
-   don't handle properly. But for small installations it probably
203
-   make more sense to use the lcr and dispatcher module.
204
-
205
-   If you want to use this module in failure routes, then you need
206
-   to call "append_branch()" after rewriting the request URI in
207
-   order to relay the message to the new target. Its also
203
+   lcr and the dispatcher module, if you have certain
204
+   performance, flexibility and/or integration requirements that
205
+   these modules don't handle properly. But for small
206
+   installations it probably make more sense to use the lcr and
207
+   dispatcher module.
208
+
209
+   If you want to use this module in failure routes, then you
210
+   need to call "append_branch()" after rewriting the request URI
211
+   in order to relay the message to the new target. Its also
208 212
    supportes the usage of database derived failure routing
209 213
    descisions with the carrierfailureroute table.
210 214
 
... ...
@@ -213,11 +217,11 @@ Chapter 1. Admin Guide
213 217
 1.2.1. Kamailio Modules
214 218
 
215 219
    The following module must be loaded before this module:
216
-     * a database module, when a database is used as configuration
217
-       data source. Only SQL based databases are supported, as
218
-       this module needs the capability to issue raw queries. Its
219
-       not possible to use the dbtext or db_berkeley module at the
220
-       moment.
220
+     * a database module, when a database is used as
221
+       configuration data source. Only SQL based databases are
222
+       supported, as this module needs the capability to issue
223
+       raw queries. Its not possible to use the dbtext or
224
+       db_berkeley module at the moment.
221 225
      * The tm module, when you want to use the $T_reply_code
222 226
        pseudo-variable in the "cr_next_domain" function.
223 227
 
... ...
@@ -235,47 +239,50 @@ Chapter 1. Admin Guide
235 239
    Url to the database containing the routing data.
236 240
 
237 241
    Default value is
238
-   "mysql://openserro:openserro@localhost/openser".
242
+   "mysql://openserro:openserro@localhost/openser". 
239 243
 
240 244
    Example 1.1. Set db_url parameter
241 245
 ...
242
-modparam("carrierroute", "db_url", "dbdriver://username:password@dbhost/
243
-dbname")
246
+modparam("carrierroute", "db_url", "dbdriver://username:password@dbhost
247
+/dbname")
244 248
 ...
245 249
 
246 250
 1.3.2. db_table (string)
247 251
 
248 252
    Name of the table where the routing data is stored.
249 253
 
250
-   Default value is "carrierroute".
254
+   Default value is "carrierroute". 
251 255
 
252 256
    Example 1.2. Set db_table parameter
253 257
 ...
254 258
 modparam("carrierroute", "db_table", "carrierroute")
255 259
 ...
256 260
 
261
+
257 262
 1.3.3. id_column (string)
258 263
 
259 264
    Name of the column containing the id identifier.
260 265
 
261
-   Default value is "id".
266
+   Default value is "id". 
262 267
 
263 268
    Example 1.3. Set id_column parameter
264 269
 ...
265 270
 modparam("carrierroute", "id_column", "id")
266 271
 ...
267 272
 
273
+
268 274
 1.3.4. carrier_column (string)
269 275
 
270 276
    Name of the column containing the carrier id.
271 277
 
272
-   Default value is "carrier".
278
+   Default value is "carrier". 
273 279
 
274 280
    Example 1.4. Set carrier_column parameter
275 281
 ...
276 282
 modparam("carrierroute", "carrier_column", "carrier")
277 283
 ...
278 284
 
285
+
279 286
 1.3.5. scan_prefix_column (string)
280 287
 
281 288
    Name of column containing the scan prefixes. Scan prefixes
... ...
@@ -285,13 +292,14 @@ modparam("carrierroute", "carrier_column", "carrier")
285 292
    taken. If no prefix matches, the number is not routed. To
286 293
    prevent this, an empty prefix value of "" could be added.
287 294
 
288
-   Default value is "scan_prefix".
295
+   Default value is "scan_prefix". 
289 296
 
290 297
    Example 1.5. Set scan_prefix_column parameter
291 298
 ...
292 299
 modparam("carrierroute", "scan_prefix_column", "scan_prefix")
293 300
 ...
294 301
 
302
+
295 303
 1.3.6. domain_column (string)
296 304
 
297 305
    Name of column containing the rule domain. You can define
... ...
@@ -299,316 +307,341 @@ modparam("carrierroute", "scan_prefix_column", "scan_prefix")
299 307
    you use domain 0 for normal routing and domain 1 if domain 0
300 308
    failed.
301 309
 
302
-   Default value is "domain".
310
+   Default value is "domain". 
303 311
 
304 312
    Example 1.6. Set domain_column parameter
305 313
 ...
306 314
 modparam("carrierroute", "domain_column", "domain")
307 315
 ...
308 316
 
317
+
309 318
 1.3.7. flags_column (string)
310 319
 
311 320
    Name of the column containing the flags.
312 321
 
313
-   Default value is "flags".
322
+   Default value is "flags". 
314 323
 
315 324
    Example 1.7. Set flags_column parameter
316 325
 ...
317 326
 modparam("carrierroute", "flags_column", "flags")
318 327
 ...
319 328
 
329
+
320 330
 1.3.8. mask_column (string)
321 331
 
322 332
    Name of the column containing the flags mask.
323 333
 
324
-   Default value is "mask".
334
+   Default value is "mask". 
325 335
 
326 336
    Example 1.8. Set mask_column parameter
327 337
 ...
328 338
 modparam("carrierroute", "mask_column", "mask")
329 339
 ...
330 340
 
341
+
331 342
 1.3.9. prob_column (string)
332 343
 
333
-   Name of column containing probability. The probability value is
334
-   used to distribute the traffic between several gateways. Let's
335
-   say 70 % of the traffic shall be routed to gateway A, the other
336
-   30 % shall be routed to gateway B, we define a rule for gateway
337
-   A with a prob value of 0.7 and a rule for gateway B with a prob
338
-   value of 0.3.
344
+   Name of column containing probability. The probability value
345
+   is used to distribute the traffic between several gateways.
346
+   Let's say 70 % of the traffic shall be routed to gateway A,
347
+   the other 30 % shall be routed to gateway B, we define a rule
348
+   for gateway A with a prob value of 0.7 and a rule for gateway
349
+   B with a prob value of 0.3.
339 350
 
340 351
    If all probabilities for a given prefix, tree and domain don't
341 352
    add to 100%, the prefix values will be adjusted according the
342
-   given prob values. E.g. if three hosts with prob values of 0.5,
343
-   0.5 and 0.4 are defined, the resulting probabilities are
344
-   35.714, 35.714 and 28.571%. But its better to choose meaningful
345
-   values in the first place because of clarity.
353
+   given prob values. E.g. if three hosts with prob values of
354
+   0.5, 0.5 and 0.4 are defined, the resulting probabilities are
355
+   35.714, 35.714 and 28.571%. But its better to choose
356
+   meaningful values in the first place because of clarity.
346 357
 
347
-   Default value is "prob".
358
+   Default value is "prob". 
348 359
 
349 360
    Example 1.9. Set prob_column parameter
350 361
 ...
351 362
 modparam("carrierroute", "prob_column", "prob")
352 363
 ...
353 364
 
365
+
354 366
 1.3.10. rewrite_host_column (string)
355 367
 
356 368
    Name of column containing rewrite host value. An empty field
357 369
    represents a blacklist entry, anything else is put as domain
358 370
    part into the Request URI of the SIP message.
359 371
 
360
-   Default value is "rewrite_host".
372
+   Default value is "rewrite_host". 
361 373
 
362 374
    Example 1.10. Set rewrite_host_column parameter
363 375
 ...
364 376
 modparam("carrierroute", "rewrite_host_column", "rewrite_host")
365 377
 ...
366 378
 
379
+
367 380
 1.3.11. strip_column (string)
368 381
 
369 382
    Name of the column containing the number of digits to be
370 383
    stripped of the userpart of an URI before prepending
371 384
    rewrite_prefix.
372 385
 
373
-   Default value is "strip".
386
+   Default value is "strip". 
374 387
 
375 388
    Example 1.11. Set strip_column parameter
376 389
 ...
377 390
 modparam("carrierroute", "strip_column", "strip")
378 391
 ...
379 392
 
393
+
380 394
 1.3.12. comment_column (string)
381 395
 
382 396
    Name of the column containing an optional comment (useful in
383
-   large routing tables) The comment is also displayed by the fifo
384
-   cmd "cr_dump_routes".
397
+   large routing tables) The comment is also displayed by the
398
+   fifo cmd "cr_dump_routes".
385 399
 
386
-   Default value is "description".
400
+   Default value is "description". 
387 401
 
388 402
    Example 1.12. Set comment_column parameter
389 403
 ...
390 404
 modparam("carrierroute", "comment_column", "description")
391 405
 ...
392 406
 
407
+
393 408
 1.3.13. carrier_table (string)
394 409
 
395 410
    The name of the table containing the existing carriers,
396 411
    consisting of the ids and corresponding names.
397 412
 
398
-   Default value is "route_tree".
413
+   Default value is "route_tree". 
399 414
 
400 415
    Example 1.13. Set carrier_table parameter
401 416
 ...
402 417
 modparam("carrierroute", "carrier_table", "route_tree")
403 418
 ...
404 419
 
420
+
405 421
 1.3.14. rewrite_prefix_column (string)
406 422
 
407
-   Name of column containing rewrite prefixes. Here you can define
408
-   a rewrite prefix for the localpart of the SIP URI.
423
+   Name of column containing rewrite prefixes. Here you can
424
+   define a rewrite prefix for the localpart of the SIP URI.
409 425
 
410
-   Default value is "rewrite_prefix".
426
+   Default value is "rewrite_prefix". 
411 427
 
412 428
    Example 1.14. Set rewrite_prefix_column parameter
413 429
 ...
414 430
 modparam("carrierroute", "rewrite_prefix_column", "rewrite_prefix")
415 431
 ...
416 432
 
433
+
417 434
 1.3.15. rewrite_suffix_column (string)
418 435
 
419
-   Name of column containing rewrite suffixes. Here you can define
420
-   a rewrite suffix for the localpart of the SIP URI.
436
+   Name of column containing rewrite suffixes. Here you can
437
+   define a rewrite suffix for the localpart of the SIP URI.
421 438
 
422
-   Default value is "rewrite_suffix".
439
+   Default value is "rewrite_suffix". 
423 440
 
424 441
    Example 1.15. Set rewrite_suffix_column parameter
425 442
                             ...
426 443
 modparam("carrierroute", "rewrite_suffix_column", "rewrite_suffix")
427 444
                             ...
428 445
 
446
+
429 447
 1.3.16. carrier_id_col (string)
430 448
 
431 449
    The name of the column in the carrier table containing the
432 450
    carrier id.
433 451
 
434
-   Default value is "id".
452
+   Default value is "id". 
435 453
 
436 454
    Example 1.16. Set id_col parameter
437 455
 ...
438 456
 modparam("carrierroute", "carrier_id_col", "id")
439 457
 ...
440 458
 
459
+
441 460
 1.3.17. carrier_name_col (string)
442 461
 
443 462
    The name of the column in the carrier table containing the
444 463
    carrier name.
445 464
 
446
-   Default value is "carrier".
465
+   Default value is "carrier". 
447 466
 
448 467
    Example 1.17. Set carrier_name_col parameter
449 468
 ...
450 469
 modparam("carrierroute", "carrier_name_col", "carrier")
451 470
 ...
452 471
 
472
+
453 473
 1.3.18. subscriber_table (string)
454 474
 
455 475
    The name of the table containing the subscribers
456 476
 
457
-   Default value is "subscriber".
477
+   Default value is "subscriber". 
458 478
 
459 479
    Example 1.18. Set subscriber_table parameter
460 480
 ...
461 481
 modparam("carrierroute", "subscriber_table", "subscriber")
462 482
 ...
463 483
 
484
+
464 485
 1.3.19. subscriber_user_col (string)
465 486
 
466 487
    The name of the column in the subscriber table containing the
467 488
    usernames.
468 489
 
469
-   Default value is "username".
490
+   Default value is "username". 
470 491
 
471 492
    Example 1.19. Set subscriber_user_col parameter
472 493
 ...
473 494
 modparam("carrierroute", "subscriber_user_col", "username")
474 495
 ...
475 496
 
497
+
476 498
 1.3.20. subscriber_domain_col (string)
477 499
 
478 500
    The name of the column in the subscriber table containing the
479 501
    domain of the subscriber.
480 502
 
481
-   Default value is "domain".
503
+   Default value is "domain". 
482 504
 
483 505
    Example 1.20. Set subscriber_domain_col parameter
484 506
 ...
485 507
 modparam("carrierroute", "subscriber_domain_col", "domain")
486 508
 ...
487 509
 
510
+
488 511
 1.3.21. subscriber_carrier_col (string)
489 512
 
490 513
    The name of the column in the subscriber table containing the
491 514
    carrier id of the subscriber.
492 515
 
493
-   Default value is "cr_preferred_carrier".
516
+   Default value is "cr_preferred_carrier". 
494 517
 
495 518
    Example 1.21. Set subscriber_carrier_col parameter
496 519
 ...
497
-modparam("carrierroute", "subscriber_carrier_col", "cr_preferred_carrier
498
-")
520
+modparam("carrierroute", "subscriber_carrier_col", "cr_preferred_carrie
521
+r")
499 522
 ...
500 523
 
524
+
501 525
 1.3.22. config_source (string)
502 526
 
503 527
    Specifies whether the module loads its config data from a file
504 528
    or from a database. Possible values are file or db.
505 529
 
506
-   Default value is "file".
530
+   Default value is "file". 
507 531
 
508 532
    Example 1.22. Set config_source parameter
509 533
 ...
510 534
 modparam("carrierroute", "config_source", "file")
511 535
 ...
512 536
 
537
+
513 538
 1.3.23. config_file (string)
514 539
 
515 540
    Specifies the path to the config file.
516 541
 
517
-   Default value is "/etc/kamailio/carrierroute.conf".
542
+   Default value is "/etc/kamailio/carrierroute.conf". 
518 543
 
519 544
    Example 1.23. Set config_file parameter
520 545
 ...
521
-modparam("carrierroute", "config_file", "/etc/kamailio/carrierroute.conf"
522
-)
546
+modparam("carrierroute", "config_file", "/etc/kamailio/carrierroute.con
547
+f")
523 548
 ...
524 549
 
550
+
525 551
 1.3.24. default_tree (string)
526 552
 
527 553
    The name of the carrier tree used per default (if the current
528 554
    subscriber has no preferred tree)
529 555
 
530
-   Default value is "default".
556
+   Default value is "default". 
531 557
 
532 558
    Example 1.24. Set default_tree parameter
533 559
 ...
534 560
 modparam("carrierroute", "default_tree", "default")
535 561
 ...
536 562
 
563
+
537 564
 1.3.25. use_domain (int)
538 565
 
539 566
    When using tree lookup per user, this parameter specifies
540 567
    whether to use the domain part for user matching or not.
541 568
 
542
-   Default value is "0".
569
+   Default value is "0". 
543 570
 
544 571
    Example 1.25. Set use_domain parameter
545 572
 ...
546 573
 modparam("carrierroute", "use_domain", 0)
547 574
 ...
548 575
 
576
+
549 577
 1.3.26. fallback_default (int)
550 578
 
551
-   This parameter defines the behaviour when using user-based tree
552
-   lookup. If the user has a non-existing tree set and
579
+   This parameter defines the behaviour when using user-based
580
+   tree lookup. If the user has a non-existing tree set and
553 581
    fallback_default is set to 1, the default tree is used.
554 582
    Otherwise, cr_user_rewrite_uri returns an error.
555 583
 
556
-   Default value is "1".
584
+   Default value is "1". 
557 585
 
558 586
    Example 1.26. Set fallback_default parameter
559 587
 ...
560 588
 modparam("carrierroute", "fallback_default", 1)
561 589
 ...
562 590
 
591
+
563 592
 1.3.27. db_failure_table (string)
564 593
 
565 594
    Name of the table where the failure routing data is stored.
566 595
 
567
-   Default value is "carrierfailureroute".
596
+   Default value is "carrierfailureroute". 
568 597
 
569 598
    Example 1.27. Set db_failuretable parameter
570 599
 ...
571 600
 modparam("carrierroute", "db_failuretable", "carrierfailureroute")
572 601
 ...
573 602
 
603
+
574 604
 1.3.28. failure_id_column (string)
575 605
 
576 606
    Name of the column containing the id identifier.
577 607
 
578
-   Default value is "id".
608
+   Default value is "id". 
579 609
 
580 610
    Example 1.28. Set failure_id_column parameter
581 611
 ...
582 612
 modparam("carrierroute", "failure_id_column", "id")
583 613
 ...
584 614
 
615
+
585 616
 1.3.29. failure_carrier_column (string)
586 617
 
587 618
    Name of the column containing the carrier id.
588 619
 
589
-   Default value is "carrier".
620
+   Default value is "carrier". 
590 621
 
591 622
    Example 1.29. Set failure_carrier_column parameter
592 623
 ...
593 624
 modparam("carrierroute", "failure_carrier_column", "carrier")
594 625
 ...
595 626
 
627
+
596 628
 1.3.30. failure_scan_prefix_column (string)
597 629
 
598 630
    Name of column containing the scan prefixes. Scan prexies
599
-   define the matching portion of a phone number, e.g. we have the
600
-   scan prefixes 49721 and 49, the called number is 49721913740,
601
-   it matches 49721, because the longest match is taken. If no
602
-   prefix matches, the number is not failure routed. To prevent
603
-   this, an empty prefix value of "" could be added.
631
+   define the matching portion of a phone number, e.g. we have
632
+   the scan prefixes 49721 and 49, the called number is
633
+   49721913740, it matches 49721, because the longest match is
634
+   taken. If no prefix matches, the number is not failure routed.
635
+   To prevent this, an empty prefix value of "" could be added.
604 636
 
605
-   Default value is "scan_prefix".
637
+   Default value is "scan_prefix". 
606 638
 
607 639
    Example 1.30. Set failure_scan_prefix_column parameter
608 640
 ...
609 641
 modparam("carrierroute", "failure_scan_prefix_column", "scan_prefix")
610 642
 ...
611 643
 
644
+
612 645
 1.3.31. failure_domain_column (string)
613 646
 
614 647
    Name of column containing the rule domain. You can define
... ...
@@ -616,80 +649,87 @@ modparam("carrierroute", "failure_scan_prefix_column", "scan_prefix")
616 649
    you use domain 0 for normal routing and domain 1 if domain 0
617 650
    failed.
618 651
 
619
-   Default value is "domain".
652
+   Default value is "domain". 
620 653
 
621 654
    Example 1.31. Set failure_domain_column parameter
622 655
 ...
623 656
 modparam("carrierroute", "failure_domain_column", "domain")
624 657
 ...
625 658
 
659
+
626 660
 1.3.32. failure_host_name_column (string)
627 661
 
628
-   Name of the column containing the host name of the last routing
629
-   destination.
662
+   Name of the column containing the host name of the last
663
+   routing destination.
630 664
 
631
-   Default value is "host_name".
665
+   Default value is "host_name". 
632 666
 
633 667
    Example 1.32. Set failure_host_name_column parameter
634 668
 ...
635 669
 modparam("carrierroute", "failure_host_name_column", "host_name")
636 670
 ...
637 671
 
672
+
638 673
 1.3.33. failure_reply_code_column (string)
639 674
 
640 675
    Name of the column containing the reply code.
641 676
 
642
-   Default value is "reply_code".
677
+   Default value is "reply_code". 
643 678
 
644 679
    Example 1.33. Set failure_reply_code_column parameter
645 680
 ...
646 681
 modparam("carrierroute", "failure_reply_code_column", "reply_code")
647 682
 ...
648 683
 
684
+
649 685
 1.3.34. failure_flags_column (string)
650 686
 
651 687
    Name of the column containing the flags.
652 688
 
653
-   Default value is "flags".
689
+   Default value is "flags". 
654 690
 
655 691
    Example 1.34. Set failure_flags_column parameter
656 692
 ...
657 693
 modparam("carrierroute", "failure_flags_column", "flags")
658 694
 ...
659 695
 
696
+
660 697
 1.3.35. failure_mask_column (string)
661 698
 
662 699
    Name of the column containing the flags mask.
663 700
 
664
-   Default value is "mask".
701
+   Default value is "mask". 
665 702
 
666 703
    Example 1.35. Set failure_mask_column parameter
667 704
 ...
668 705
 modparam("carrierroute", "failure_mask_column", "mask")
669 706
 ...
670 707
 
708
+
671 709
 1.3.36. failure_next_domain_column (string)
672 710
 
673 711
    Name of the column containing the next routing domain.
674 712
 
675
-   Default value is "next_domain".
713
+   Default value is "next_domain". 
676 714
 
677 715
    Example 1.36. Set failure_next_domain_column parameter
678 716
 ...
679 717
 modparam("carrierroute", "failure_next_domain_column", "next_domain")
680 718
 ...
681 719
 
720
+
682 721
 1.3.37. failure_comment_column (string)
683 722
 
684 723
    Name of the column containing an optional comment.
685 724
 
686
-   Default value is "description".
725
+   Default value is "description". 
687 726
 
688 727
    Example 1.37. Set failure_comment_column parameter
689 728
 ...
690 729
 modparam("carrierroute", "failure_comment_column", "description")
691 730
 ...
692 731
 
732
+
693 733
 1.4. Exported Functions
694 734
 
695 735
    Previous versions of carriertree had some more function. All
... ...
@@ -730,8 +770,8 @@ cr_tree_rewrite_uri(tree, domain)
730 770
 
731 771
    Meaning of the parameters is as follows:
732 772
      * user - Name of the user for the carrier tree lookup.
733
-       Additional to a string any pseudo-variable could be used as
734
-       input.
773
+       Additional to a string any pseudo-variable could be used
774
+       as input.
735 775
      * domain - Name of the routing domain to be used. Additional
736 776
        to a string any pseudo-variable could be used as input.
737 777
      * dstavp - Name of the AVP where to store the carrier id.
... ...
@@ -739,16 +779,16 @@ cr_tree_rewrite_uri(tree, domain)
739 779
 1.4.2.  cr_route(carrier, domain, prefix_matching, rewrite_user,
740 780
 hash_source, dstavp)
741 781
 
742
-   This function searches for the longest match for the user given
743
-   in prefix_matching at the given domain in the given carrier
744
-   tree. The Request URI is rewritten using rewrite_user and the
745
-   given hash source and algorithm. Returns -1 if there is no data
746
-   found or an empty rewrite host on the longest match is found.
747
-   Otherwise the rewritten host is stored in the given AVP (if
748
-   obmitted, the host is not stored in an AVP). This function is
749
-   only usable with rewrite_user and prefix_matching containing a
750
-   valid numerical only string. It uses the standard crc32
751
-   algorithm to calculate the hash values.
782
+   This function searches for the longest match for the user
783
+   given in prefix_matching at the given domain in the given
784
+   carrier tree. The Request URI is rewritten using rewrite_user
785
+   and the given hash source and algorithm. Returns -1 if there
786
+   is no data found or an empty rewrite host on the longest match
787
+   is found. Otherwise the rewritten host is stored in the given
788
+   AVP (if obmitted, the host is not stored in an AVP). This
789
+   function is only usable with rewrite_user and prefix_matching
790
+   containing a valid numerical only string. It uses the standard
791
+   crc32 algorithm to calculate the hash values.
752 792
 
753 793
    Meaning of the parameters is as follows:
754 794
      * carrier - The routing tree to be used. Additional to a
... ...
@@ -767,22 +807,22 @@ hash_source, dstavp)
767 807
        configuration parameter max_targets. Possible values for
768 808
        hash_source are: call_id, from_uri, from_user, to_uri and
769 809
        to_user.
770
-     * dstavp - Name of the AVP where to store the rewritten host.
771
-       This parameter is optional.
810
+     * dstavp - Name of the AVP where to store the rewritten
811
+       host. This parameter is optional.
772 812
 
773 813
 1.4.3.  cr_prime_route(carrier, domain, prefix_matching,
774 814
 rewrite_user, hash_source, dstavp)
775 815
 
776
-   This function searches for the longest match for the user given
777
-   in prefix_matching at the given domain in the given carrier
778
-   tree. The Request URI is rewritten using rewrite_user and the
779
-   given hash source and algorithm. Returns -1 if there is no data
780
-   found or an empty rewrite host on the longest match is found.
781
-   Otherwise the rewritten host is stored in the given AVP (if
782
-   obmitted, the host is not stored in an AVP). This function is
783
-   only usable with rewrite_user and prefix_matching containing a
784
-   valid numerical only string. It uses the prime hash algorithm
785
-   to calculate the hash values.
816
+   This function searches for the longest match for the user
817
+   given in prefix_matching at the given domain in the given
818
+   carrier tree. The Request URI is rewritten using rewrite_user
819
+   and the given hash source and algorithm. Returns -1 if there
820
+   is no data found or an empty rewrite host on the longest match
821
+   is found. Otherwise the rewritten host is stored in the given
822
+   AVP (if obmitted, the host is not stored in an AVP). This
823
+   function is only usable with rewrite_user and prefix_matching
824
+   containing a valid numerical only string. It uses the prime
825
+   hash algorithm to calculate the hash values.
786 826
 
787 827
    Meaning of the parameters is as follows:
788 828
      * carrier - The routing tree to be used. Additional to a
... ...
@@ -801,22 +841,23 @@ rewrite_user, hash_source, dstavp)
801 841
        configuration parameter max_targets. Possible values for
802 842
        hash_source are: call_id, from_uri, from_user, to_uri and
803 843
        to_user.
804
-     * dstavp - Name of the AVP where to store the rewritten host.
805
-       This parameter is optional.
844
+     * dstavp - Name of the AVP where to store the rewritten
845
+       host. This parameter is optional.
806 846
 
807 847
 1.4.4.  cr_next_domain(carrier, domain, prefix_matching, host,
808 848
 reply_code, dstavp)
809 849
 
810
-   This function searches for the longest match for the user given
811
-   in prefix_matching at the given domain in the given carrier
812
-   failure tree. It tries to find a next domain matching the given
813
-   host, reply_code and the message flags. The matching is done in
814
-   this order: host, reply_code and then flags. The more wildcards
815
-   in reply_code and the more bits used in flags, the lower the
816
-   priority. Returns -1 if there is no data found or an empty
817
-   next_domain on the longest match is found. Otherwise the next
818
-   domain is stored in the given AVP. This function is only usable
819
-   with prefix_matching containing a valid numerical only string.
850
+   This function searches for the longest match for the user
851
+   given in prefix_matching at the given domain in the given
852
+   carrier failure tree. It tries to find a next domain matching
853
+   the given host, reply_code and the message flags. The matching
854
+   is done in this order: host, reply_code and then flags. The
855
+   more wildcards in reply_code and the more bits used in flags,
856
+   the lower the priority. Returns -1 if there is no data found
857
+   or an empty next_domain on the longest match is found.
858
+   Otherwise the next domain is stored in the given AVP. This
859
+   function is only usable with prefix_matching containing a
860
+   valid numerical only string.
820 861
 
821 862
    Meaning of the parameters is as follows:
822 863
      * carrier - The routing tree to be used. Additional to a
... ...
@@ -839,20 +880,20 @@ reply_code, dstavp)
839 880
 1.5. MI Commands
840 881
 
841 882
    All commands understand the "-?" parameter to print a short
842
-   help message. The options have to be quoted as one string to be
843
-   passed to MI interface. Each option except host and new host
844
-   can be wildcarded by * (but only * and not things like "-d
845
-   prox*").
883
+   help message. The options have to be quoted as one string to
884
+   be passed to MI interface. Each option except host and new
885
+   host can be wildcarded by * (but only * and not things like
886
+   "-d prox*").
846 887
 
847 888
 1.5.1. cr_reload_routes
848 889
 
849 890
    This command reloads the routing data from the data source.
850 891
 
851 892
    Important: When new domains have been added, a restart of the
852
-   server must be done, because the mapping of the ids used in the
853
-   config script cannot be updated at runtime at the moment. So a
854
-   reload could result in a wrong routing behaviour, because the
855
-   ids used in the script could differ from the one used
893
+   server must be done, because the mapping of the ids used in
894
+   the config script cannot be updated at runtime at the moment.
895
+   So a reload could result in a wrong routing behaviour, because
896
+   the ids used in the script could differ from the one used
856 897
    internally from the server. Modifying of already existing
857 898
    domains is no problem.
858 899
 
... ...
@@ -886,9 +927,9 @@ kamctl fifo cr_replace_host "-d proxy -p 49 -h proxy1 -t proxy2"
886 927
      * -h - the host to be deactivated
887 928
      * -t - the new host used as backup
888 929
 
889
-   When -t (new_host) is specified, the portion of traffic for the
890
-   deactivated host is routed to the host given by -t. This is
891
-   indicated in the output of dump_routes. The backup route is
930
+   When -t (new_host) is specified, the portion of traffic for
931
+   the deactivated host is routed to the host given by -t. This
932
+   is indicated in the output of dump_routes. The backup route is
892 933
    deactivated if the host is activated again.
893 934
 
894 935
    Use the "null" prefix to specify an empty prefix.
... ...
@@ -916,8 +957,8 @@ kamctl fifo cr_activate_host "-d proxy -p 49 -h proxy1"
916 957
 
917 958
 1.5.6. cr_add_host
918 959
 
919
-   This command adds a route rule, it is only usable in file mode.
920
-   Following options are possible:
960
+   This command adds a route rule, it is only usable in file
961
+   mode. Following options are possible:
921 962
      * -d - the domain containing the host
922 963
      * -p - the prefix containing the host
923 964
      * -h - the host to be added
... ...
@@ -963,7 +1004,8 @@ route {
963 1004
         # route calls based on hash over callid
964 1005
         # choose route domain 0 of the default carrier
965 1006
 
966
-        if(!cr_route("default", "0", "$rU", "$rU", "call_id", "crc32")){
1007
+        if(!cr_route("default", "0", "$rU", "$rU", "call_id", "crc32"))
1008
+{
967 1009
                 sl_send_reply("403", "Not allowed");
968 1010
         } else {
969 1011
                 # In case of failure, re-route the request
... ...
@@ -977,7 +1019,8 @@ failure_route[1] {
977 1019
         # In case of failure, send it to an alternative route:
978 1020
         if (t_check_status("408|5[0-9][0-9]")) {
979 1021
                 #choose route domain 1 of the default carrier
980
-        if(!cr_route("default", "1", "$rU", "$rU", "call_id", "crc32")){
1022
+        if(!cr_route("default", "1", "$rU", "$rU", "call_id", "crc32"))
1023
+{
981 1024
                         t_reply("403", "Not allowed");
982 1025
                 } else {
983 1026
                         t_on_failure("2");
... ...
@@ -990,15 +1033,16 @@ failure_route[2] {
990 1033
         # further processing
991 1034
 }
992 1035
 
993
-
994
-   Example 1.44. Configuration example - Routing to user tree
1036
+                   Example 1.44. Configuration example - Routing
1037
+   to user tree
995 1038
 ...
996 1039
 route[1] {
997 1040
         cr_user_carrier("$fU", "$fd", "$avp(s:carrier)");
998 1041
 
999 1042
         # just an example domain
1000 1043
         $avp(s:domain)="start";
1001
-        if (!cr_route("$avp(s:carrier)", "$avp(s:domain)", "$rU", "$rU",
1044
+        if (!cr_route("$avp(s:carrier)", "$avp(s:domain)", "$rU", "$rU"
1045
+,
1002 1046
                         "call_id", "$avp(s:host)")) {
1003 1047
                 xlog("L_ERR", "cr_route failed\n");
1004 1048
                 exit;
... ...
@@ -1012,12 +1056,13 @@ route[1] {
1012 1056
 failure_route[1] {
1013 1057
         revert_uri();
1014 1058
         if (!cr_next_domain("$avp(s:carrier)", "$avp(s:domain)", "$rU",
1015
-                        "$avp(s:host)", "$T_reply_code", "$avp(s:domain)
1016
-")) {
1059
+                        "$avp(s:host)", "$T_reply_code", "$avp(s:domain
1060
+)")) {
1017 1061
                 xlog("L_ERR", "cr_next_domain failed\n");
1018 1062
                 exit;
1019 1063
         }
1020
-        if (!cr_route("$avp(s:carrier)", "$avp(s:domain)", "$rU", "$rU",
1064
+        if (!cr_route("$avp(s:carrier)", "$avp(s:domain)", "$rU", "$rU"
1065
+,
1021 1066
                         "call_id", "$avp(s:host)")) {
1022 1067
                 xlog("L_ERR", "cr_route failed\n");
1023 1068
                 exit;
... ...
@@ -1034,16 +1079,16 @@ failure_route[1] {
1034 1079
    Example 1.45. Configuration example - module configuration
1035 1080
 
1036 1081
    The following config file specifies within the default carrier
1037
-   two domains, each with an prefix that contains two hosts. It is
1038
-   not possible to specify another carrier if you use the config
1039
-   file as data source.
1082
+   two domains, each with an prefix that contains two hosts. It
1083
+   is not possible to specify another carrier if you use the
1084
+   config file as data source.
1040 1085
 
1041
-   All traffic will be equally distributed between the hosts, both
1042
-   are active. The hash algorithm will working over the [1,2] set,
1043
-   messages hashed to one will go to the first host, the other to
1044
-   the second one. Don't use a hash index value of zero. If you
1045
-   ommit the hash completly, the module gives them a autogenerated
1046
-   value, starting from one.
1086
+   All traffic will be equally distributed between the hosts,
1087
+   both are active. The hash algorithm will working over the
1088
+   [1,2] set, messages hashed to one will go to the first host,
1089
+   the other to the second one. Don't use a hash index value of
1090
+   zero. If you ommit the hash completly, the module gives them a
1091
+   autogenerated value, starting from one.
1047 1092
 
1048 1093
    Use the "NULL" prefix to specify an empty prefix in the config
1049 1094
    file. Please note that the prefix is matched against the
... ...
@@ -1103,7 +1148,7 @@ domain register {
1103 1148
    parameters so they can be changed, but the name of the columns
1104 1149
    must be as they are in the SQL script. You can also find the
1105 1150
    complete database documentation on the project webpage,
1106
-   http://www.kamailio.org/docs/db-tables/openser-db-devel.html.
1151
+   http://www.kamailio.org/docs/db-tables/kamailio-db-devel.html.
1107 1152
    The flags and mask columns have the same function as in the
1108 1153
    carrierfailureroute table. A zero value in the flags and mask
1109 1154
    column means that any message flags will match this rule.
... ...
@@ -1135,20 +1180,21 @@ domain register {
1135 1180
    This table contains three routes to two gateways for the "49"
1136 1181
    prefix, and a default route for other prefixes over carrier 2
1137 1182
    and carrier 1. The gateways for the default carrier will be
1138
-   used for functions that don't support the user specific carrier
1139
-   lookup. The routing rules for carrier 1 and carrier 2 for the
1140
-   "49" prefix contains a additional rule with the domain 1, that
1141
-   can be used for example as fallback if the gateways in domain 0
1142
-   are not reachable. Two more fallback rules (domain 2 and 3) for
1143
-   carrier 1 are also supplied to support the functionality of the
1144
-   carrierfailureroute table example that is provided in the next
1145
-   section. The usage of strings for the domains is also possible,
1146
-   for example at carrier 3.
1147
-
1148
-   This table provides also a "carrier1" routing rule for the "49"
1149
-   prefix, that is only choosen if some message flags are set. If
1150
-   this flags are not set, the other two rules are used. The
1151
-   "strip", "mask" and "comment" colums are omitted for brevity.
1183
+   used for functions that don't support the user specific
1184
+   carrier lookup. The routing rules for carrier 1 and carrier 2
1185
+   for the "49" prefix contains a additional rule with the domain
1186
+   1, that can be used for example as fallback if the gateways in
1187
+   domain 0 are not reachable. Two more fallback rules (domain 2
1188
+   and 3) for carrier 1 are also supplied to support the
1189
+   functionality of the carrierfailureroute table example that is
1190
+   provided in the next section. The usage of strings for the
1191
+   domains is also possible, for example at carrier 3.
1192
+
1193
+   This table provides also a "carrier1" routing rule for the
1194
+   "49" prefix, that is only choosen if some message flags are
1195
+   set. If this flags are not set, the other two rules are used.
1196
+   The "strip", "mask" and "comment" colums are omitted for
1197
+   brevity.
1152 1198
 
1153 1199
    Example 1.47. Example database content - simple
1154 1200
    carrierfailureroute table
... ...
@@ -1185,15 +1231,15 @@ domain register {
1185 1231
 +----+---------+-----------+------------+-------+------+-------------+
1186 1232
 ...
1187 1233
 
1188
-   This table contains four failure routes that shows the usage of
1189
-   more advanced features. The first route matches to a 408, and
1190
-   to some flag for example that indicates that ringing has
1234
+   This table contains four failure routes that shows the usage
1235
+   of more advanced features. The first route matches to a 408,
1236
+   and to some flag for example that indicates that ringing has
1191 1237
    happened. If this flag is set, there will be no further
1192 1238
    forwarding, because next_domain is empty. In the second and
1193
-   third routes are certain gateway errors matched, if this errors
1194
-   have occured, then the next domain will be choosen. The last
1195
-   route does forwarding according some flags, e.g. the customer
1196
-   came from a certain carrier, and has call-forwarding
1239
+   third routes are certain gateway errors matched, if this
1240
+   errors have occured, then the next domain will be choosen. The
1241
+   last route does forwarding according some flags, e.g. the
1242
+   customer came from a certain carrier, and has call-forwarding
1197 1243
    deactivated. In order to use the routing that is specified
1198 1244
    above, a matching carrierroute table must be provided, that
1199 1245
    holds domain entries for this routing rules. Not all table
... ...
@@ -1213,10 +1259,10 @@ domain register {
1213 1259
    This table contains the mapping of the carrier id to actual
1214 1260
    names.
1215 1261
 
1216
-   For a functional routing the "cr_preferred_carrier" column must
1217
-   be added to the subscriber table (or to the table and column
1218
-   that you specified as modul parameter) to choose the actual
1219
-   carrier for the users.
1262
+   For a functional routing the "cr_preferred_carrier" column
1263
+   must be added to the subscriber table (or to the table and
1264
+   column that you specified as modul parameter) to choose the
1265
+   actual carrier for the users.
1220 1266
 
1221 1267
    Example 1.50. Necessary extensions for the user table
1222 1268
 
... ...
@@ -1,3 +1,4 @@
1
+
1 2
 cpl-c Module
2 3
 
3 4
 Bogdan-Andrei Iancu
... ...
@@ -10,9 +11,9 @@ Bogdan-Andrei Iancu
10 11
 
11 12
    Copyright � 2003 FhG FOKUS
12 13
    Revision History
13
-   Revision $Revision$ $Date: 2008-03-10 16:13:24 +0100
14
-                              (Mo, 10 Mär 2008) $
15
-     __________________________________________________________
14
+   Revision $Revision$ $Date: 2008-08-06 12:08:33 +0200
15
+   (Wed, 06 Aug 2008) $
16
+     _________________________________________________________
16 17
 
17 18
    Table of Contents
18 19
 
... ...
@@ -45,15 +46,15 @@ Bogdan-Andrei Iancu
45 46
 
46 47
         1.4. Exported Functions
47 48
 
48
-              1.4.1. cpl_run_script(type,mode)
49
-              1.4.2. cpl_process_register()
50
-              1.4.3. cpl_process_register_norpl()
49
+              1.4.1. cpl_run_script(type,mode) 
50
+              1.4.2. cpl_process_register() 
51
+              1.4.3. cpl_process_register_norpl() 
51 52
 
52 53
         1.5. Exported MI Functions
53 54
 
54
-              1.5.1. LOAD_CPL
55
-              1.5.2. REMOVE_CPL
56
-              1.5.3. GET_CPL
55
+              1.5.1. LOAD_CPL 
56
+              1.5.2. REMOVE_CPL 
57
+              1.5.3. GET_CPL 
57 58
 
58 59
         1.6. Installation and Running
59 60
 
... ...
@@ -79,15 +80,15 @@ Bogdan-Andrei Iancu
79 80
    1.16. Set use_domain parameter
80 81
    1.17. cpl_run_script usage
81 82
    1.18. cpl_process_register usage
82
-   1.19. cpl_process_register_norpl usage
83
+   1.19. cpl_process_register_norpl usage 
83 84
 
84 85
 Chapter 1. Admin Guide
85 86
 
86 87
 1.1. Overview
87 88
 
88 89
    cpl-c modules implements a CPL (Call Processing Language)
89
-   interpreter. Support for uploading/downloading/removing scripts
90
-   via SIP REGISTER method is present.
90
+   interpreter. Support for uploading/downloading/removing
91
+   scripts via SIP REGISTER method is present.
91 92
 
92 93
 1.2. Dependencies
93 94
 
... ...
@@ -95,14 +96,15 @@ Chapter 1. Admin Guide
95 96
 
96 97
    The following modules must be loaded before this module:
97 98
      * any DB module- a DB module for interfacing the DB
98
-       operations (modules like mysql, postgres, dbtext, etc)
99
-     * TM (Transaction) module- used for proxying/forking requests
99
+       operations (modules like mysql, postgres, dbtext, etc) 
100
+     * TM (Transaction) module- used for proxying/forking
101
+       requests 
100 102
      * SL (StateLess) module - used for sending stateless reply
101 103
        when responding to REGISTER request or for sending back
102
-       error responses
104
+       error responses 
103 105
      * USRLOC (User Location) module - used for implementing
104
-       lookup("registration") tag (adding into location set of the
105
-       users' contact)
106
+       lookup("registration") tag (adding into location set of
107
+       the users' contact) 
106 108
 
107 109
 1.2.2. External Libraries or Applications
108 110
 
... ...
@@ -110,7 +112,7 @@ Chapter 1. Admin Guide
110 112
    before running Kamailio with this module loaded:
111 113
      * libxml2 and libxml2-devel - on some SO, these to packages
112 114
        are merged into libxml2. This library contains an engine
113
-       for XML parsing, DTD validation and DOM manipulation.
115
+       for XML parsing, DTD validation and DOM manipulation. 
114 116
 
115 117
 1.3. Exported Parameters
116 118
 
... ...
@@ -118,10 +120,11 @@ Chapter 1. Admin Guide
118 120
 
119 121
    A SQL URL have to be given to the module for knowing where the
120 122
    database containing the table with CPL scripts is locates. If
121
-   required a user name and password can be specified for allowing
122
-   the module to connect to the database server.
123
+   required a user name and password can be specified for
124
+   allowing the module to connect to the database server.
123 125
 
124
-   Default value is "mysql://openser:openserrw@localhost/openser".
126
+   Default value is
127
+   "mysql://openser:openserrw@localhost/openser". 
125 128
 
126 129
    Example 1.1. Set db_url parameter
127 130
 ...
... ...
@@ -135,7 +138,7 @@ modparam("cpl-c","db_url","dbdriver://username:password@dbhost/dbname")
135 138
    "db_url" parameter. For more about the format of the CPL table
136 139
    please see the modules/cpl-c/init.mysql file.
137 140
 
138
-   Default value is "cpl".
141
+   Default value is "cpl". 
139 142
 
140 143
    Example 1.2. Set db_table parameter
141 144
 ...
... ...
@@ -144,9 +147,10 @@ modparam("cpl-c","cpl_table","cpl")
144 147
 
145 148
 1.3.3. username_column (string)
146 149
 
147
-   Indicates the name of the column used for storing the username.
150
+   Indicates the name of the column used for storing the
151
+   username.
148 152
 
149
-   Default value is "username".
153
+   Default value is "username". 
150 154
 
151 155
    Example 1.3. Set username_column parameter
152 156
 ...
... ...
@@ -157,7 +161,7 @@ modparam("cpl-c","username_column","username")
157 161
 
158 162
    Indicates the name of the column used for storing the domain.
159 163
 
160
-   Default value is "domain".
164
+   Default value is "domain". 
161 165
 
162 166
    Example 1.4. Set domain_column parameter
163 167
 ...
... ...
@@ -169,7 +173,7 @@ modparam("cpl-c","domain_column","domain")
169 173
    Indicates the name of the column used for storing the the XML
170 174
    version of the cpl script.
171 175
 
172
-   Default value is "cpl_xml".
176
+   Default value is "cpl_xml". 
173 177
 
174 178
    Example 1.5. Set cpl_xml_column parameter
175 179
 ...
... ...
@@ -181,7 +185,7 @@ modparam("cpl-c","cpl_xml_column","cpl_xml")
181 185
    Indicates the name of the column used for storing the the
182 186
    binary version of the cpl script (compiled version).
183 187
 
184
-   Default value is "cpl_bin".
188
+   Default value is "cpl_bin". 
185 189
 
186 190
    Example 1.6. Set cpl_bin_column parameter
187 191
 ...
... ...
@@ -195,7 +199,7 @@ modparam("cpl-c","cpl_bin_column","cpl_bin")
195 199
    absolute or relative (be careful the path will be relative to
196 200
    the starting directory of Kamailio).
197 201
 
198
-   This parameter is MANDATORY!
202
+   This parameter is MANDATORY! 
199 203
 
200 204
    Example 1.7. Set cpl_dtd_file parameter
201 205
 ...
... ...
@@ -209,7 +213,7 @@ modparam("cpl-c","cpl_dtd_file","/etc/kamailio/cpl-06.dtd")
209 213
    created (on demand) having the name username.log.
210 214
 
211 215
    If this parameter is absent, the logging will be disabled
212
-   without generating error on execution.
216
+   without generating error on execution. 
213 217
 
214 218
    Example 1.8. Set log_dir parameter
215 219
 ...
... ...
@@ -225,7 +229,7 @@ modparam("cpl-c","log_dir","/var/log/kamailio/cpl")
225 229
    branch. The recurse feature can be disable by setting this
226 230
    parameter to 0
227 231
 
228
-   Default value of this parameter is 0.
232
+   Default value of this parameter is 0. 
229 233
 
230 234
    Example 1.9. Set proxy_recurse parameter
231 235
 ...
... ...
@@ -235,10 +239,10 @@ modparam("cpl-c","proxy_recurse",2)
235 239
 1.3.10. proxy_route (int)
236 240