Browse code

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

Kamailio Dev authored on 14/09/2020 17:01:15
Showing 1 changed files
... ...
@@ -52,14 +52,15 @@ Bogdan-Andrei Iancu
52 52
 
53 53
               5.1. loose_route()
54 54
               5.2. loose_route_preloaded()
55
-              5.3. record_route([sparams])
56
-              5.4. remove_record_route()
57
-              5.5. record_route_preset(string [,string2])
58
-              5.6. record_route_advertised_address(address)
59
-              5.7. add_rr_param(param)
60
-              5.8. check_route_param(re)
61
-              5.9. is_direction(dir)
62
-              5.10. rr_next_hop_route()
55
+              5.3. loose_route_mode(vmode)
56
+              5.4. record_route([sparams])
57
+              5.5. remove_record_route()
58
+              5.6. record_route_preset(string [,string2])
59
+              5.7. record_route_advertised_address(address)
60
+              5.8. add_rr_param(param)
61
+              5.9. check_route_param(re)
62
+              5.10. is_direction(dir)
63
+              5.11. rr_next_hop_route()
63 64
 
64 65
         6. Exported Pseudo Variables
65 66
 
... ...
@@ -94,15 +95,16 @@ Bogdan-Andrei Iancu
94 95
    1.11. Set sockname_mode parameter
95 96
    1.12. loose_route usage
96 97
    1.13. loose_route_preloaded usage
97
-   1.14. record_route usage
98
-   1.15. remove_record_route usage
99
-   1.16. record_route_preset usage
100
-   1.17. record_route_advertised_address usage
101
-   1.18. add_rr_param usage
102
-   1.19. check_route_param usage
103
-   1.20. is_direction usage
104
-   1.21. rr_next_hop_route usage
105
-   1.22. $route_uri
98
+   1.14. loose_route_mode usage
99
+   1.15. record_route usage
100
+   1.16. remove_record_route usage
101
+   1.17. record_route_preset usage
102
+   1.18. record_route_advertised_address usage
103
+   1.19. add_rr_param usage
104
+   1.20. check_route_param usage
105
+   1.21. is_direction usage
106
+   1.22. rr_next_hop_route usage
107
+   1.23. $route_uri
106 108
    2.1. record_route usage
107 109
    2.2. record_route_advertised_address usage
108 110
    2.3. Loading RR module's API from another module
... ...
@@ -134,14 +136,15 @@ Chapter 1. Admin Guide
134 136
 
135 137
         5.1. loose_route()
136 138
         5.2. loose_route_preloaded()
137
-        5.3. record_route([sparams])
138
-        5.4. remove_record_route()
139
-        5.5. record_route_preset(string [,string2])
140
-        5.6. record_route_advertised_address(address)
141
-        5.7. add_rr_param(param)
142
-        5.8. check_route_param(re)
143
-        5.9. is_direction(dir)
144
-        5.10. rr_next_hop_route()
139
+        5.3. loose_route_mode(vmode)
140
+        5.4. record_route([sparams])
141
+        5.5. remove_record_route()
142
+        5.6. record_route_preset(string [,string2])
143
+        5.7. record_route_advertised_address(address)
144
+        5.8. add_rr_param(param)
145
+        5.9. check_route_param(re)
146
+        5.10. is_direction(dir)
147
+        5.11. rr_next_hop_route()
145 148
 
146 149
    6. Exported Pseudo Variables
147 150
 
... ...
@@ -179,8 +182,8 @@ Chapter 1. Admin Guide
179 182
    3261 (see 12.1.1 UAS behavior).
180 183
 
181 184
    For this purpose, the modules offers the following functions:
182
-     * add_rr_param() - see Section 5.7, “add_rr_param(param)”
183
-     * check_route_param() - see Section 5.8, “check_route_param(re)”
185
+     * add_rr_param() - see Section 5.8, “add_rr_param(param)”
186
+     * check_route_param() - see Section 5.9, “check_route_param(re)”
184 187
 
185 188
    Example 1.1. Dialog support in RR module
