<div dir="ltr">Hi, Joel!<div><br></div><div>You may  call ds_select_dst for two sets:</div><div>set 1 with <span style="font-size:12.8px">1.1.1.1  </span>ds_select_dst("1", "4")</div><div><span style="font-size:12.8px">set 2 </span><span style="font-size:12.8px"> with </span><span style="font-size:12.8px">2.2.2.2 and 3.3.3.3. If set1 is down (</span>ds_select_dst("1", "4")==false<span style="font-size:12.8px">)  then try </span>ds_select_dst("2", "9")</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-12-07 20:47 GMT+03:00 Joel Serrano <span dir="ltr"><<a href="mailto:joel@gogii.net" target="_blank">joel@gogii.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all, <div><br></div><div>I have a doubt regarding how dispatcher selects a node...</div><div><br></div><div>From the docs:</div><div><br></div><div><br></div><div><span class="m_1061517656302399033gmail-m_-430869899083946277emphasis" style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px;text-align:justify"><em>[...]</em></span></div><div><span class="m_1061517656302399033gmail-m_-430869899083946277emphasis" style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px;text-align:justify"><em>alg</em></span><span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px;text-align:justify"> - the algorithm used to select the destination address. The parameter can be an integer or a variable holding an interger.</span><br></div><div><br></div><div><ul class="m_1061517656302399033gmail-m_-430869899083946277gmail-itemizedlist" type="circle" style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px"><li class="m_1061517656302399033gmail-m_-430869899083946277gmail-listitem"><p style="text-align:justify"><span class="m_1061517656302399033gmail-m_-430869899083946277gmail-quote">“<span class="m_1061517656302399033gmail-m_-430869899083946277gmail-quote">4</span>”</span> - round-robin (next destination).</p></li><li class="m_1061517656302399033gmail-m_-430869899083946277gmail-listitem"><p style="text-align:justify"><span class="m_1061517656302399033gmail-m_-430869899083946277gmail-quote">“<span class="m_1061517656302399033gmail-m_-430869899083946277gmail-quote">8</span>”</span> - select destination sorted by priority attribute value (serial forking ordered by priority).</p></li><li class="m_1061517656302399033gmail-m_-430869899083946277gmail-listitem"><p style="text-align:justify"><span class="m_1061517656302399033gmail-m_-430869899083946277gmail-quote">“<span class="m_1061517656302399033gmail-m_-430869899083946277gmail-quote">9</span>”</span> - use weight based load distribution. You have to set the attribute 'weight' per each address in destination set.</p></li></ul></div><div style="text-align:justify"><em style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px">[...]</em><font color="#000000" face="Helvetica, Arial, sans-serif"><span style="font-size:15px"><br></span></font></div><div style="text-align:justify"><em style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px"><br></em></div><div style="text-align:justify"><em style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px"><br></em></div><div style="text-align:justify"><div style="text-align:start">I normally use "4", so dispatcher round-robins through the destinations of a setid, but I have now the following doubt:</div><div style="text-align:start"><br></div><div style="text-align:start">If a trunk has 3 nodes, say 1.1.1.1, 2.2.2.2, 3.3.3.3</div><div style="text-align:start"><br></div><div style="text-align:start">Can I do:</div><div style="text-align:start"><br></div><div style="text-align:start">Send all calls to 1.1.1.1, if it goes down, then do a 80%-20% between 2.2.2.2 and 3.3.3.3.</div><div style="text-align:start"><br></div><div style="text-align:start"><br></div><div style="text-align:start">if the trunk has a correct DNS SRV setup with weight and priority it's easy to achieve, but in this case there is no SRV or nothing, just 3 IPs.</div><div style="text-align:start"><br></div><div style="text-align:start">So can this logic be achieved with dispatcher directly? Can do some combination of alg "8" and alg "9"?</div><div style="text-align:start"><br></div><div style="text-align:start">Or would the correct approach need two separate setid groups and handle that logic in failure route?</div><div style="text-align:start"><br></div><div style="text-align:start"><br></div><div style="text-align:start"><br></div><div style="text-align:start">Thanks, </div><span class="HOEnZb"><font color="#888888"><div style="text-align:start">Joel.</div><div style="text-align:start"><br></div></font></span></div></div>
<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Savolainen Dmitri</div></div></div></div></div>
</div>