Module: kamailio
Branch: master
Commit: e10a629a7737c12cc58a8abebf1fe67ed1f30ab9
URL: https://github.com/kamailio/kamailio/commit/e10a629a7737c12cc58a8abebf1fe67…
Author: Bastian Triller <bastian.triller(a)gmail.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-06-07T19:37:57+02:00
dispatcher: Fix typo
---
Modified: src/modules/dispatcher/doc/dispatcher_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/e10a629a7737c12cc58a8abebf1fe67…
Patch: https://github.com/kamailio/kamailio/commit/e10a629a7737c12cc58a8abebf1fe67…
---
diff --git a/src/modules/dispatcher/doc/dispatcher_admin.xml b/src/modules/dispatcher/doc/dispatcher_admin.xml
index cdd1ebc896e..e0e8d1beed8 100644
--- a/src/modules/dispatcher/doc/dispatcher_admin.xml
+++ b/src/modules/dispatcher/doc/dispatcher_admin.xml
@@ -2032,7 +2032,7 @@ onreply_route {
<para><emphasis>uri</emphasis> - the URI of the destination.</para>
</listitem>
<listitem>
- <para><emphasis>val</emphasis> - the valie of the overload control
+ <para><emphasis>val</emphasis> - the value of the overload control
rate (from 1 to 100) - how many times to skip using this destination
in 100 selections.</para>
</listitem>
Module: kamailio
Branch: master
Commit: a366c9a30f953571f89f539e87448ff0c5ac8585
URL: https://github.com/kamailio/kamailio/commit/a366c9a30f953571f89f539e87448ff…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2024-06-07T12:31:09+02:00
modules: readme files regenerated - dispatcher ... [skip ci]
---
Modified: src/modules/dispatcher/README
---
Diff: https://github.com/kamailio/kamailio/commit/a366c9a30f953571f89f539e87448ff…
Patch: https://github.com/kamailio/kamailio/commit/a366c9a30f953571f89f539e87448ff…
---
diff --git a/src/modules/dispatcher/README b/src/modules/dispatcher/README
index 209d77f4c87..c915f552809 100644
--- a/src/modules/dispatcher/README
+++ b/src/modules/dispatcher/README
@@ -122,6 +122,7 @@ Federico Cabiddu
4.14. ds_load_unset()
4.15. ds_reload()
4.16. ds_dsg_fetch(setid)
+ 4.17. ds_oc_set_rate(setid, uri, val)
5. RPC Commands
@@ -211,8 +212,9 @@ Federico Cabiddu
1.57. ds_load_unset usage
1.58. ds_reload usage
1.59. ds_dsg_fetch() usage
- 1.60. dispatcher list file
- 1.61. Kamailio config script - sample dispatcher usage
+ 1.60. ds_oc_set_rate() usage
+ 1.61. dispatcher list file
+ 1.62. Kamailio config script - sample dispatcher usage
Chapter 1. Admin Guide
@@ -289,6 +291,7 @@ Chapter 1. Admin Guide
4.14. ds_load_unset()
4.15. ds_reload()
4.16. ds_dsg_fetch(setid)
+ 4.17. ds_oc_set_rate(setid, uri, val)
5. RPC Commands
@@ -1115,6 +1118,7 @@ modparam("dispatcher", "ds_interval_mode", 7200)
4.14. ds_load_unset()
4.15. ds_reload()
4.16. ds_dsg_fetch(setid)
+ 4.17. ds_oc_set_rate(setid, uri, val)
4.1. ds_select_dst(set, alg[, limit])
@@ -1227,6 +1231,9 @@ GATEWAY | PRIORITY | ESTIMATED | ADJUSTED | LOAD
With congestion control the formula becomes :
CONGESTION_MS = CURRENT_LATENCY_MS - NORMAL_CONDITION_LATENCY_MS
ADJUSTED_PRIORITY = PRIORITY - (CONGESTION_MS/PRIORITY)
+ + ���64��� - round-robin (next destination) with over load control
+ (destination record is skipped based on over load control
+ rate).
+ ���X��� - if the algorithm is not implemented, the first entry in
set is chosen.
* limit - the maximum number of items to be stored in XAVP list for
@@ -1629,6 +1636,24 @@ onreply_route {
xinfo("set id: 1 - all: $dsg(count); active: $dsg(active)\n");
...
+4.17. ds_oc_set_rate(setid, uri, val)
+
+ Sets the overload control rate for the destination (setid, uri).
+
+ Description of parameters:
+ * setid - the set (group) id. The parameter can be an integer or a
+ variable holding an integer value.
+ * uri - the URI of the destination.
+ * val - the valie of the overload control rate (from 1 to 100) - how
+ many times to skip using this destination in 100 selections.
+
+ This function can be used from ANY_ROUTE.
+
+ Example 1.60. ds_oc_set_rate() usage
+...
+ ds_oc_set_rate("1", "sip:127.0.0.1:5080", "30");
+...
+
5. RPC Commands
5.1. dispatcher.set_state
@@ -1890,6 +1915,10 @@ kamctl rpc dispatcher.hash 4 bob server.com
* 'obproxy' - SIP URI of outbound proxy to be used when sending
pings. It overwrites the general ds_outbound_proxy parameter.
* 'latency' - latency_stats initialization in ms.
+ * 'ocmin' - minimum limit for over load control rate (value between 0
+ and 100, default 10).
+ * 'ocrate' - over load control rate (value between 0 and 100, default
+ 100).
6.1.2. File Format
@@ -1907,7 +1936,7 @@ setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attrs(str,opt)
For database, each element of a line resides in a different column.
Next is a dispatcher.list file example:
- Example 1.60. dispatcher list file
+ Example 1.61. dispatcher list file
...
#
# dispatcher destination sets (groups)
@@ -1932,7 +1961,7 @@ r,opt)
Next listing shows a sample config for using the dispatcher module.
- Example 1.61. Kamailio config script - sample dispatcher usage
+ Example 1.62. Kamailio config script - sample dispatcher usage
...
#!KAMAILIO
#
Module: kamailio
Branch: master
Commit: c2bde271f9d606e6cef987a223f746092c59d306
URL: https://github.com/kamailio/kamailio/commit/c2bde271f9d606e6cef987a223f7460…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-06-07T12:02:04+02:00
dispatcher: docs for algorithm 64 - round robin with overload control
---
Modified: src/modules/dispatcher/doc/dispatcher_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/c2bde271f9d606e6cef987a223f7460…
Patch: https://github.com/kamailio/kamailio/commit/c2bde271f9d606e6cef987a223f7460…
---
diff --git a/src/modules/dispatcher/doc/dispatcher_admin.xml b/src/modules/dispatcher/doc/dispatcher_admin.xml
index 83ef06285a0..979b59798af 100644
--- a/src/modules/dispatcher/doc/dispatcher_admin.xml
+++ b/src/modules/dispatcher/doc/dispatcher_admin.xml
@@ -1418,6 +1418,13 @@ With congestion control the formula becomes :
</programlisting>
</example>
</listitem>
+ <listitem>
+ <para>
+ <quote>64</quote> - round-robin (next destination) with over
+ load control (destination record is skipped based on over
+ load control rate).
+ </para>
+ </listitem>
<listitem>
<para>
<quote>X</quote> - if the algorithm is not implemented, the
@@ -2388,6 +2395,14 @@ kamctl rpc dispatcher.hash 4 bob server.com
<listitem>
<para>'latency' - latency_stats initialization in ms.</para>
</listitem>
+ <listitem>
+ <para>'ocmin' - minimum limit for over load control rate
+ (value between 0 and 100, default 10).</para>
+ </listitem>
+ <listitem>
+ <para>'ocrate' - over load control rate
+ (value between 0 and 100, default 100).</para>
+ </listitem>
</itemizedlist>
</para>
</section>
Module: kamailio
Branch: master
Commit: 199f7cc4f29e6bab5f462d0db1942a8a583f8a67
URL: https://github.com/kamailio/kamailio/commit/199f7cc4f29e6bab5f462d0db1942a8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-06-07T11:40:17+02:00
dispatcher: set DS_ALG_OVERLOAD to 64 to be able to use as a flag
---
Modified: src/modules/dispatcher/dispatch.c
---
Diff: https://github.com/kamailio/kamailio/commit/199f7cc4f29e6bab5f462d0db1942a8…
Patch: https://github.com/kamailio/kamailio/commit/199f7cc4f29e6bab5f462d0db1942a8…
---
diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c
index 0466f09d9d4..d3ddb81ee82 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -79,7 +79,7 @@
#define DS_ALG_RELWEIGHT 11
#define DS_ALG_PARALLEL 12
#define DS_ALG_LATENCY 13
-#define DS_ALG_OVERLOAD 14
+#define DS_ALG_OVERLOAD 64 /* 2^6 - can be also used as a flag */
#define DS_HN_SIZE 256
@@ -2618,7 +2618,7 @@ int ds_manage_routes(sip_msg_t *msg, ds_select_state_t *rstate)
return -1;
xavp_filled = 1;
break;
- case DS_ALG_OVERLOAD: /* 14 - round robin with overload control */
+ case DS_ALG_OVERLOAD: /* 64 - round robin with overload control */
lock_get(&idx->lock);
hash = idx->last;
idx->last = (idx->last + 1) % idx->nr;