Browse code

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

Kamailio Dev authored on 14/09/2021 06:46:23
Showing 1 changed files
... ...
@@ -113,9 +113,10 @@ Federico Cabiddu
113 113
               4.9. ds_mark_dst([state])
114 114
               4.10. ds_list_exists(groupid)
115 115
               4.11. ds_is_from_list([groupid [, mode [, uri] ] ])
116
-              4.12. ds_load_update()
117
-              4.13. ds_load_unset()
118
-              4.14. ds_reload()
116
+              4.12. ds_is_active(groupid [, uri])
117
+              4.13. ds_load_update()
118
+              4.14. ds_load_unset()
119
+              4.15. ds_reload()
119 120
 
120 121
         5. RPC Commands
121 122
 
... ...
@@ -197,9 +198,10 @@ Federico Cabiddu
197 198
    1.49. ds_mark_dst usage
198 199
    1.50. ds_list_exists usage
199 200
    1.51. ds_is_from_list usage
200
-   1.52. ds_load_unset usage
201
-   1.53. dispatcher list file
202
-   1.54. Kamailio config script - sample dispatcher usage
201
+   1.52. ds_is_active usage
202
+   1.53. ds_load_unset usage
203
+   1.54. dispatcher list file
204
+   1.55. Kamailio config script - sample dispatcher usage
203 205
 
204 206
 Chapter 1. Admin Guide
205 207
 
... ...
@@ -267,9 +269,10 @@ Chapter 1. Admin Guide
267 269
         4.9. ds_mark_dst([state])
268 270
         4.10. ds_list_exists(groupid)
269 271
         4.11. ds_is_from_list([groupid [, mode [, uri] ] ])
270
-        4.12. ds_load_update()
271
-        4.13. ds_load_unset()
272
-        4.14. ds_reload()
272
+        4.12. ds_is_active(groupid [, uri])
273
+        4.13. ds_load_update()
274
+        4.14. ds_load_unset()
275
+        4.15. ds_reload()
273 276
 
274 277
    5. RPC Commands
275 278
 
... ...
@@ -1025,9 +1028,10 @@ modparam("dispatcher", "reload_delta", 1)
1025 1028
    4.9. ds_mark_dst([state])
1026 1029
    4.10. ds_list_exists(groupid)
1027 1030
    4.11. ds_is_from_list([groupid [, mode [, uri] ] ])
1028
-   4.12. ds_load_update()
1029
-   4.13. ds_load_unset()
1030
-   4.14. ds_reload()
1031
+   4.12. ds_is_active(groupid [, uri])
1032
+   4.13. ds_load_update()
1033
+   4.14. ds_load_unset()
1034
+   4.15. ds_reload()
1031 1035
 
1032 1036
 4.1.  ds_select_dst(set, alg[, limit])
1033 1037
 
... ...
@@ -1436,7 +1440,31 @@ if(ds_is_from_list("10", "3", "sip:127.0.0.1:5080")) {
1436 1440
 }
1437 1441
 ...
1438 1442
 
1439
-4.12.  ds_load_update()
1443
+4.12.  ds_is_active(groupid [, uri])
1444
+
1445
+   This function returns true, if there is an active URI in the
1446
+   destination group; otherwise false. If the uri parameter is provided,
1447
+   then the corresponding destination has to be active.
1448
+
1449
+   Description of parameters:
1450
+     * groupid - the group id. The parameter can be an integer or a
1451
+       variable holding an integer value.
1452
+     * uri (optional) - the URI of the destination. if parameter is empty
1453
+       or missing, the any destination is matched.
1454
+
1455
+   This function can be used from ANY_ROUTE.
1456
+
1457
+   Example 1.52. ds_is_active usage
1458
+...
1459
+if(ds_is_active("10")) {
1460
+    ...
1461
+}
1462
+if(ds_is_active("10", "sip:127.0.0.1:5080")) {
1463
+    ...
1464
+}
1465
+...
1466
+
1467
+4.13.  ds_load_update()
1440 1468
 
1441 1469
    Updates the load state:
1442 1470
      * if it is a BYE or CANCEL - remove the load from destination address
