<p></p>
<p>I’m doing some testing on Dispatcher in order to prepare it for HA setups with floating IPs on Kamailio version 5.4.1.</p>
<p>In this scenario my calls must be sent to SET with the ID 2 :</p>
<blockquote>
<p>SET: {<br>
ID: 2<br>
TARGETS: {<br>
DEST: {<br>
URI: sip:GW_IP:5061<br>
FLAGS: AX<br>
PRIORITY: 0<br>
ATTRS: {<br>
BODY: duid=TB_MG03;socket=SOCKET_IP_1:5060<br>
DUID: TB_MG03<br>
MAXLOAD: 0<br>
WEIGHT: 0<br>
RWEIGHT: 0<br>
SOCKET: SOCKET_IP_1:5060<br>
SOCKNAME:<br>
OBPROXY:<br>
}<br>
RUNTIME: {<br>
DLGLOAD: 0<br>
}<br>
}<br>
DEST: {<br>
URI: sip:GW_IP:5061<br>
FLAGS: AX<br>
PRIORITY: 0<br>
ATTRS: {<br>
BODY: duid=TB_MG02;socket=SOCKET_IP_2:5060<br>
DUID: TB_MG02<br>
MAXLOAD: 0<br>
WEIGHT: 0<br>
RWEIGHT: 0<br>
SOCKET: SOCKET_IP_2:5060<br>
SOCKNAME:<br>
OBPROXY:<br>
}<br>
RUNTIME: {<br>
DLGLOAD: 0<br>
}<br>
}<br>
}<br>
}</p>
</blockquote>
<p>As you can see, both gateways have the same URI but they have different sockets. In this scenario i tried to make a bunch of calls with this set as destination but all calls ended being delivered with socket "SOCKET_IP_2:5060" as oposed to doing a load balancing. This isn’t a real scenario since i wouldn’t want load balance for the same destination, but the objective is to show you the balance feature failing in this conditions, in order to help you debug the issue.</p>
<p>After that i tried a different scenario. This time i disabled the destination with DUID TB_MG02 and socket SOCKET_IP_2:5060 and made the same test.</p>
<blockquote>
<p>SET: {<br>
ID: 2<br>
TARGETS: {<br>
DEST: {<br>
URI: sip:GW_IP:5061<br>
FLAGS: AX<br>
PRIORITY: 0<br>
ATTRS: {<br>
BODY: duid=TB_MG03;socket=SOCKET_IP_1:5060<br>
DUID: TB_MG03<br>
MAXLOAD: 0<br>
WEIGHT: 0<br>
RWEIGHT: 0<br>
SOCKET: SOCKET_IP_1:5060<br>
SOCKNAME:<br>
OBPROXY:<br>
}<br>
RUNTIME: {<br>
DLGLOAD: 0<br>
}<br>
}<br>
DEST: {<br>
URI: sip:GW_IP:5061<br>
FLAGS: DX<br>
PRIORITY: 0<br>
ATTRS: {<br>
BODY: duid=TB_MG02;socket=SOCKET_IP_2:5060<br>
DUID: TB_MG02<br>
MAXLOAD: 0<br>
WEIGHT: 0<br>
RWEIGHT: 0<br>
SOCKET: SOCKET_IP_2:5060<br>
SOCKNAME:<br>
OBPROXY:<br>
}<br>
RUNTIME: {<br>
DLGLOAD: 0<br>
}<br>
}<br>
}<br>
}</p>
</blockquote>
<p>In this test all the calls ended up being delivered with SOCKET_IP_2 as the socket. This time no load balance was made and a disabled destination was used.</p>
<p>I’ve tried reversing the order of the destinations in the configuration and it now chooses socket SOCKET_IP_1 all the time.</p>
<p>If both destinations have different URIs none of this problems happen, only with two destinations with same address but different sockets.</p>
<p>Here are my dispatcher parameters, let me know if there is some config wrong :</p>
<p>modparam("dispatcher", "flags", 2) // Failover support is enabled<br>
modparam("dispatcher", "ds_ping_method", "OPTIONS")<br>
modparam("dispatcher", "ds_hash_size", 8)<br>
modparam("dispatcher", "db_url", DBURL)<br>
modparam("dispatcher", "table_name", "TBK_DISPATCHER")<br>
modparam("dispatcher", "setid_col", "TBK_NapGroupId")<br>
modparam("dispatcher", "destination_col", "TBK_NapPeer")<br>
modparam("dispatcher", "flags_col", "TBK_NapState")<br>
modparam("dispatcher", "priority_col", "TBK_NapPriority")<br>
modparam("dispatcher", "attrs_col", "TBK_NapAttrs")<br>
modparam("dispatcher", "ds_probing_mode", 3)<br>
modparam("dispatcher", "ds_ping_interval", 10)<br>
modparam("dispatcher", "ds_probing_threshold", 2)<br>
modparam("dispatcher", "ds_inactive_threshold", 2)<br>
modparam("dispatcher", "ds_ping_reply_codes", "code=200;code=484;code=404")<br>
modparam("dispatcher", "ds_db_extra_attrs", "socket=TBK_Sap")<br>
modparam("dispatcher", "ds_ping_from", "sip:<a href="mailto:PeerProbing@peer.probing">PeerProbing@peer.probing</a>")</p>
<p>What do you think might be the problem here? If you need any more info please let me know. HA setup is a really important feature for us to move forward and as such we need to assure that we use the correct socket.</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/2527">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOUGRCY6VAC7T7LX2DSMBJANANCNFSM4S3MVQ4Q">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZLN476LBLHR4FKFJBLSMBJANA5CNFSM4S3MVQ42YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4K25BXWA.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/2527",
"url": "https://github.com/kamailio/kamailio/issues/2527",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>