<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I see that you have setid 2 with two addresses, one with weight 10
    and one with weight 50. In total you give the weight 60. The module
    is filling up to weight 100 using the last address returned from
    database, so you can end up having first address with weight 10 and
    the second with weight 90.<br>
    <br>
    This algorithm ensures that in 100 routed calls, 10 are routed to
    the first address and 90 to the second address. The order itself is
    randomized at load time. For example, you can have first 3 calls
    routed to address2, then 2 call to address1, then 8 calls to
    address2, then 8 calls to address1, then up to 100 routed to
    address2, after that is repeating the same routing selection.<br>
    <br>
    For set id 1 you have one address with weight 50, then practically
    in memory it results in this address being with weight 100 (being
    the only one in the setid), which is like routing always to it.<br>
    <br>
    Given the above details, can you present more about what you
    observed and what you would have expected to happen?<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    PS. Just to be fully aware of: 4.3 is master branch and it is
    considered unstable for production. But using it is encouraged, we
    fix the issues to it with and helps getting it to stable state. At
    least in the regard of dispacher and weight distribution, 4.3 and
    4.2 are the same.<br>
    <br>
    <div class="moz-cite-prefix"><br>
      On 08/01/15 14:45, Yuriy Gorlichenko wrote:<br>
    </div>
    <blockquote
cite="mid:CABSP_VfXqqAF-f2Z3k=O60sOLyvrwwGioWf6OevBW8kwm5+7cg@mail.gmail.com"
      type="cite">
      <div dir="ltr">We use 4.3 version. <br>
        <br>
        if(!ds_select_dst("$var(setid)", "9"))<br>
        <br>
        $var(setid)- is variable for setting setid that i get from
        database with my own scenario. IT does not matter. You may
        change it to something like 1,2, or anthing else.<br>
        So as you see setid 2 have 2 servers. I have an issue with this
        config<br>
        <br>
        id setid   destination                  flags priority attrs<br>
        <table>
          <tbody>
            <tr>
              <td>1</td>
              <td>   2</td>
              <td>   sip:<a moz-do-not-send="true"
                  href="http://34.25.123.45:50600">34.25.123.45:50600</a></td>
              <td>0</td>
              <td>      0         </td>
              <td>weight=10</td>
              <td><br>
              </td>
            </tr>
            <tr>
              <td>2</td>
              <td>   1</td>
              <td>   sip:<a moz-do-not-send="true"
                  href="http://10.0.1.6:50600">10.0.1.6:50600</a></td>
              <td>0</td>
              <td>      0</td>
              <td>weight=50</td>
              <td><br>
              </td>
            </tr>
            <tr>
              <td>3</td>
              <td>   2</td>
              <td>   sip:<a moz-do-not-send="true"
                  href="http://10.0.1.6:50600">10.0.1.6:50600</a></td>
              <td>0</td>
              <td>      0</td>
              <td>weight=50</td>
              <td><br>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2015-01-08 13:36 GMT+03:00
          Daniel-Constantin Mierla <span dir="ltr"><<a
              moz-do-not-send="true" href="mailto:miconda@gmail.com"
              target="_blank">miconda@gmail.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
              <br>
              what version are you using? Can you paste here the records
              you have for the destination set (you can replace the ip
              addresses, I am interested in attributes) and the
              ds_select_dst() or ds_select_domain() lines from your
              config?<br>
              <br>
              Cheers,<br>
              Daniel
              <div>
                <div class="h5"><br>
                  <br>
                  <div>On 08/01/15 04:07, Yuriy Gorlichenko wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div dir="ltr">Hello I use dipatcher  algorithm that
                      works with weight. I added  2 Asterisks and try to
                      call its with my kam, but this still works like 4
                      algorithm. Weight does not work.<br>
                      How I must configure dispatchr for working with
                      weight?<br>
                      My configuration now is<br>
                      <br>
                      <div>modparam("dispatcher", "db_url",DBURL)</div>
                      <div>modparam("dispatcher", "table_name",
                        "dispatcher")</div>
                      <div>modparam("dispatcher", "setid_col", "setid")</div>
                      <div>modparam("dispatcher", "destination_col",
                        "destination")</div>
                      <div>modparam("dispatcher", "force_dst", 1)</div>
                      <div>modparam("dispatcher", "flags", 3)</div>
                      <div>modparam("dispatcher", "dst_avp",
                        "$avp(i:271)")</div>
                      <div>modparam("dispatcher", "grp_avp",
                        "$avp(i:272)")</div>
                      <div>modparam("dispatcher", "cnt_avp",
                        "$avp(i:273)")</div>
                      <div>modparam("dispatcher", "ds_ping_from", "<a
                          moz-do-not-send="true"
                          href="mailto:sip%3Aproxy@10.0.1.1"
                          target="_blank">sip:proxy@10.0.1.1</a>")</div>
                      <div>modparam("dispatcher", "ds_ping_interval",15)</div>
                      <div>modparam("dispatcher", "ds_probing_mode", 1)</div>
                      <div>modparam("dispatcher", "ds_ping_reply_codes",
                        "class=2;code=403;code=404;code=484;class=3")</div>
                      <div>modparam("tm", "reparse_on_dns_failover", 0)</div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre>
                <span class="HOEnZb"><font color="#888888"> </font></span></blockquote>
              <span class="HOEnZb"><font color="#888888"> <br>
                  <pre cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a></pre>
                </font></span></div>
            <br>
            _______________________________________________<br>
            SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
            mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
              target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>