... ...
@@ -1447,14 +1475,14 @@ if(ds_is_from_list("10", "3", "sip:127.0.0.1:5080")) {
1447 1475
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
1448 1476
    BRANCH_ROUTE and ONREPLY_ROUTE.
1449 1477
 
1450
-4.13.  ds_load_unset()
1478
+4.14.  ds_load_unset()
1451 1479
 
1452 1480
    Remove the call load for the destination that routed the call.
1453 1481
 
1454 1482
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
1455 1483
    BRANCH_ROUTE and ONREPLY_ROUTE.
1456 1484
 
1457
-   Example 1.52. ds_load_unset usage
1485
+   Example 1.53. ds_load_unset usage
1458 1486
 ...
1459 1487
 route {
1460 1488
     ...
... ...
@@ -1478,7 +1506,7 @@ onreply_route {
1478 1506
 }
1479 1507
 ...
1480 1508
 
1481
-4.14.  ds_reload()
1509
+4.15.  ds_reload()
1482 1510
 
1483 1511
    Reloads the groups and included destinations.
1484 1512
 
... ...
@@ -1760,7 +1788,7 @@ setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attrs(str,opt)
1760 1788
    For database, each element of a line resides in a different column.
1761 1789
    Next is a dispatcher.list file example:
1762 1790
 
1763
-   Example 1.53. dispatcher list file
1791
+   Example 1.54. dispatcher list file
1764 1792
 ...
1765 1793
 #
1766 1794
 # dispatcher destination sets (groups)
... ...
@@ -1785,7 +1813,7 @@ r,opt)
1785 1813
 
1786 1814
    Next listing shows a sample config for using the dispatcher module.
1787 1815
 
1788
-   Example 1.54. Kamailio config script - sample dispatcher usage
1816
+   Example 1.55. Kamailio config script - sample dispatcher usage
1789 1817
 ...
1790 1818
 #!KAMAILIO
1791 1819
 #
Browse code

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

Kamailio Dev authored on 10/12/2020 15:46:14
Showing 1 changed files
... ...
@@ -1719,18 +1719,20 @@ kamctl rpc dispatcher.hash 4 bob server.com
1719 1719
        for new calls until an exiting call via that gateway is terminated.
1720 1720
        If set to 0, then no active call limit is used.>
1721 1721
      * 'weight' - used for weight based load distribution. It must be set
1722
-       to a positive integer value beteen 0 and 100. The value represents
1723
-       the percent of calls to be sent to that gateways. The sum must not
1724
-       exceed 100, otherwise the destinations whose weight added to the
1725
-       sum go over 100 are ignored. If the sum is less than 100, then the
1726
-       last destination is used to fill the missing percentage. See also
1727
-       the description of the corresponding algorithm parameter for
1728
-       ds_select_dst().
1722
+       to a positive integer value beteen 1 and 100 (inclusive the
1723
+       limits), otherwise the destination address is ignored (its weight
1724
+       set to 0). The value represents the percent of calls to be sent to
1725
+       that gateways. The sum must not exceed 100, otherwise the
1726
+       destinations whose weight added to the sum go over 100 are ignored.
1727
+       If the sum is less than 100, then the last destination is used to
1728
+       fill the missing percentage. See also the description of the
1729
+       corresponding algorithm parameter for ds_select_dst().
1729 1730
      * 'rweight' - used for relative weight based load distribution. It
1730 1731
        must be set to a positive integer value between 1 and 100
1731
-       (otherwise host will be excluded from relative weight distribution
1732
-       type). See also the description of the corresponding algorithm
1733
-       parameter for ds_select_dst().
1732
+       (inclusive the limits) otherwise host will be excluded from
1733
+       relative weight distribution type - its rweight is set to 0. See
1734
+       also the description of the corresponding algorithm parameter for
1735
+       ds_select_dst().
1734 1736
      * 'socket' - used to set the sending socket for the gateway. It is
1735 1737
        used for sending the SIP traffic as well as OPTIONS keepalives.
1736 1738
      * 'sockname' - used to set by name the sending socket for the
Browse code

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

Kamailio Dev authored on 10/12/2020 15:31:24
Showing 1 changed files
... ...
@@ -1063,8 +1063,8 @@ modparam("dispatcher", "reload_delta", 1)
1063 1063
             (serial forking ordered by priority).
1064 1064
           + “9” - use weight based load distribution. You have to set the
1065 1065
             attribute 'weight' for each address (gateway) in destination
1066
-            set. For more see the description of the 'weight' attribute in
1067
-            the 'Special Attributes' section.
1066
+            set. See also the description of the 'weight' attribute in the
1067
+            'Special Attributes' section.
1068 1068
           + “10” - use call load distribution. You have to set the
1069 1069
             attribute 'duid' (as an unique string id) per each address in
1070 1070
             destination set. Also, you must set the parameter
... ...
@@ -1086,10 +1086,14 @@ modparam("dispatcher", "reload_delta", 1)
1086 1086
             active host rweights in destination group).
1087 1087
             The major difference from the weight distribution is the
1088 1088
             probability recalculation according to rweight value in case
1089
-            of host enabling/disabling
1090
-            For example, 100 calls in 3-hosts group with rweight params
1091
-            1/2/1 will be distributed as 25/50/25. After third host
1092
-            failing distribution will be changed to 33/67/0.
1089
+            of destinations being active or inactive.
1090
+            For example, 100 calls in 3-destinations group with rweight
1091
+            params 1/2/1 will be distributed as 25/50/25. If the third
1092
+            destination becomes inactive, the distribution is changed to
1093
+            33/67/0. If the computation of percentage per destination is
1094
+            not an exact integer number, the value is trucated and the
1095
+            last destination is used to fill the remaining percentage till
1096
+            100.
1093 1097
             Using this algorithm, you can also enable congestion control
1094 1098
             by setting the attribute 'cc=1', when 'cc' is enabled the
1095 1099
             'weight' attribute will also be used to control congestion
... ...
@@ -1102,6 +1106,8 @@ modparam("dispatcher", "reload_delta", 1)
1102 1106
             above their congestion threshold(weight), the load
1103 1107
             distribution is instead done using the ratio of estimated
1104 1108
             congestion ms.