186 189
 ...
... ...
@@ -383,14 +386,15 @@ modparam("rr", "sockname_mode", 1)
383 386
 
384 387
    5.1. loose_route()
385 388
    5.2. loose_route_preloaded()
386
-   5.3. record_route([sparams])
387
-   5.4. remove_record_route()
388
-   5.5. record_route_preset(string [,string2])
389
-   5.6. record_route_advertised_address(address)
390
-   5.7. add_rr_param(param)
391
-   5.8. check_route_param(re)
392
-   5.9. is_direction(dir)
393
-   5.10. rr_next_hop_route()
389
+   5.3. loose_route_mode(vmode)
390
+   5.4. record_route([sparams])
391
+   5.5. remove_record_route()
392
+   5.6. record_route_preset(string [,string2])
393
+   5.7. record_route_advertised_address(address)
394
+   5.8. add_rr_param(param)
395
+   5.9. check_route_param(re)
396
+   5.10. is_direction(dir)
397
+   5.11. rr_next_hop_route()
394 398
 
395 399
 5.1. loose_route()
396 400
 
... ...
@@ -459,7 +463,30 @@ if(!loose_route_preloaded()) {
459 463
 }
460 464
 ...
461 465
 
462
-5.3. record_route([sparams])
466
+5.3. loose_route_mode(vmode)
467
+
468
+   The function is similar to `loose_route()`, but it does only loose
469
+   routing processing if vmode==1, skipping the testing of r-uri==myself
470
+   for performing strict routing. If vmode==0, it behaves like
471
+   loose_route().
472
+
473
+   It is a convenient function to use with application servers that set
474
+   the Contact URI to SIP server address.
475
+
476
+   This function can be used from REQUEST_ROUTE.
477
+
478
+   Example 1.14. loose_route_mode usage
479
+...
480
+if(has_totag() and uri==myself) {
481
+    if(loose_route_mode("1")) {
482
+        rewritehostport("my.app.server:5090");
483
+        t_relay();
484
+        exit;
485
+    }
486
+}
487
+...
488
+
489
+5.4. record_route([sparams])
463 490
 
464 491
    The function adds a new Record-Route header field. The header field
465 492
    will be inserted in the message before any other Record-Route header
