Browse code

-avpops functions are enabled from LOCAL_ROUTE - AVP handling is safe here.

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

Bogdan-Andrei Iancu authored on 06/06/2008 13:18:15
Showing 3 changed files
... ...
@@ -330,7 +330,7 @@ modparam("avpops","db_scheme",
330 330
             naming format' chapter.
331 331
 
332 332
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
333
-   BRANCH_ROUTE and ONREPLY_ROUTE.
333
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
334 334
 
335 335
    Example 1.13. avp_db_load usage
336 336
 ...
... ...
@@ -349,7 +349,7 @@ avp_db_load("$ru","$avp(i1:123)/$some_scheme");
349 349
    description.
350 350
 
351 351
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
352
-   BRANCH_ROUTE and ONREPLY_ROUTE.
352
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
353 353
 
354 354
    Example 1.14. avp_db_store usage
355 355
 ...
... ...
@@ -366,7 +366,7 @@ avp_db_store("$ru/username","$avp(email)");
366 366
    description.
367 367
 
368 368
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
369
-   BRANCH_ROUTE and ONREPLY_ROUTE.
369
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
370 370
 
371 371
    Example 1.15. avp_db_delete usage
372 372
 ...
... ...
@@ -398,7 +398,7 @@ avp_db_delete("$uuid","$avp(s:404fwd)/fwd_table");
398 398
        derived from the type of the columns.
399 399
 
400 400
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
401
-   BRANCH_ROUTE and ONREPLY_ROUTE.
401
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
402 402
 
403 403
    Example 1.16. avp_db_query usage
404 404
 ...
... ...
@@ -438,7 +438,7 @@ avp_write("s:abc","$avp(i:7)");           => $avp(i:7) = "abc";
438 438
           + flag = 'g'|'G'
439 439
 
440 440
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
441
-   BRANCH_ROUTE and ONREPLY_ROUTE.
441
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
442 442
 
443 443
    Example 1.18. avp_delete usage
444 444
 ...
... ...
@@ -468,7 +468,7 @@ avp_delete("a3");
468 468
           + flags = 'g' - effective only with AVPs
469 469
 
470 470
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
471
-   BRANCH_ROUTE and ONREPLY_ROUTE.
471
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
472 472
 
473 473
    Example 1.19. avp_pushto usage
474 474
 ...
... ...
@@ -510,7 +510,7 @@ avp_pushto("$br","$avp(i:680)");
510 510
        'i:0xhex_number' (e.g.,: 'i:0xabcd');
511 511
 
512 512
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
513
-   BRANCH_ROUTE and ONREPLY_ROUTE.
513
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
514 514
 
515 515
    Example 1.20. avp_check usage
516 516
 ...
... ...
@@ -535,7 +535,7 @@ avp_check("$avp(s:foo)","fm/$avp(fm_avp)/g");
535 535
           + flags = 'g' | 'G' | 'd' | 'D' | 'n' | 'N' | 's' | 'S'
536 536
 
537 537
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
538
-   BRANCH_ROUTE and ONREPLY_ROUTE.
538
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
539 539
 
540 540
    Example 1.21. avp_copy usage
541 541
 ...
... ...
@@ -560,7 +560,7 @@ avp_copy("$avp(old)","$avp(new)/gd");
560 560
      * format - the formatted string to be printed in 'dest' AVP.
561 561
 
562 562
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
563
-   BRANCH_ROUTE and ONREPLY_ROUTE.
563
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
564 564
 
565 565
    Example 1.22. avp_printf usage
566 566
 ...
... ...
@@ -592,7 +592,7 @@ d)");
592 592
             matching tokens; i, I - match ignore case)
593 593
 
594 594
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
595
-   BRANCH_ROUTE and ONREPLY_ROUTE.
595
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
596 596
 
597 597
    Example 1.23. avp_subst usage
598 598
 ...
... ...
@@ -637,7 +637,7 @@ avp_subst("$avp(i:678)/$avp(i:679)/g", "/(.*)@(.*)/\1@$rd/");
637 637
        'i:0xhex_number' (e.g.,: 'i:0xabcd');
638 638
 
639 639
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
640
-   BRANCH_ROUTE and ONREPLY_ROUTE.
640
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
641 641
 
642 642
    Example 1.24. avp_op usage
643 643
 ...
... ...
@@ -656,7 +656,7 @@ avp_op("$avp(number)","sub/$avp(number2)/d");
656 656
             string; n = value number (int)
657 657
 