1109
+            See also the description of the 'rweight' attribute in the
1110
+            'Special Attributes' section.
1105 1111
           + “12” - dispatch to all destination in setid at once (parallel
1106 1112
             forking). Note that the XAVPs are no longer set with the
1107 1113
             values of the destination records, no re-routing making sense
... ...
@@ -1714,11 +1720,17 @@ kamctl rpc dispatcher.hash 4 bob server.com
1714 1720
        If set to 0, then no active call limit is used.>
1715 1721
      * 'weight' - used for weight based load distribution. It must be set
1716 1722
        to a positive integer value beteen 0 and 100. The value represents
1717
-       the percent of calls to be sent to that gateways.>
1723
+       the percent of calls to be sent to that gateways. The sum must not
1724
+       exceed 100, otherwise the destinations whose weight added to the
1725
+       sum go over 100 are ignored. If the sum is less than 100, then the
1726
+       last destination is used to fill the missing percentage. See also
1727
+       the description of the corresponding algorithm parameter for
1728
+       ds_select_dst().
1718 1729
      * 'rweight' - used for relative weight based load distribution. It
1719 1730
        must be set to a positive integer value between 1 and 100
1720 1731
        (otherwise host will be excluded from relative weight distribution
1721
-       type).
1732
+       type). See also the description of the corresponding algorithm
1733
+       parameter for ds_select_dst().
1722 1734
      * 'socket' - used to set the sending socket for the gateway. It is
1723 1735
        used for sending the SIP traffic as well as OPTIONS keepalives.
1724 1736
      * 'sockname' - used to set by name the sending socket for the
Browse code

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

Kamailio Dev authored on 19/11/2020 16:01:16
Showing 1 changed files
... ...
@@ -188,17 +188,18 @@ Federico Cabiddu
188 188
    1.40. Set the “ds_db_extra_attrs” parameter
189 189
    1.41. Set the “ds_load_mode” parameter
190 190
    1.42. Set reload_delta parameter
191
-   1.43. ds_select_dst usage
192
-   1.44. configuring load balancing with congestion detection
193
-   1.45. ds_select_domain usage
194
-   1.46. ds_select usage
195
-   1.47. ds_select_routes usage
196
-   1.48. ds_mark_dst usage
197
-   1.49. ds_list_exists usage
198
-   1.50. ds_is_from_list usage
199
-   1.51. ds_load_unset usage
200
-   1.52. dispatcher list file
201
-   1.53. Kamailio config script - sample dispatcher usage
191
+   1.43. latency_optimized_dispatching usage
192
+   1.44. ds_select_dst usage
193
+   1.45. configuring load balancing with congestion detection
194
+   1.46. ds_select_domain usage
195
+   1.47. ds_select usage
196
+   1.48. ds_select_routes usage
197
+   1.49. ds_mark_dst usage
198
+   1.50. ds_list_exists usage
199
+   1.51. ds_is_from_list usage
200
+   1.52. ds_load_unset usage
201
+   1.53. dispatcher list file
202
+   1.54. Kamailio config script - sample dispatcher usage
202 203
 
203 204
 Chapter 1. Admin Guide
204 205
 
... ...
@@ -1090,7 +1091,7 @@ modparam("dispatcher", "reload_delta", 1)
1090 1091
             1/2/1 will be distributed as 25/50/25. After third host
1091 1092
             failing distribution will be changed to 33/67/0.
1092 1093
             Using this algorithm, you can also enable congestion control
1093
-            by setting the attibute 'cc=1', when 'cc' is enabled the
1094
+            by setting the attribute 'cc=1', when 'cc' is enabled the
1094 1095
             'weight' attribute will also be used to control congestion
1095 1096
             tolerance. When facing congestion the weight of a gateway is
1096 1097
             lowered by 1 for every ms of estimated congestion, a 'rweight'
... ...
@@ -1105,6 +1106,34 @@ modparam("dispatcher", "reload_delta", 1)
1105 1106
             forking). Note that the XAVPs are no longer set with the
1106 1107
             values of the destination records, no re-routing making sense
1107 1108
             in this case.
1109
+          + “13” - latency optimized dispatching
1110
+            - The algorithm will load balance using round-robin
1111
+            prioritizing the gateways with the highest priority.
1112
+            - If ds_ping_latency_stats is active the algorithm will adjust
1113
+            the priority of the gateway automatically, the priority will
1114
+            be lowered by 1 point every time the latency ms is as high as
1115
+            the priority.
1116
+            - If the attribute 'cc=1' is set, the latency used is
1117
+            congestion ms : estimate (current latency ms) - average
1118
+            (normal condition latency ms).
1119
+            Example 1.43. latency_optimized_dispatching usage
1120
+Using this simple formula :
1121
+    ADJUSTED_PRIORITY = PRIORITY - (ESTIMATED_LATENCY_MS/PRIORITY)
1122
+
1123
+GATEWAY | PRIORITY | ESTIMATED | ADJUSTED | LOAD
1124
+   #    |          |  LATENCY  | PRIORITY | DISTRIBUTION
1125
+   1    |    30    |    21     |    30    | 33%
1126
+   2    |    30    |    91     |    27    | 0%
1127
+   3    |    30    |    61     |    28    | 0%
1128
+   4    |    30    |    19     |    30    | 33%
1129
+   5    |    30    |    32     |    29    | 0%
1130
+   6    |    30    |    0      |    30    | 33%
1131
+   7    |    30    |    201    |    24    | 0%
1132
+
1133
+
1134
+With congestion control the formula becomes :
1135
+    CONGESTION_MS = CURRENT_LATENCY_MS - NORMAL_CONDITION_LATENCY_MS
1136
+    ADJUSTED_PRIORITY = PRIORITY - (CONGESTION_MS/PRIORITY)
1108 1137
           + “X” - if the algorithm is not implemented, the first entry in
