Browse code

lcr: docs - use string avps in examples

- more coherent examples, one example was also conflicting by using same id
- removed trailing white spaces and aligned examples

Daniel-Constantin Mierla authored on 20/04/2021 06:35:13
Showing 1 changed files
... ...
@@ -83,7 +83,7 @@
83 83
 	</para>
84 84
 	<para>
85 85
 	Prefix is a string of characters or NULL.  From-URI
86
-	pattern and Request-URI pattern are regular expressions (see 'man 
86
+	pattern and Request-URI pattern are regular expressions (see 'man
87 87
 	pcresyntax' for syntax), an empty string, or NULL.  An empty or
88 88
 	NULL From-URI pattern, Request-URI pattern or prefix matches anything.
89 89
 	Smaller priority value means higher priority (highest priority
... ...
@@ -100,21 +100,21 @@
100 100
 	</para>
101 101
 	<para>
102 102
         The function <emphasis>next_gw()</emphasis> can then be used to
103
-	select one gateway at a 
103
+	select one gateway at a
104 104
 	time for forwarding.  Upon each call, unless "dont_strip_or_prefix_flag"
105
-	flag is set, user part of the original Request-URI is first  
105
+	flag is set, user part of the original Request-URI is first
106 106
 	stripped by the number of characters as specified by the
107
-	gateway's strip count and then prefixed by 
107
+	gateway's strip count and then prefixed by
108 108
 	the gateway's prefix.  Upon each call, if a gateway's hostname is
109
-	NULL, Request-URI will be  
109
+	NULL, Request-URI will be
110 110
 	rewritten based on gateway's URI scheme, IP address, port,
111 111
 	parameters, and transport protocol.  If hostname is not NULL and
112 112
 	IP address is NULL, Request-URI will be rewritten based on the
113
-	gateway's URI scheme, 
113
+	gateway's URI scheme,
114 114
 	hostname, port, parameters and transport protocol.  If both
115 115
 	hostname and IP address are not NULL, Request-URI will be
116
-	rewritten based on gateway's URI scheme, 
117
-	hostname, and parameters, and destination URI is set 
116
+	rewritten based on gateway's URI scheme,
117
+	hostname, and parameters, and destination URI is set
118 118
 	based on gateway's URI scheme, IP address, port, and transport
119 119
 	protocol.
120 120
 	</para>
... ...
@@ -141,7 +141,7 @@
141 141
 		<itemizedlist>
142 142
 		<listitem>
143 143
 		<para>
144
-			<emphasis>A database module like mysql, postgres or 
144
+			<emphasis>A database module like mysql, postgres or
145 145
 			dbtext</emphasis>.
146 146
 		</para>
147 147
 		</listitem>
... ...
@@ -178,7 +178,7 @@
178 178
 		</para>
179 179
 		<para>
180 180
 		<emphasis>
181
-			Default value is 
181
+			Default value is
182 182
 			<quote>&defaultrodb;</quote>.
183 183
 		</emphasis>
184 184
 		</para>
... ...
@@ -225,7 +225,7 @@ modparam("lcr", "lcr_gw_table","gw")
225 225
 		</para>
226 226
 		<example>
227 227
 		<title>Setting <varname>id_column</varname> module
228
-		parameter</title> 
228
+		parameter</title>
229 229
 		<programlisting format="linespecific">
230 230
 ...
231 231
 modparam("lcr", "id_column", "row_id")
... ...
@@ -250,7 +250,7 @@ modparam("lcr", "id_column", "row_id")
250 250
 		</para>
251 251
 		<example>
252 252
 		<title>Setting <varname>lcr_id_column</varname> module
253
-		parameter</title> 
253
+		parameter</title>
254 254
 		<programlisting format="linespecific">
255 255
 ...
256 256
 modparam("lcr", "lcr_id_column", "lcr_identifier")
... ...
@@ -293,7 +293,7 @@ modparam("lcr", "gw_name_column", "name")
293 293
 		</para>
294 294
 		<example>
295 295
 		<title>Setting <varname>ip_addr_column</varname> module
296
-		parameter</title> 
296
+		parameter</title>
297 297
 		<programlisting format="linespecific">
298 298
 ...
299 299
 modparam("lcr", "ip_addr_column", "ip")
... ...
@@ -377,7 +377,7 @@ modparam("lcr", "params_column", "parameters")
377 377
 		</emphasis>
378 378
 		</para>
379 379
 		<example>
380
-		<title>Setting <varname>uri_scheme_column</varname> module 
380
+		<title>Setting <varname>uri_scheme_column</varname> module
381 381
 		parameter</title>
382 382
 		<programlisting format="linespecific">
383 383
 ...
... ...
@@ -399,7 +399,7 @@ modparam("lcr", "uri_scheme_column", "uri_scheme")
399 399
 		</emphasis>
400 400
 		</para>
401 401
 		<example>
402
-		<title>Setting <varname>transport_column</varname> module 
402
+		<title>Setting <varname>transport_column</varname> module
403 403
 		parameter</title>
404 404
 		<programlisting format="linespecific">
405 405
 ...
... ...
@@ -422,7 +422,7 @@ modparam("lcr", "transport_column", "trans")
422 422
 		</emphasis>
423 423
 		</para>
424 424
 		<example>
425
-		<title>Setting <varname>strip_column</varname> module 
425
+		<title>Setting <varname>strip_column</varname> module
426 426
 		parameter</title>
427 427
 		<programlisting format="linespecific">
428 428
 ...
... ...
@@ -530,7 +530,7 @@ modparam("lcr", "lcr_rule_table", "rules")
530 530
 		</para>
531 531
 		<example>
532 532
 		<title>Setting <varname>prefix_column</varname> module
533
-		parameter</title> 
533
+		parameter</title>
534 534
 		<programlisting format="linespecific">
535 535
 ...
536 536
 modparam("lcr", "prefix_column", "number_prefix")
... ...
@@ -612,7 +612,7 @@ modparam("lcr", "request_uri_column", "callee_uri")
612 612
 		</para>
613 613
 		<example>
614 614
 		<title>Setting <varname>stopper_column</varname> module
615
-		parameter 
615
+		parameter
616 616
 			</title>
617 617
 		<programlisting format="linespecific">
618 618
 ...
... ...
@@ -658,7 +658,7 @@ modparam("lcr", "enabled_column", "in_use")
658 658
 		</para>
659 659
 		<example>
660 660
 		<title>Setting <varname>lcr_rule_target_table</varname>
661
-		module parameter</title> 
661
+		module parameter</title>
662 662
 		<programlisting format="linespecific">
663 663
 ...
664 664
 modparam("lcr", "lcr_rule_target_table", "rules")
... ...
@@ -680,7 +680,7 @@ modparam("lcr", "lcr_rule_target_table", "rules")
680 680
 		</para>
681 681
 		<example>
682 682
 		<title>Setting <varname>rule_id_column</varname> module
683
-		parameter 
683
+		parameter
684 684
 			</title>
685 685
 		<programlisting format="linespecific">
686 686
 ...
... ...
@@ -703,7 +703,7 @@ modparam("lcr", "rule_id_column", "rule")
703 703
 		</para>
704 704
 		<example>
705 705
 		<title>Setting <varname>gw_id_column</varname> module
706
-		parameter 
706
+		parameter
707 707
 			</title>
708 708
 		<programlisting format="linespecific">
709 709
 ...
... ...
@@ -747,7 +747,7 @@ modparam("lcr", "priority_column", "priority")
747 747
 		</para>
748 748
 		<example>
749 749
 		<title>Setting <varname>weight_column</varname> module
750
-		parameter</title> 
750
+		parameter</title>
751 751
 		<programlisting format="linespecific">
752 752
 ...
753 753
 modparam("lcr","weight_column", "target_weight")
... ...
@@ -793,10 +793,10 @@ modparam("lcr", "lcr_count", 10)
793 793
 		</para>
794 794
 		<example>
795 795
 		<title>Setting <varname>gw_uri_avp</varname> module
796
-		parameter</title> 
796
+		parameter</title>
797 797
 		<programlisting format="linespecific">
798 798
 ...
799
-modparam("lcr", "gw_uri_avp", "$avp(i:709)")
799
+modparam("lcr", "gw_uri_avp", "$avp(lcr_gwuri)")
800 800
 ...
801 801
 </programlisting>
802 802
 		</example>
... ...
@@ -818,7 +818,7 @@ modparam("lcr", "gw_uri_avp", "$avp(i:709)")
818 818
 		<title>Setting <varname>ruri_user_avp</varname> module parameter</title>
819 819
 		<programlisting format="linespecific">
820 820
 ...
821
-modparam("lcr", "ruri_user_avp", "$avp(i:500)")
821
+modparam("lcr", "ruri_user_avp", "$avp(lcr_ruri_user)")
822 822
 ...
823 823
 </programlisting>
824 824
 		</example>
... ...
@@ -862,7 +862,7 @@ modparam("lcr", "tag_avp", "$avp(lcr_tag)")
862 862
 		<title>Setting <varname>flags_avp</varname> module parameter</title>
863 863
 		<programlisting format="linespecific">
864 864
 ...
865
-modparam("lcr", "flags_avp", "$avp(i:712)")
865
+modparam("lcr", "flags_avp", "$avp(lcr_flags)")
866 866
 ...
867 867
 </programlisting>
868 868
 		</example>
... ...
@@ -883,9 +883,9 @@ modparam("lcr", "flags_avp", "$avp(i:712)")
883 883
 		<example>
884 884
 			<title>Setting <varname>rule_id_avp</varname> module parameter</title>
885 885
 			<programlisting format="linespecific">
886
-				...
887
-				modparam("lcr", "rule_id_avp", "$avp(i:712)")
888
-				...
886
+...
887
+modparam("lcr", "rule_id_avp", "$avp(lcr_ruleid)")
888
+...
889 889
 			</programlisting>
890 890
 		</example>
891 891
 	</section>
... ...
@@ -909,7 +909,7 @@ modparam("lcr", "flags_avp", "$avp(i:712)")
909 909
 		<title>Setting <varname>tag_avp</varname> module parameter</title>
910 910
 		<programlisting format="linespecific">
911 911
 ...
912
-modparam("lcr", "mt_pv_values", "$avp(mt_values)")
912
+modparam("lcr", "mt_pv_values", "$avp(lcr_mt_values)")
913 913
 ...
914 914
 </programlisting>
915 915
 		</example>
... ...
@@ -973,10 +973,10 @@ modparam("lcr", "defunct_capability", 1)
973 973
 		</para>
974 974
 		<example>
975 975
 		<title>Setting <varname>lcr_id_avp</varname> module
976
-		parameter</title> 
976
+		parameter</title>
977 977
 		<programlisting format="linespecific">
978 978
 ...
979
-modparam("lcr", "lcr_id_avp", "$avp(s:lcr_id_avp)")
979
+modparam("lcr", "lcr_id_avp", "$avp(lcr_id)")
980 980
 ...
981 981
 </programlisting>
982 982
 		</example>
... ...
@@ -986,10 +986,9 @@ modparam("lcr", "lcr_id_avp", "$avp(s:lcr_id_avp)")
986 986
 		<title><varname>defunct_gw_avp</varname> (AVP string)</title>
987 987
 		<para>
988 988
 		Internal AVP that next_gw() function uses to store
989
-		internal index of the  
989
+		internal index of the
990 990
 		selected gateway for later use by defunct_gw() function.
991
-		Only needed if 
992
-		gateway defunct capability has been activated.
991
+		Only needed if gateway defunct capability has been activated.
993 992
 		</para>
994 993
 		<para>
995 994
 		<emphasis>
... ...
@@ -998,10 +997,10 @@ modparam("lcr", "lcr_id_avp", "$avp(s:lcr_id_avp)")
998 997
 		</para>
999 998
 		<example>
1000 999
 		<title>Setting <varname>defunct_gw_avp</varname> module
1001
-		parameter</title> 
1000
+		parameter</title>
1002 1001
 		<programlisting format="linespecific">
1003 1002
 ...
1004
-modparam("lcr", "defunct_gw_avp", "$avp(s:defunct_gw_avp)")
1003
+modparam("lcr", "defunct_gw_avp", "$avp(lcr_defunct_gw)")
1005 1004
 ...
1006 1005
 </programlisting>
1007 1006
 		</example>
... ...
@@ -1108,7 +1107,7 @@ modparam("lcr", "priority_ordering", 1)
1108 1107
 		<para>
1109 1108
 		The number of the rows to be fetched at once from database
1110 1109
 		when loading data from lcr_rule table. This value can be
1111
-		used to tune 
1110
+		used to tune
1112 1111
 		the load time at startup.  For 1MB of private memory (default)
1113 1112
 		it should be below 3750. In order for this parameter to
1114 1113
 		have effect, the database driver must support fetch_result()
... ...
@@ -1266,7 +1265,7 @@ modparam("lcr", "ping_socket", "192.98.102.10:5060")
1266 1265
 	<section id="lcr.f.load_gws">
1267 1266
 		<title>
1268 1267
 		<function moreinfo="none">load_gws(lcr_id[, uri_user[, caller_uri]])
1269
-		</function> 
1268
+		</function>
1270 1269
 		</title>
1271 1270
 		<para>
1272 1271
 		Loads attributes of matching gateways to gw_uri_avp
... ...
@@ -1278,7 +1277,7 @@ modparam("lcr", "ping_socket", "192.98.102.10:5060")
1278 1277
 		by caller_uri argument. If caller_uri argument is
1279 1278
 		omitted, it defaults to empty string. Both uri_user and
1280 1279
 		caller_uri argument may be a string or a pseudo variable
1281
-		containing a string value.  
1280
+		containing a string value.
1282 1281
 		</para>
1283 1282
 		<para>
1284 1283
 		Returns 1 if at least one matching gateway was found, 2
... ...
@@ -1309,13 +1308,13 @@ if (!load_gws(1, $rU, $var(caller_uri))) {
1309 1308
 	<section id="lcr.f.next_gw">
1310 1309
 		<title>
1311 1310
 		<function moreinfo="none">next_gw()</function>
1312
-		</title>	
1311
+		</title>
1313 1312
 		<para>
1314 1313
 		Upon first call, fetches attribute values stored in first
1315 1314
 		gw_uri_avp, destroys that AVP, and rewrites
1316 1315
 		Request-URI and possibly also destination URI as
1317 1316
 		described in the Overview section. Saves user part of
1318
-		Request-URI into 
1317
+		Request-URI into
1319 1318
 		ruri_user_avp for use in subsequent next_gw() calls.
1320 1319
 		</para>
1321 1320
 		<para>
... ...
@@ -1351,7 +1350,7 @@ if (!next_gw()) {
1351 1350
 		</example>
1352 1351
 		<example>
1353 1352
 		<title><function>next_gw</function> usage from a failure
1354
-		route block 
1353
+		route block
1355 1354
 			</title>
1356 1355
 		<programlisting format="linespecific">
1357 1356
 ...
... ...
@@ -1367,7 +1366,7 @@ if (!next_gw()) {
1367 1366
 	<section id="lcr.f.inactivate_gw">
1368 1367
 		<title>
1369 1368
 		<function moreinfo="none">inactivate_gw()</function>
1370
-		</title>	
1369
+		</title>
1371 1370
 		<para>
1372 1371
 		Inactivates the gateway denoted by lcr_id_avp and defunct_gw_avp
1373 1372
 		(which were set by previous next_gw() call).  Use of this
... ...
@@ -1399,11 +1398,11 @@ failure_route [GW_FAILURE] {
1399 1398
 	<section id="lcr.f.defunct_gw">
1400 1399
 		<title>
1401 1400
 		<function moreinfo="none">defunct_gw(period)</function>
1402
-		</title>	
1401
+		</title>
1403 1402
 		<para>
1404 1403
 		Defuncts gateway denoted by lcr_id_avp and defunct_gw_avp
1405 1404
 		(which were set by previuos next_gw() call)
1406
-		for a period of seconds given as argument.  Argument 
1405
+		for a period of seconds given as argument. Argument
1407 1406
 		must be a positive integer constant or a pseudo variable
1408 1407
 		with positive integer value.  Value of defunct column in
1409 1408
 		database is not updated.
... ...
@@ -1431,7 +1430,7 @@ defunct_gw(60);
1431 1430
 		<para>
1432 1431
 		Checks if request comes from IP address and transport protocol
1433 1432
 		specified for a gateway in LCR instance lcr_id.
1434
-		Fails if the LCR instance includes 
1433
+		Fails if the LCR instance includes
1435 1434
 		one or more gateways without IP address.
1436 1435
 		IP address and transport protocol to be checked are either
1437 1436
 		taken from source IP address of the request or
... ...
@@ -1467,7 +1466,7 @@ defunct_gw(60);
1467 1466
 		<title><function>from_gw</function> usage</title>
1468 1467
 		<programlisting format="linespecific">
1469 1468
 ...
1470
-if (from_gw(1, $avp(s:real_source_addr), 2) {
1469
+if (from_gw(1, $avp(real_source_addr), 2) {
1471 1470
 	...
1472 1471
 };
1473 1472
 ...
... ...
@@ -1480,12 +1479,12 @@ if (from_gw(1, $avp(s:real_source_addr), 2) {
1480 1479
 		<function moreinfo="none">from_any_gw([ip_addr, proto])</function>
1481 1480
 		</title>
1482 1481
 		<para>
1483
-		Checks if request comes from IP address and transport 
1482
+		Checks if request comes from IP address and transport
1484 1483
 		protocol specified for any gateway.  Only LCR instances,
1485 1484
 		where all gateways
1486 1485
 		have IP address, are included in the test.
1487 1486
 		IP address and transport protocol to be checked are either
1488
-		taken from source IP address and transport protocol 
1487
+		taken from source IP address and transport protocol
1489 1488
 		of the request or
1490 1489
 		(if present) from ip_addr and proto arguments.  See from_gw()
1491 1490
 		function for more info about the arguments.
... ...
@@ -1494,7 +1493,7 @@ if (from_gw(1, $avp(s:real_source_addr), 2) {
1494 1493
 		If any gateway has the IP address and transport protocol,
1495 1494
 		function returns LCR
1496 1495
 		identifier of the gateway.  Returns -1 on error or if
1497
-		the request does not come from a gateway. 
1496
+		the request does not come from a gateway.
1498 1497
 		</para>
1499 1498
 		<para>
1500 1499
 		If request comes from a gateway, gateway's tag and flags are
... ...
@@ -1566,7 +1565,7 @@ if (to_gw("1")) {
1566 1565
 		<para>
1567 1566
 		Checks if in-dialog request goes to IP address and transport
1568 1567
 		protocol of any gateway.
1569
-		Only LCR instances, where all gateways 
1568
+		Only LCR instances, where all gateways
1570 1569
 		have IP address, are included in the test. IP
1571 1570
 		address and transport protocol to be checked are
1572 1571
 		either taken from Request-URI or (if present)