<h3>Description</h3>
<p>When using <code>ds_select_routes</code> $du is properly set to the first setid (1) and limiting properly the calls (with maxload), but when the nodes on setid 1 are at maxload and kamailio properly selects the second setid (11) it does NOT set $du.</p>
<h3>Troubleshooting</h3>
<p>My dispatcher table is:</p>
<pre><code>+-----+-------+-------------------------+-------+----------+-----------------------------------+-------------+
| id  | setid | destination             | flags | priority | attrs                             | description |
+-----+-------+-------------------------+-------+----------+-----------------------------------+-------------+
| 213 |     1 | sip:1.1.1.1:5080        |     0 |        0 | weight=100;maxload=2;duid=cuore_1 | node1-proxy |
| 229 |     1 | sip:2.2.2.2:5080        |     0 |        0 | weight=100;maxload=2;duid=cuore_2 | node2-proxy |
| 232 |    11 | sip:3.3.3.3:5080        |     0 |        0 | weight=100;maxload=2;duid=cuore_3 | node3-proxy |
+-----+-------+-------------------------+-------+----------+-----------------------------------+-------------+
</code></pre>
<h4>Log Messages</h4>
<pre><code>[DISPATCH] 1-12743@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: <sip:1.1.1.1:5080>
[DISPATCH] 2-12743@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: <sip:2.2.2.2:5080>
[DISPATCH] 3-12743@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: <sip:1.1.1.1:5080>
[DISPATCH] 4-12743@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: <sip:2.2.2.2:5080>
[DISPATCH] 5-12743@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: <<null>>
[DISPATCH] 6-12743@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: <<null>>
</code></pre>
<h3>Possible Solutions</h3>

<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.3.0-dev0 (x86_64/linux) f465d2
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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
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: f465d2
compiled on 01:08:37 Nov 17 2018 with gcc 4.9.2
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>Linux my-proxy 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux
</code></pre>

<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/1728">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZVXfhrqZpAEKQ6BRkgiVR1D8oyM8ks5uv3UfgaJpZM4YnO9T">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZciqHjB1b_G0EZB-lq2FphOd7oxpks5uv3UfgaJpZM4YnO9T.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"dispatcher on 5.2 not setting the destination properly for the second route (#1728)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1728"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1728",
"url": "https://github.com/kamailio/kamailio/issues/1728",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "dispatcher on 5.2 not setting the destination properly for the second route (#1728)",
"sections": [
{
"text": "",
"activityTitle": "**David Villasmil**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@davidcsi",
"facts": [
{
"name": "Repository: ",
"value": "kamailio/kamailio"
},
{
"name": "Issue #: ",
"value": 1728
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1728,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1728\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1728"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 412938067\n}"
}
],
"themeColor": "26292E"
}
]</script>