#2057 # Description

The documentation for the dispatcher module indicates that maxload = 0 indicates no call limit for the call load distribution algorithm. However, when filling in the XAVP list for additional destinations, mode 10 does not handle the case where maxload = 0, so there are never any additional destinations in this case. This means that there is no failover if the original destination fails.

Issue #800 also addressed a maxload = 0 issue, but did not address the XAVP list.

Possible Solutions

The following patch resolves the issue for me:

diff -ru a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
--- a/modules/dispatcher/dispatch.c	2020-04-23 10:41:32.414130450 -0500
+++ b/modules/dispatcher/dispatch.c	2020-04-23 10:42:11.738154578 -0500
@@ -2273,6 +2273,7 @@
 		}
 		/* max load exceeded per destination */
 		if(rstate->alg == DS_ALG_CALLLOAD
+				&& idx->dlist[i].attrs.maxload != 0
 				&& idx->dlist[i].dload >= idx->dlist[i].attrs.maxload) {
 			continue;
 		}
@@ -2294,6 +2295,7 @@
 		}
 		/* max load exceeded per destination */
 		if(rstate->alg == DS_ALG_CALLLOAD
+				&& idx->dlist[i].attrs.maxload != 0
 				&& idx->dlist[i].dload >= idx->dlist[i].attrs.maxload) {
 			continue;
 		}

Additional Information

I am using the following version. The issue appears to still exist in the master branch.

version: kamailio 5.3.2 (arm6/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 17:22:09 Mar 18 2020 with gcc 8.3.0

Thank you.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.