<div dir="ltr"><div><div>The rest of the dispatcher "features", like failover should be supported based on what I remember from the way it was integrated and tested.<br><br></div>If it is not the case I can have a look.<br><br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 1, 2022 at 9:21 AM Julien Chavanton <<a href="mailto:jchavanton@gmail.com">jchavanton@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>On second thought, the documentation looks accurate to me.<br><br></div>Do you have the latency stats enabled ?<br><br><h3>3.26. <code>ds_ping_latency_stats</code> (int)</h3><br><br></div>If yes, the priority values you are using seem a bit low 1ms and 10ms.<br></div>If not, the algorithm should behave simply like that :<br><div>"The algorithm will load balance using round-robin prioritizing the gateways with the highest priority. "<br><br><div>
              <div>
                <div>
                  <h3><br></h3>
                </div>
              </div>
            </div></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 1, 2022 at 9:09 AM Julien Chavanton <<a href="mailto:jchavanton@gmail.com" target="_blank">jchavanton@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Maybe the documentation should be improved, it seems the first bullet point should say.<br><br>"The algorithm will load balance using round-robin prioritizing the gateways with the highest <b>adjusted</b> priority.
                                "<br><br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 1, 2022 at 9:06 AM Julien Chavanton <<a href="mailto:jchavanton@gmail.com" target="_blank">jchavanton@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi, did you look at the documentation of  algorithm 13 ?</div><div><br></div><div>The priority is used in combination with the latency to determine the preferred gateway.<br></div><div>Once you confirm that this is what you want "latency latency optimized dispatching", we can help to clarify why and how this may not work as expected.<br></div><div><br><br></div><div>Regards<br></div><br><br>
                      <a href="https://kamailio.org/docs/modules/devel/modules/dispatcher.html" target="_blank">https://kamailio.org/docs/modules/devel/modules/dispatcher.html</a><ul><li>
                        <p>
                                <span>“<span>13</span>”</span> - latency optimized dispatching
                                </p>
                        <p>
                                - The algorithm will load balance using round-robin prioritizing the gateways with the highest priority.
                                </p>
                        <p>
                                - If ds_ping_latency_stats is active the algorithm will adjust the priority of the gateway automatically,
                                the priority will be lowered by 1 point every time the latency ms is as high as the priority.
                                </p>
                        <p>
                                - If the attribute 'cc=1' is set, the latency used is congestion ms :
 estimate (current latency ms) - average (normal condition latency ms).
                                </p>
                        <div>
                          <a id="m_-84797006447973059m_35969133545273291m_-343184431663992846gmail-idm703"></a>
                          <p>
                            <strong>Example 1.46. <code>latency_optimized_dispatching</code> usage</strong>
                          </p>
                          <div>
                            <pre>Using this simple formula :
    ADJUSTED_PRIORITY = PRIORITY - (ESTIMATED_LATENCY_MS/PRIORITY)

GATEWAY | PRIORITY | ESTIMATED | ADJUSTED | LOAD
   #    |          |  LATENCY  | PRIORITY | DISTRIBUTION
   1    |    30    |    21     |    30    | 33%
   2    |    30    |    91     |    27    | 0%
   3    |    30    |    61     |    28    | 0%
   4    |    30    |    19     |    30    | 33%
   5    |    30    |    32     |    29    | 0%
   6    |    30    |    0      |    30    | 33%
   7    |    30    |    201    |    24    | 0%


With congestion control the formula becomes :
    CONGESTION_MS = CURRENT_LATENCY_MS - NORMAL_CONDITION_LATENCY_MS
    ADJUSTED_PRIORITY = PRIORITY - (CONGESTION_MS/PRIORITY)</pre>
                          </div>
                        </div>
                        <br>
                      </li><li>
                        <p>
                                <span></span></p><br></li></ul></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 1, 2022 at 2:38 AM Pyry Aaltonen <<a href="mailto:pyry.aaltonen@cuuma.com" target="_blank">pyry.aaltonen@cuuma.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>





<div lang="en-FI">
<div>
<p class="MsoNormal"><span lang="EN-US">Hello, <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I’m quite new user with kamailio (heard first time about it a year ago and joined the list yesterday) and now wondering how the xavp_dst should work.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I had read from the documentation that <u></u>
<u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">”</span><span>The first XAVP is the current selected destination.</span><span lang="EN-US">”<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I use ds_select_dst with alg 13. And my kamailio version is kamailio 5.5.3 (x86_64/linux)<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="EN-US">So when my dispatcher list is like (I have also tried to differ the priority value like 10 and 1, but doesn’t make difference)<u></u><u></u></span></p>
<p class="MsoNormal">10 sip:<span lang="EN-US">1.2.3.4</span>;transport=tcp 10 1 type=<span lang="EN-US">type1<u></u><u></u></span></p>
<p class="MsoNormal">1<span lang="EN-US">0</span> sip:<span lang="EN-US">4.3.2.1</span>;transport=tcp 10 1 type=<span lang="EN-US">type2<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">If one of the destinations fails (dx/ip), and it happens to be the one with higher priority or the one that just gets higher position in the dispatcher list if the prio Is equal.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">My xavp_</span>$xavp(dsdst=>attrs) <span lang="EN-US">
get null value. And, if I try to seek </span>$(xavp(dsdst[<span lang="EN-US">0</span>]=>attrs)
<span lang="EN-US">or </span>$(xavp(dsdst[<span lang="EN-US">1</span>]=>attrs) <span lang="EN-US">
I also got nothing. <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">If both destinations are up with equal priority, it selects them with round-robin, and the xavp_</span>$xavp(dsdst=>attrs)
<span lang="EN-US">has the type value of the selected destination as expected, also the
</span>$(xavp(dsdst[<span lang="EN-US">0</span>]=>attrs) <span lang="EN-US">or </span>
$(xavp(dsdst[<span lang="EN-US">1</span>]=>attrs) <span lang="EN-US">contains the destinations so that the selected is 0 and the other is at position 1.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">The $du is updated as I expect so if one fails the other one is selected always, why the xavp_dst isn’t working same way, or am I missing something?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">If needed I’ll try to provide more information,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks already in advance<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">-Pyry<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
</div>

__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>