<p></p>
<p><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="490235212" data-permission-text="Title is private" data-url="https://github.com/kamailio/kamailio/issues/2057" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/2057/hovercard" href="https://github.com/kamailio/kamailio/issues/2057">#2057</a> # Description</p>
<p>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.</p>
<p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="179505027" data-permission-text="Title is private" data-url="https://github.com/kamailio/kamailio/issues/800" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/800/hovercard" href="https://github.com/kamailio/kamailio/issues/800">#800</a> also addressed a maxload = 0 issue, but did not address the XAVP list.</p>
<h3>Possible Solutions</h3>
<p>The following patch resolves the issue for me:</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-c1">diff -ru a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c</span>
<span class="pl-md">--- a/modules/dispatcher/dispatch.c 2020-04-23 10:41:32.414130450 -0500</span>
<span class="pl-mi1">+++ b/modules/dispatcher/dispatch.c        2020-04-23 10:42:11.738154578 -0500</span>
<span class="pl-mdr">@@ -2273,6 +2273,7 @@</span>
                }
                /* max load exceeded per destination */
                if(rstate->alg == DS_ALG_CALLLOAD
<span class="pl-mi1"><span class="pl-mi1">+</span>                                && idx->dlist[i].attrs.maxload != 0</span>
                                && idx->dlist[i].dload >= idx->dlist[i].attrs.maxload) {
                        continue;
                }
<span class="pl-mdr">@@ -2294,6 +2295,7 @@</span>
                }
                /* max load exceeded per destination */
                if(rstate->alg == DS_ALG_CALLLOAD
<span class="pl-mi1"><span class="pl-mi1">+</span>                                && idx->dlist[i].attrs.maxload != 0</span>
                                && idx->dlist[i].dload >= idx->dlist[i].attrs.maxload) {
                        continue;
                }</pre></div>
<h3>Additional Information</h3>
<p>I am using the following version.  The issue appears to still exist in the master branch.</p>
<p>version: kamailio 5.3.2 (arm6/linux)<br>
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<br>
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
id: unknown<br>
compiled on 17:22:09 Mar 18 2020 with gcc 8.3.0</p>
<p>Thank you.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2297">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMODQKGUNWK74DFUYLROBSQNANCNFSM4MPGAVQQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZNHXGSVY5AVHP5UHULROBSQNA5CNFSM4MPGAVQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JAZXJGQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2297",
"url": "https://github.com/kamailio/kamailio/issues/2297",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>