1109 1138
             set is chosen.
1110 1139
      * limit - the maximum number of items to be stored in XAVP list for
... ...
@@ -1113,7 +1142,7 @@ modparam("dispatcher", "reload_delta", 1)
1113 1142
 
1114 1143
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
1115 1144
 
1116
-   Example 1.43. ds_select_dst usage
1145
+   Example 1.44. ds_select_dst usage
1117 1146
 ...
1118 1147
 ds_select_dst("1", "0");
1119 1148
 ...
... ...
@@ -1123,7 +1152,7 @@ ds_select_dst("1", "$var(a)");
1123 1152
 ds_select_dst("1", "4", "3");
1124 1153
 ...
1125 1154
 
1126
-   Example 1.44. configuring load balancing with congestion detection
1155
+   Example 1.45. configuring load balancing with congestion detection
1127 1156
 ...
1128 1157
 # sample of SQL provisionning statements
1129 1158
 INSERT INTO "dispatcher"
... ...
@@ -1177,7 +1206,7 @@ DEST: {
1177 1206
 
1178 1207
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
1179 1208
 
1180
-   Example 1.45. ds_select_domain usage
1209
+   Example 1.46. ds_select_domain usage
1181 1210
 ...
1182 1211
 $var(a) = 4;
1183 1212
 if(ds_select_domain("1", "$var(a)")) {
... ...
@@ -1201,7 +1230,7 @@ if(ds_select_domain("1", "$var(a)")) {
1201 1230
 
1202 1231
    This function can be used from ANY_ROUTE.
1203 1232
 
1204
-   Example 1.46. ds_select usage
1233
+   Example 1.47. ds_select usage
1205 1234
 ...
1206 1235
 $var(a) = 4;
1207 1236
 if(ds_select("1", "$var(a)")) {
... ...
@@ -1244,7 +1273,7 @@ if(ds_select("1", "$var(a)")) {
1244 1273
 
1245 1274
    This function can be used from ANY_ROUTE.
1246 1275
 
1247
-   Example 1.47. ds_select_routes usage
1276
+   Example 1.48. ds_select_routes usage
1248 1277
 ...
1249 1278
 $var(alg) = 4;
1250 1279
 $var(limit) = 8;
... ...
@@ -1319,7 +1348,7 @@ failure_route[REROUTE] {
1319 1348
 
1320 1349
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
1321 1350
 
1322
-   Example 1.48. ds_mark_dst usage
1351
+   Example 1.49. ds_mark_dst usage
1323 1352
 ...
1324 1353
 failure_route[tryagain] {
1325 1354
 ...
... ...
@@ -1341,7 +1370,7 @@ failure_route[tryagain] {
1341 1370
 
1342 1371
    This function can be used from ANY_ROUTE.
1343 1372
 
1344
-   Example 1.49. ds_list_exists usage
1373
+   Example 1.50. ds_list_exists usage
1345 1374
 ...
1346 1375
 if(ds_list_exists("10")) {
1347 1376
     ...
... ...
@@ -1385,7 +1414,7 @@ if(ds_list_exists("10")) {
1385 1414
 
1386 1415
    This function can be used from ANY_ROUTE.
1387 1416
 
1388
-   Example 1.50. ds_is_from_list usage
1417
+   Example 1.51. ds_is_from_list usage
1389 1418
 ...
1390 1419
 if(ds_is_from_list()) {
1391 1420
     ...
... ...
@@ -1419,7 +1448,7 @@ if(ds_is_from_list("10", "3", "sip:127.0.0.1:5080")) {
1419 1448
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
1420 1449
    BRANCH_ROUTE and ONREPLY_ROUTE.
1421 1450
 
1422
-   Example 1.51. ds_load_unset usage
1451
+   Example 1.52. ds_load_unset usage
1423 1452
 ...
1424 1453
 route {
1425 1454
     ...
... ...
@@ -1717,7 +1746,7 @@ setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attrs(str,opt)
1717 1746
    For database, each element of a line resides in a different column.
1718 1747
    Next is a dispatcher.list file example:
1719 1748
 
1720
-   Example 1.52. dispatcher list file
1749
+   Example 1.53. dispatcher list file
1721 1750
 ...
1722 1751
 #
1723 1752
 # dispatcher destination sets (groups)
... ...
@@ -1742,7 +1771,7 @@ r,opt)
1742 1771
 
1743 1772
    Next listing shows a sample config for using the dispatcher module.
1744 1773
 
1745
-   Example 1.53. Kamailio config script - sample dispatcher usage
1774
+   Example 1.54. Kamailio config script - sample dispatcher usage
1746 1775
 ...
1747 1776
 #!KAMAILIO
1748 1777
 #
Browse code

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

Kamailio Dev authored on 23/10/2020 20:16:12
Showing 1 changed files
... ...
@@ -1091,7 +1091,7 @@ modparam("dispatcher", "reload_delta", 1)
1091 1091
             failing distribution will be changed to 33/67/0.
1092 1092
             Using this algorithm, you can also enable congestion control
1093 1093
             by setting the attibute 'cc=1', when 'cc' is enabled the
1094
-            'rweight' attribute will also be used to control congestion
1094
+            'weight' attribute will also be used to control congestion
1095 1095
             tolerance. When facing congestion the weight of a gateway is
1096 1096
             lowered by 1 for every ms of estimated congestion, a 'rweight'
1097 1097
             value of 50 is recommended. See the example "configuring load
Browse code

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

Kamailio Dev authored on 06/10/2020 20:31:12
Showing 1 changed files
... ...
@@ -762,7 +762,8 @@ modparam("dispatcher", "ds_probing_mode", 1)
762 762
 
763 763
 3.26. ds_ping_latency_stats (int)
764 764
 
765
-   Enable latency measurement when pinging nodes
765
+   Enable latency measurement when pinging nodes The estimator can be
766
+   initialized at startup and reload using the attribute latency.
766 767
      * If set to 0, disable latency measurement.
767 768
      * If set to 1, enable latency measurement.
768 769
 
... ...
@@ -776,6 +777,9 @@ DEST: {
776 777
         URI: sip:1.2.3.4
777 778
         FLAGS: AX
778 779
         PRIORITY: 9
780
+        ATTRS: {
781
+                BODY: latency=24
782
+        }
779 783
         LATENCY: {
780 784
                 AVG: 24.250000 # weighted moving average for the last few weeks
781 785
                 STD: 1.035000  # standard deviation of AVG
... ...
@@ -1695,6 +1699,7 @@ kamctl rpc dispatcher.hash 4 bob server.com
1695 1699
        overwrites the general ds_ping_from parameter.
1696 1700
      * 'obproxy' - SIP URI of outbound proxy to be used when sending
1697 1701
        pings. It overwrites the general ds_outbound_proxy parameter.
1702
+     * 'latency' - latency_stats initialization in ms.
1698 1703
 
1699 1704
 6.1.2. File Format
1700 1705
 
Browse code

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

Kamailio Dev authored on 29/06/2020 06:01:13
Showing 1 changed files
... ...
@@ -497,9 +497,9 @@ modparam("dispatcher", "force_dst", 1)
497 497
    Default value is “0”.
498 498
 
499 499
    Example 1.10. Set the “flags” parameter
500
- ...
501
- modparam("dispatcher", "flags", 3)
502
- ...
500
+...
501
+modparam("dispatcher", "flags", 3)
502
+...
503 503
 
504 504
 3.11. use_default (int)
505 505
 
... ...
@@ -511,9 +511,9 @@ modparam("dispatcher", "force_dst", 1)
511 511
    Default value is “0”.
512 512
 
513 513
    Example 1.11. Set the “use_default” parameter
514
- ...
515
- modparam("dispatcher", "use_default", 1)
516
- ...
514
+...
515
+modparam("dispatcher", "use_default", 1)
516
+...
517 517
 
518 518
 3.12. xavp_dst (str)
519 519
 
... ...
@@ -534,9 +534,9 @@ Note
534 534
    Default value is “_dsdst_”.
535 535
 
536 536
    Example 1.12. Set the “xavp_dst” parameter
537
- ...
538
- modparam("dispatcher", "xavp_dst", "_dsdst_")
539
- ...
537
+...
538
+modparam("dispatcher", "xavp_dst", "_dsdst_")
539
+...
540 540
 
541 541
 3.13. xavp_dst_mode (int)
542 542
 
... ...
@@ -574,9 +574,9 @@ Note
574 574
    Default value is “_dsctx_”.
575 575
 
576 576
    Example 1.14. Set the “xavp_ctx” parameter
577
- ...
578
- modparam("dispatcher", "xavp_ctx", "_dsctx_")
579
- ...
577
+...
578
+modparam("dispatcher", "xavp_ctx", "_dsctx_")
579
+...
580 580
 
581 581
 3.15. xavp_ctx_mode (int)
582 582
 
... ...
@@ -587,9 +587,9 @@ Note
587 587
    Default value is “0” (add all fields).
588 588
 
589 589
    Example 1.15. Set the “xavp_ctx_mode” parameter
590
- ...
591
- modparam("dispatcher", "xavp_ctx_mode", 1)
592
- ...
590
+...
591
+modparam("dispatcher", "xavp_ctx_mode", 1)
592
+...
593 593
 
594 594
 3.16. hash_pvar (str)
595 595
 
... ...
@@ -603,14 +603,14 @@ Note
603 603
    Default value is “null” - disabled.
604 604
 
605 605
    Example 1.16. Use $avp(hash) for hashing:
606
- ...
607
- modparam("dispatcher", "hash_pvar", "$avp(hash)")
608
- ...
606
+...
607
+modparam("dispatcher", "hash_pvar", "$avp(hash)")
608
+...
609 609
 
610 610
    Example 1.17. Use combination of PVs for hashing:
611
- ...
612
- modparam("dispatcher", "hash_pvar", "hash the $fU@$ci")
613
- ...
611
+...
612
+modparam("dispatcher", "hash_pvar", "hash the $fU@$ci")
613
+...
614 614
 
615 615
 3.17. setid_pvname (str)
616 616
 
... ...
@@ -620,9 +620,9 @@ Note
620 620
    Default value is “null” - don't set PV.
621 621
 
622 622
    Example 1.18. Set the “setid_pvname” parameter
623
- ...
624
- modparam("dispatcher", "setid_pvname", "$var(setid)")
625
- ...
623
+...
624
+modparam("dispatcher", "setid_pvname", "$var(setid)")
625
+...
626 626
 
627 627
 3.18. attrs_pvname (str)
628 628
 
... ...
@@ -632,9 +632,9 @@ Note
632 632
    Default value is “null” - don't set PV.
633 633
 
634 634
    Example 1.19. Set the “attrs_pvname” parameter
635
- ...
636
- modparam("dispatcher", "attrs_pvname", "$var(attrs)")
637
- ...
635
+...
636
+modparam("dispatcher", "attrs_pvname", "$var(attrs)")
637
+...
638 638
 
639 639
 3.19. ds_ping_method (string)
640 640
 
... ...
@@ -645,9 +645,9 @@ Note
645 645
    Default value is “OPTIONS”.
646 646
 
647 647
    Example 1.20. Set the “ds_ping_method” parameter
648
- ...
649
- modparam("dispatcher", "ds_ping_method", "INFO")
650
- ...
648
+...
649
+modparam("dispatcher", "ds_ping_method", "INFO")
650
+...
651 651
 
652 652
 3.20. ds_ping_from (string)
653 653
 
... ...
@@ -658,9 +658,9 @@ Note
658 658
    Default value is “sip:dispatcher@localhost”.
659 659
 
660 660
    Example 1.21. Set the “ds_ping_from” parameter
661
- ...
662
- modparam("dispatcher", "ds_ping_from", "sip:proxy@sip.somehost.com")
663
- ...
661
+...
662
+modparam("dispatcher", "ds_ping_from", "sip:proxy@sip.somehost.com")
663
+...
664 664
 
665 665
 3.21. ds_ping_interval (int)
666 666
 
... ...
@@ -672,9 +672,9 @@ Note
672 672
    Default value is “0”.
673 673
 
674 674
    Example 1.22. Set the “ds_ping_interval” parameter
675
- ...
676
- modparam("dispatcher", "ds_ping_interval", 30)
677
- ...
675
+...
676
+modparam("dispatcher", "ds_ping_interval", 30)
677
+...
678 678
 
679 679
 3.22. ds_probing_threshold (int)
680 680
 
... ...
@@ -688,9 +688,9 @@ Note
688 688
    Default value is “1” (set inactive with first failure).
689 689
 
690 690
    Example 1.23. Set the “ds_probing_threshold” parameter
691
- ...
692
- modparam("dispatcher", "ds_probing_threshold", 10)
693
- ...
691
+...
692
+modparam("dispatcher", "ds_probing_threshold", 10)
693
+...
694 694
 
695 695
 3.23. ds_inactive_threshold (int)
696 696
 
... ...
@@ -703,9 +703,9 @@ Note
703 703
    Default value is “1” (set active with first success).
704 704
 
705 705
    Example 1.24. Set the “ds_inactive_threshold” parameter
706
- ...
707
- modparam("dispatcher", "ds_inactive_threshold", 10)
708
- ...
706
+...
707
+modparam("dispatcher", "ds_inactive_threshold", 10)
708
+...
709 709
 
710 710
 3.24. ds_ping_reply_codes (string)
711 711
 
... ...
@@ -727,10 +727,10 @@ Note
727 727
    Default value is “” (only 200 OK is accepted).
728 728
 
729 729
    Example 1.25. Set the “ds_ping_reply_codes” parameter
730
- ...
731
- modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=403;code=488;class=
732
-3")
733
- ...
730
+...
731
+modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=403;code=488;class=3
732
+")
733
+...
734 734
 
735 735
 3.25. ds_probing_mode (int)
736 736
 
... ...
@@ -756,9 +756,9 @@ Note
756 756
    Default value is “0”.
757 757
 
758 758
    Example 1.26. Set the “ds_probing_mode” parameter
759
- ...
760
- modparam("dispatcher", "ds_probing_mode", 1)
761
- ...
759
+...
760
+modparam("dispatcher", "ds_probing_mode", 1)
761
+...
762 762
 
763 763
 3.26. ds_ping_latency_stats (int)
764 764
 
... ...
@@ -771,7 +771,7 @@ Note
771 771
    Example 1.27. accessing the metrics
772 772
 # using the command :
773 773
 kamcmd dispatcher.list
774
- ...
774
+...
775 775
 DEST: {
776 776
         URI: sip:1.2.3.4
777 777
         FLAGS: AX
... ...
@@ -785,12 +785,12 @@ estimator_alpha
785 785
                 TIMEOUT: 0     # count of ping timeouts
786 786
         }
787 787
 }
788
- ...
788
+...
789 789
 
790 790
    Example 1.28. Set the “ds_ping_latency_stats” parameter
791
- ...
792
- modparam("dispatcher", "ds_ping_latency_stats", 1)
793
- ...
791
+...
792
+modparam("dispatcher", "ds_ping_latency_stats", 1)
793
+...
794 794
 
795 795
 3.27. ds_latency_estimator_alpha (int)
796 796
 
... ...
@@ -805,9 +805,9 @@ estimator_alpha
805 805
    Default value is “900 => 0.9”.
806 806
 
807 807
    Example 1.29. Set the “ds_hash_size” parameter
808
- ...
809
- modparam("dispatcher", "ds_latency_estimator_alpha", 900)
810
- ...
808
+...
809
+modparam("dispatcher", "ds_latency_estimator_alpha", 900)
810
+...
811 811
 
812 812
 3.28. ds_hash_size (int)
813 813
 
... ...
@@ -819,9 +819,9 @@ estimator_alpha
819 819
    Default value is “0”.
820 820
 
821 821
    Example 1.30. Set the “ds_hash_size” parameter
822
- ...
823
- modparam("dispatcher", "ds_hash_size", 9)
824
- ...
822
+...
823
+modparam("dispatcher", "ds_hash_size", 9)
824
+...
825 825
 
826 826
 3.29. ds_hash_expire (int)
827 827
 
... ...
@@ -831,9 +831,9 @@ estimator_alpha
831 831
    Default value is “7200”.
832 832
 
833 833
    Example 1.31. Set the “ds_hash_expire” parameter
834
- ...
835
- modparam("dispatcher", "ds_hash_expire", 3600)
836
- ...
834
+...
835
+modparam("dispatcher", "ds_hash_expire", 3600)
836
+...
837 837
 
838 838
 3.30. ds_hash_initexpire (int)
839 839
 
... ...
@@ -844,9 +844,9 @@ estimator_alpha
844 844
    Default value is “7200”.
845 845
 
846 846
    Example 1.32. Set the “ds_hash_initexpire” parameter
847
- ...
848
- modparam("dispatcher", "ds_hash_initexpire", 60)
849
- ...
847
+...
848
+modparam("dispatcher", "ds_hash_initexpire", 60)
849
+...
850 850
 
851 851
 3.31. ds_hash_check_interval (int)
852 852
 
... ...
@@ -856,9 +856,9 @@ estimator_alpha
856 856
    Default value is “30”.
857 857
 
858 858
    Example 1.33. Set the “ds_hash_check_interval” parameter
859
- ...
860
- modparam("dispatcher", "ds_hash_check_interval", 60)
861
- ...
859
+...
860
+modparam("dispatcher", "ds_hash_check_interval", 60)
861
+...
862 862
 
863 863
 3.32. outbound_proxy (str)
864 864
 
... ...
@@ -867,9 +867,9 @@ estimator_alpha
867 867
    By default no outbound proxy is defined.
868 868
 
869 869
    Example 1.34. Set the “outbound_proxy” parameter
870
- ...
871
- modparam("dispatcher", "outbound_proxy", "sip:outbound.example.com")
872
- ...
870
+...
871
+modparam("dispatcher", "outbound_proxy", "sip:outbound.example.com")
872
+...
873 873
 
874 874
 3.33. ds_default_socket (str)
875 875
 
... ...
@@ -883,9 +883,9 @@ estimator_alpha
883 883
    ignored.
884 884
 
885 885
    Example 1.35. Set the “ds_default_socket” parameter
886
- ...
887
- modparam("dispatcher", "ds_default_socket", "udp:192.168.0.125:5060")
888
- ...
886
+...
887
+modparam("dispatcher", "ds_default_socket", "udp:192.168.0.125:5060")
888
+...
889 889
 
890 890
 3.34. ds_default_sockname (str)
891 891
 
... ...
@@ -899,11 +899,11 @@ estimator_alpha
899 899
    (this parameter has higher priority).
900 900
 
901 901
    Example 1.36. Set the “ds_default_sockname” parameter
902
- ...
902
+...
903 903
  listen=udp:1.2.3.4:5060 name "sock1"
904
- ...
905
- modparam("dispatcher", "ds_default_sockname", "sock1")
906
- ...
904
+...
905
+modparam("dispatcher", "ds_default_sockname", "sock1")
906
+...
907 907
 
908 908
 3.35. ds_timer_mode (int)
909 909
 
... ...
@@ -921,9 +921,9 @@ estimator_alpha
921 921
    Default value is “0”.
922 922
 
923 923
    Example 1.37. Set the “ds_timer_mode” parameter
924
- ...
925
- modparam("dispatcher", "ds_timer_mode", 1)
926
- ...
924
+...
925
+modparam("dispatcher", "ds_timer_mode", 1)
926
+...
927 927
 
928 928
 3.36. event_callback (str)
929 929
 
... ...
@@ -956,9 +956,9 @@ end
956 956
    Default value is “0”.
957 957
 
958 958
    Example 1.39. Set the “ds_attrs_none” parameter
959
- ...
960
- modparam("dispatcher", "ds_attrs_none", 1)
961
- ...
959
+...
960
+modparam("dispatcher", "ds_attrs_none", 1)
961
+...
962 962
 
963 963
 3.38. ds_db_extra_attrs (str)
964 964
 
... ...
@@ -986,9 +986,9 @@ modparam("dispatcher", "ds_db_extra_attrs", "socket=socket;pref=prefix")
986 986
    Default value is “0”.
987 987
 
988 988
    Example 1.41. Set the “ds_load_mode” parameter
989
- ...
990
- modparam("dispatcher", "ds_load_mode", 1)
991
- ...
989
+...
990
+modparam("dispatcher", "ds_load_mode", 1)
991
+...
992 992
 
993 993
 3.40. reload_delta (int)
994 994
 
... ...
@@ -1510,13 +1510,13 @@ kamcmd dispatcher.set_duid_state ip 2 xyz
1510 1510
 
1511 1511
    Example:
1512 1512
                 kamcmd dispatcher.list
1513
- ...
1513
+...
1514 1514
 DEST: {
1515 1515
         URI: sip:192.168.0.1:5060
1516 1516
         FLAGS: AP
1517 1517
         PRIORITY: 12
1518 1518
 }
1519
- ...
1519
+...
1520 1520
 
1521 1521
    FLAGS consist out of 2 letters. First letter describe status of
1522 1522
    destination: A-active, I – inactive, T – trying, D – disabled.
... ...
@@ -1673,15 +1673,15 @@ kamctl rpc dispatcher.hash 4 bob server.com
1673 1673
    There are some predefined names:
1674 1674
      * 'duid' - used for call load dispatching. It must be an unique value
1675 1675
        to identify a destination (gateway address). Practically the load
1676
-       within the group is associated with this value.
1676
+       within the group is associated with this value.>
1677 1677
      * 'maxload' - used for call load dispatching. It must be a positive
1678 1678
        integer, defining the upper limit of active calls per destination.
1679 1679
        When the limit is reached, then the gateway is no longer selected
1680 1680
        for new calls until an exiting call via that gateway is terminated.
1681
-       If set to 0, then no active call limit is used.
1681
+       If set to 0, then no active call limit is used.>
1682 1682
      * 'weight' - used for weight based load distribution. It must be set
1683 1683
        to a positive integer value beteen 0 and 100. The value represents
1684
-       the percent of calls to be sent to that gateways.
1684
+       the percent of calls to be sent to that gateways.>
1685 1685
      * 'rweight' - used for relative weight based load distribution. It
1686 1686
        must be set to a positive integer value between 1 and 100
1687 1687
        (otherwise host will be excluded from relative weight distribution
... ...
@@ -1951,39 +1951,42 @@ route[REQINIT] {
1951 1951
 
1952 1952
 # Handle requests within SIP dialogs
1953 1953
 route[WITHINDLG] {
1954
-        if (has_totag()) {
1955
-                # sequential request withing a dialog should
1956
-                # take the path determined by record-routing
1957
-                if (loose_route()) {
1958
-                        if (is_method("BYE")) {
1959
-                                setflag(FLT_ACC); # do accounting ...
1960
-                                setflag(FLT_ACCFAILED); # ... even if the transa
1961
-ction fails
1962
-                        }
1963
-                        route(RELAY);
1954
+        if (!has_totag()) {
1955
+                return;
1956
+        }
1957
+
1958
+        # sequential request withing a dialog should
1959
+        # take the path determined by record-routing
1960
+        if (loose_route()) {
1961
+                if (is_method("BYE")) {
1962
+                        setflag(FLT_ACC); # do accounting ...
1963
+                        setflag(FLT_ACCFAILED); # ... even if the transaction fa
1964
+ils
1965
+                }
1966
+                route(RELAY);
1967
+        }
1968
+
1969
+        if (is_method("SUBSCRIBE") && uri == myself) {
1970
+                # in-dialog subscribe requests
1971
+                route(PRESENCE);
1972
+        }
1973
+
1974
+        if ( is_method("ACK") ) {
1975
+                if ( t_check_trans() ) {
1976
+                        # non loose-route, but stateful ACK;
1977
+                        # must be ACK after a 487 or e.g. 404 from upstream serv
1978
+er
1979
+                        t_relay();
1980
+                        exit;
1964 1981
                 } else {
1965
-                        if (is_method("SUBSCRIBE") && uri == myself) {
1966
-                                # in-dialog subscribe requests
1967
-                                route(PRESENCE);
1968
-                                exit;
1969
-                        }
1970
-                        if ( is_method("ACK") ) {
1971
-                                if ( t_check_trans() ) {
1972
-                                        # non loose-route, but stateful ACK;
1973
-                                        # must be ACK after a 487 or e.g. 404 fr
1974
-om upstream server
1975
-                                        t_relay();
1976
-                                        exit;
1977
-                                } else {
1978
-                                        # ACK without matching transaction ... i
1979
-gnore and discard.
1980
-                                        exit;
1981
-                                }
1982
-                        }
1983
-                        sl_send_reply("404","Not here");
1982
+                        # ACK without matching transaction ... ignore and discar
1983
+d.
1984
+                        exit;
1984 1985
                 }
1985
-                exit;
1986 1986
         }
1987
+
1988
+        sl_send_reply("404","Not here");
1989
+        exit;
1987 1990
 }
1988