<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>id column is not used at all by the dispatcher module, it is
      there to facilitate the management of db records, so one can do
      sql operations using id=X to update/delete from a management app.</p>
    <p>To ensure the same order in the memory of dispatcher module set
      the priority field to the same value for each of those
      destinations in different sets. IIRC, higher the priority value,
      first in the list. You can check with dispatcher.list rpc command
      and if they addresses are on the same position in the set, then
      hashing over the same value will pick the same address in set.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 20.05.20 20:29, George
      Diamantopoulos wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPcKEYPEFVDiujPRvU=4fEb17ce3L9Q=w6VvsMg7tJTnJefYMg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Thank you for your reply Karsten,</div>
        <div><br>
        </div>
        <div>The distinction between the auto-incremented IDs and the
          manually-chosen setid is clear to me. The issue is how to pick
          the same entry from the same setid when a pvar resolves to the
          same value in an algorithm that takes said pvar into account
          for a hash:</div>
        <div><br>
        </div>
        <div>Say KamA has:</div>
        <div><br>
        </div>
        <div>set_id_100_members:</div>
        <div> * id: 0, setid: 100, destination: <a class="moz-txt-link-freetext" href="sip:b2b1.domain.com">sip:b2b1.domain.com</a>...</div>
        <div> * id: 1, setid: 100, destination: <a class="moz-txt-link-freetext" href="sip:b2b2.domain.com">sip:b2b2.domain.com</a>...</div>
        <div><br>
        </div>
        <div>and KamB has:</div>
        <div><br>
        </div>
        <div> * id: 7, setid: 100, destination: <a class="moz-txt-link-freetext" href="sip:b2b1.domain.com">sip:b2b1.domain.com</a>...</div>
        <div>
          <div> * id: 9, setid: 100, destination: <a class="moz-txt-link-freetext" href="sip:b2b1.domain.com">sip:b2b1.domain.com</a>...</div>
          <div><br>
          </div>
          <div>Now, say that $fU is used as the value to be hashed over
            for dispatcher. How does one ensure that for $fU = 'alice',
            both KamA and KamB will choose the same destination, for
            example <a href="http://b2b2.domain.com"
              moz-do-not-send="true">b2b2.domain.com</a></div>
          <div><br>
          </div>
          <div>Obviously, both need to be configured with setid 100, but
            do other things play a role, such as the way the destination
            is presented (e.g. sip:<a href="http://b2b2.domain.com"
              moz-do-not-send="true">b2b2.domain.com</a>;xdesc=b2b-east
            might refer to the same host as sip:<a
              href="http://b2b2.domain.com" moz-do-not-send="true">b2b2.domain.com</a>
            or <a class="moz-txt-link-freetext" href="sip:3.3.3.3">sip:3.3.3.3</a>, but does it affect dispatcher in any way)?
            Similarly, how about the fact that these dispatcher
            destinations are in reversed order, or that their
            auto-increment IDs are different?</div>
          <div><br>
          </div>
          <div>I hope this clarifies my question. Thanks!</div>
          <div><br>
          </div>
          <div>BR,</div>
          <div>George<br>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Wed, 20 May 2020 at 21:07,
          Karsten Horsmann <<a href="mailto:khorsmann@gmail.com"
            moz-do-not-send="true">khorsmann@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="auto">
            <div>Hi Georg, </div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">setid is not an autoincrement. </div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">See the DB structure information (should be
              to your version) </div>
            <div dir="auto"><a
href="https://kamailio.org/docs/db-tables/kamailio-db-5.1.x.html#idm1963"
                target="_blank" moz-do-not-send="true">https://kamailio.org/docs/db-tables/kamailio-db-5.1.x.html#idm1963</a><br>
            </div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">I group my targets with the setid. That's
              maybe the name "sets of id's" </div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">So all with the same id would be taken if
              the are active and how you call them from your
              kamailio.cfg. </div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">The other question is an implementation one.
              I don't understand the problem completely. </div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">Cheers </div>
            <div dir="auto">Karsten </div>
            <div dir="auto"><br>
              <br>
              <div class="gmail_quote" dir="auto">
                <div dir="ltr" class="gmail_attr">George Diamantopoulos
                  <<a href="mailto:georgediam@gmail.com"
                    target="_blank" moz-do-not-send="true">georgediam@gmail.com</a>>
                  schrieb am Mi., 20. Mai 2020, 19:42:<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>Hello all,</div>
                    <div><br>
                    </div>
                    <div>I need to have two separate kamailio instances'
                      dispatcher modules make the same decisions when
                      using algorithm 7 (hash over pvar). What do I need
                      to do to ensure this?</div>
                    <div><br>
                    </div>
                    <div>Note that for design reasons, the two instances
                      cannot share a dispatcher table from db. If I
                      ensure the "setid" group used for algo 7 in the
                      respective cases contain the same group of hosts,
                      is it enough? Do other things matter, such as the
                      ordering of the group members in the table (i.e.
                      different AUTO INCREMENT ids?). Does the setid
                      need to be the same number? Do I need to ensure
                      the 'destination' values are identical (i.e. not
                      using IPs for dispatcher table A and hostnames for
                      dispatcher table B)?<br>
                    </div>
                    <div><br>
                    </div>
                    <div>If someone knows what the criteria is for
                      matching a hashed pvar to a member of a dispatcher
                      setid and how this can be made deterministic, I
                      would be grateful. Thanks!</div>
                    <div><br>
                    </div>
                    <div>BR,</div>
                    <div>George<br>
                    </div>
                  </div>
                  _______________________________________________<br>
                  Kamailio (SER) - Users Mailing List<br>
                  <a href="mailto:sr-users@lists.kamailio.org"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                  <a
                    href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                    rel="noreferrer noreferrer" target="_blank"
                    moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                </blockquote>
              </div>
            </div>
          </div>
          _______________________________________________<br>
          Kamailio (SER) - Users Mailing List<br>
          <a href="mailto:sr-users@lists.kamailio.org" target="_blank"
            moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
          <a
            href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
  </body>
</html>