658 658
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
659
-   BRANCH_ROUTE and ONREPLY_ROUTE.
659
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
660 660
 
661 661
    Example 1.25. is_avp_set usage
662 662
 ...
... ...
@@ -670,7 +670,7 @@ if(is_avp_set("$avp(i:678)"))
670 670
    helper/debug function.
671 671
 
672 672
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
673
-   BRANCH_ROUTE and ONREPLY_ROUTE.
673
+   BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
674 674
 
675 675
    Example 1.26. avp_print usage
676 676
 ...
... ...
@@ -97,31 +97,31 @@ static int w_is_avp_set(struct sip_msg* msg, char* param, char *foo);
97 97
  */
98 98
 static cmd_export_t cmds[] = {
99 99
 	{"avp_print", (cmd_function)w_print_avps, 0, 0, 0,
100
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
100
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
101 101
 	{"avp_db_load", (cmd_function)w_dbload_avps,  2, fixup_db_load_avp, 0,
102
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
102
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
103 103
 	{"avp_db_delete", (cmd_function)w_dbdelete_avps, 2, fixup_db_delete_avp, 0,
104
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
104
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
105 105
 	{"avp_db_store", (cmd_function)w_dbstore_avps,  2, fixup_db_store_avp, 0,
106
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
106
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
107 107
 	{"avp_db_query", (cmd_function)w_dbquery1_avps, 1, fixup_db_query_avp, 0,
108
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
108
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
109 109
 	{"avp_db_query", (cmd_function)w_dbquery2_avps, 2, fixup_db_query_avp, 0,
110
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
110
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
111 111
 	{"avp_delete", (cmd_function)w_delete_avps, 1, fixup_delete_avp, 0,
112
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
112
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
113 113
 	{"avp_copy",   (cmd_function)w_copy_avps,  2,  fixup_copy_avp, 0,
114
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
114
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
115 115
 	{"avp_pushto", (cmd_function)w_pushto_avps, 2, fixup_pushto_avp, 0,
116
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
116
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
117 117
 	{"avp_check",  (cmd_function)w_check_avps, 2, fixup_check_avp, 0,
118
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
118
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
119 119
 	{"avp_op",     (cmd_function)w_op_avps, 2, fixup_op_avp, 0,
120
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
120
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
121 121
 	{"avp_subst",  (cmd_function)w_subst,   2, fixup_subst, 0,
122
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
122
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
123 123
 	{"is_avp_set", (cmd_function)w_is_avp_set, 1, fixup_is_avp_set, 0,
124
-					REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE},
124
+		REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE},
125 125
 	{0, 0, 0, 0, 0, 0}
126 126
 };
127 127
 
... ...
@@ -422,7 +422,7 @@ modparam("avpops","db_scheme",
422 422
 			</itemizedlist>
423 423
 			<para>
424 424
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
425
-			BRANCH_ROUTE and ONREPLY_ROUTE.
425
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
426 426
 			</para>
427 427
 			
428 428
 			<example>
... ...
@@ -451,7 +451,7 @@ avp_db_load("$ru","$avp(i1:123)/$some_scheme");
451 451
 			</para>
452 452
 			<para>
453 453
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
454
-			BRANCH_ROUTE and ONREPLY_ROUTE.
454
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
455 455
 			</para>
456 456
 			
457 457
 			<example>
... ...
@@ -478,7 +478,7 @@ avp_db_store("$ru/username","$avp(email)");
478 478
 			</para>
479 479
 			<para>
480 480
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
481
-			BRANCH_ROUTE and ONREPLY_ROUTE.
481
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
482 482
 			</para>
483 483
 			<example>
484 484
 				<title><function>avp_db_delete</function> usage</title>
... ...
@@ -507,13 +507,13 @@ avp_db_delete("$uuid","$avp(s:404fwd)/fwd_table");
507 507
 				query. The parameter can contain pseudo-variables.</para>
508 508
 				<para>You must escape any pseudo-variables manually to prevent
509 509
 				SQL injection attacks. You can use the existing transformations
510
-				<emphasis>escape.common</emphasis> and <emphasis>unescape.common</emphasis>
510
+				<emphasis>escape.common</emphasis> and 
511
+				<emphasis>unescape.common</emphasis>
511 512
 				to escape and unescape the content of any pseudo-variable.
512
-				Failing to escape the variables used in the query makes you vulnerable
513
-				to SQL injection, e.g. make it possible for an outside attacker to alter
514
-				your database content.
513
+				Failing to escape the variables used in the query makes you 
514
+				vulnerable to SQL injection, e.g. make it possible for an 
515
+				outside attacker to alter your database content.
515 516
 				</para>
516
-
517 517
 			</listitem>
518 518
 			<listitem>
519 519
 				<para><emphasis>dest</emphasis> - a list with AVP names where
... ...
@@ -529,7 +529,7 @@ avp_db_delete("$uuid","$avp(s:404fwd)/fwd_table");
529 529
 			</itemizedlist>
530 530
 			<para>
531 531
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
532
-			BRANCH_ROUTE and ONREPLY_ROUTE.
532
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
533 533
 			</para>
534 534
 			<example>
535 535
 				<title><function>avp_db_query</function> usage</title>
... ...
@@ -597,7 +597,7 @@ avp_write("s:abc","$avp(i:7)");           => $avp(i:7) = "abc";
597 597
 			</itemizedlist>
598 598
 			<para>
599 599
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
600
-			BRANCH_ROUTE and ONREPLY_ROUTE.
600
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
601 601
 			</para>
602 602
 			<example>
603 603
 				<title><function>avp_delete</function> usage</title>
... ...
@@ -662,7 +662,7 @@ avp_delete("a3");
662 662
 			</itemizedlist>
663 663
 			<para>
664 664
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
665
-			BRANCH_ROUTE and ONREPLY_ROUTE.
665
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
666 666
 			</para>
667 667
 			<example>
668 668
 				<title><function>avp_pushto</function> usage</title>
... ...
@@ -758,7 +758,7 @@ avp_pushto("$br","$avp(i:680)");
758 758
 			</itemizedlist>
759 759
 			<para>
760 760
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
761
-			BRANCH_ROUTE and ONREPLY_ROUTE.
761
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
762 762
 			</para>
763 763
 			<example>
764 764
 				<title><function>avp_check</function> usage</title>
... ...
@@ -811,7 +811,7 @@ avp_check("$avp(s:foo)","fm/$avp(fm_avp)/g");
811 811
 			</itemizedlist>
812 812
 			<para>
813 813
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
814
-			BRANCH_ROUTE and ONREPLY_ROUTE.
814
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
815 815
 			</para>
816 816
 			<example>
817 817
 				<title><function>avp_copy</function> usage</title>
... ...
@@ -861,7 +861,7 @@ avp_copy("$avp(old)","$avp(new)/gd");
861 861
 			</itemizedlist>
862 862
 			<para>
863 863
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
864
-			BRANCH_ROUTE and ONREPLY_ROUTE.
864
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
865 865
 			</para>
866 866
 			<example>
867 867
 				<title><function>avp_printf</function> usage</title>
... ...
@@ -927,7 +927,7 @@ avp_printf("$avp(i:20)", "This is a $rm request with call-id $hdr(call-id)");
927 927
 			</itemizedlist>
928 928
 			<para>
929 929
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
930
-			BRANCH_ROUTE and ONREPLY_ROUTE.
930
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
931 931
 			</para>
932 932
 			<example>
933 933
 				<title><function>avp_subst</function> usage</title>
... ...
@@ -1018,7 +1018,7 @@ avp_subst("$avp(i:678)/$avp(i:679)/g", "/(.*)@(.*)/\1@$rd/");
1018 1018
 			</itemizedlist>
1019 1019
 			<para>
1020 1020
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
1021
-			BRANCH_ROUTE and ONREPLY_ROUTE.
1021
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
1022 1022
 			</para>
1023 1023
 			<example>
1024 1024
 				<title><function>avp_op</function> usage</title>
... ...
@@ -1057,7 +1057,7 @@ avp_op("$avp(number)","sub/$avp(number2)/d");
1057 1057
 			</itemizedlist>
1058 1058
 			<para>
1059 1059
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
1060
-			BRANCH_ROUTE and ONREPLY_ROUTE.
1060
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
1061 1061
 			</para>
1062 1062
 			<example>
1063 1063
 				<title><function>is_avp_set</function> usage</title>
... ...
@@ -1080,7 +1080,7 @@ if(is_avp_set("$avp(i:678)"))
1080 1080
 			</para>
1081 1081
 			<para>
1082 1082
 			This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
1083
-			BRANCH_ROUTE and ONREPLY_ROUTE.
1083
+			BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
1084 1084
 			</para>
1085 1085
 			<example>
1086 1086
 				<title><function>avp_print</function> usage</title>