... ...
@@ -481,12 +508,12 @@ if(!loose_route_preloaded()) {
481 508
    This function can be used from REQUEST_ROUTE, BRANCH_ROUTE and
482 509
    FAILURE_ROUTE.
483 510
 
484
-   Example 1.14. record_route usage
511
+   Example 1.15. record_route usage
485 512
 ...
486 513
 record_route();
487 514
 ...
488 515
 
489
-5.4. remove_record_route()
516
+5.5. remove_record_route()
490 517
 
491 518
    The function removes the internal lumps added by record_route()
492 519
    functions.
... ...
@@ -495,12 +522,12 @@ record_route();
495 522
 
496 523
    This function can be used from REQUEST_ROUTE and FAILURE_ROUTE.
497 524
 
498
-   Example 1.15. remove_record_route usage
525
+   Example 1.16. remove_record_route usage
499 526
 ...
500 527
 remove_record_route();
501 528
 ...
502 529
 
503
-5.5. record_route_preset(string [,string2])
530
+5.6. record_route_preset(string [,string2])
504 531
 
505 532
    This function will put the string into Record-Route, don't use unless
506 533
    you know what you are doing.
... ...
@@ -523,12 +550,12 @@ remove_record_route();
523 550
    This function can be used from REQUEST_ROUTE, BRANCH_ROUTE and
524 551
    FAILURE_ROUTE.
525 552
 
526
-   Example 1.16. record_route_preset usage
553
+   Example 1.17. record_route_preset usage
527 554
 ...
528 555
 record_route_preset("1.2.3.4:5090");
529 556
 ...
530 557
 
531
-5.6. record_route_advertised_address(address)
558
+5.7. record_route_advertised_address(address)
532 559
 
533 560
    The function adds a new Record-Route header field using the address
534 561
    given. The header field will be inserted in the message before any
... ...
@@ -550,17 +577,17 @@ record_route_preset("1.2.3.4:5090");
550 577
    This function can be used from REQUEST_ROUTE, BRANCH_ROUTE and
551 578
    FAILURE_ROUTE.
552 579
 
553
-   Example 1.17. record_route_advertised_address usage
580
+   Example 1.18. record_route_advertised_address usage
554 581
 ...
555 582
 record_route_advertised_address("1.2.3.4:5080");
556 583
 ...
557 584
 
558
-5.7. add_rr_param(param)
585
+5.8. add_rr_param(param)
559 586
 
560 587
    Adds a parameter to the Record-Route URI (param must be in
561 588
    “;name=value” format. The function may be called also before or after
562 589
    the record_route() or record_route_advertised_address() calls (see
563
-   Section 5.3, “record_route([sparams])” or Section 5.6,
590
+   Section 5.4, “record_route([sparams])” or Section 5.7,
564 591
    “record_route_advertised_address(address)”)).
565 592
 
566 593
    Meaning of the parameters is as follows:
... ...
@@ -570,12 +597,12 @@ record_route_advertised_address("1.2.3.4:5080");
570 597
    This function can be used from REQUEST_ROUTE, BRANCH_ROUTE and
571 598
    FAILURE_ROUTE.
572 599
 
573
-   Example 1.18. add_rr_param usage
600
+   Example 1.19. add_rr_param usage
574 601
 ...
575 602
 add_rr_param(";nat=yes");
576 603
 ...
577 604
 
578
-5.8. check_route_param(re)
605
+5.9. check_route_param(re)
579 606
 
580 607
    The function checks if the URI parameters of the local Route header
581 608
    (corresponding to the local server) matches the given regular
... ...
@@ -587,14 +614,14 @@ add_rr_param(";nat=yes");
587 614
 
588 615
    This function can be used from REQUEST_ROUTE.
589 616
 
590
-   Example 1.19. check_route_param usage
617
+   Example 1.20. check_route_param usage
591 618
 ...
592 619
 if (check_route_param("nat=yes")) {
593 620
     setflag(6);
594 621
 }
595 622
 ...
596 623
 
597
-5.9. is_direction(dir)
624
+5.10. is_direction(dir)
598 625
 
599 626
    The function checks the flow direction of in-dialog requests. This
600 627
    function uses the “ftag” parameter from the Route header, therefore the
... ...
@@ -615,7 +642,7 @@ if (check_route_param("nat=yes")) {
615 642
 
616 643
    This function can be used from REQUEST_ROUTE.
617 644
 
618
-   Example 1.20. is_direction usage
645
+   Example 1.21. is_direction usage
619 646
 ...
620 647
 if (is_direction("downstream")) {
621 648
     xdbg("in-dialog request from caller to callee (downstream) ($rm)\n");
... ...
@@ -624,7 +651,7 @@ if (is_direction("downstream")) {
624 651
 }
625 652
 ...
626 653
 
627
-5.10. rr_next_hop_route()
654
+5.11. rr_next_hop_route()
628 655
 
629 656
    The function returns 1 (true) if there is a Route header for the next
630 657
    hop address. It has to be used after loose_route(), when the local
... ...
@@ -632,7 +659,7 @@ if (is_direction("downstream")) {
632 659
 
633 660
    This function can be used from ANY_ROUTE.
634 661
 
635
-   Example 1.21. rr_next_hop_route usage
662
+   Example 1.22. rr_next_hop_route usage
636 663
 ...
637 664
 if(loose_route) {
638 665
     if(rr_next_hop_route()) {
... ...
@@ -650,7 +677,7 @@ if(loose_route) {
650 677
 
651 678
    Returns the URI of the top route-header.
652 679
 
653
-   Example 1.22. $route_uri
680
+   Example 1.23. $route_uri
654 681
 ...
655 682
     xdbg("Route-URI is: $route_uri\n");
656 683
 ...