<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Gunjan,<br>
      <br>
      In dispatcher there are 2 storages:<br>
          - primary storage which is in memory<br>
          - secondary storage (read only at startup or reload) which is
      the DB<br>
      <br>
      First is about synchronizing the 2 storages (from secondary to
      primary via a ds_reload command). AFter that is about which
      storage you are querying for data. Like the "opensipsctl fifo
      ds_list" (via MI command) gets data from memory cache while the
      "opensipsctl dispatcher show" simply dumps db content.<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 14.01.2016 03:44, Gunjan Korlekar
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAGLL2fv=MnJS_mU--RvddUK2HdBw3oZh9bc27KcuB-seJQoMuA@mail.gmail.com"
      type="cite">
      <div dir="ltr"><span style="font-size:12.8px">Hello,</span>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">I am observing some unusual
          behavior of the ds_list command when adding and removing
          gateways in the dispatcher table for opensips 1.8</div>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">I am running the following
          sequence of commands -</div>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">
          <div>./opensipsctl dispatcher addgw 40 sip:<a
              moz-do-not-send="true" href="http://2.2.2.4:5060/"
              target="_blank">2.2.2.4:5060</a> 0 'test1'</div>
          <div> ./opensipsctl dispatcher addgw 40 sip:<a
              moz-do-not-send="true" href="http://2.2.2.5:5060/"
              target="_blank">2.2.2.5:5060</a> 0 'test1'</div>
          <div> ./opensipsctl dispatcher addgw 40 sip:<a
              moz-do-not-send="true" href="http://2.2.2.6:5060/"
              target="_blank">2.2.2.6:5060</a> 0 'test1'</div>
          <div><br>
          </div>
          <div>When I view the dispatcher list using ds_list I see-</div>
          <div> ./opensipsctl fifo ds_list</div>
          <div>
            <div>SET_NO:: 1</div>
            <div>SET:: 40</div>
            <div><span style="white-space:pre-wrap">        </span>URI:: sip:<a
                moz-do-not-send="true" href="http://2.2.2.4:5060/"
                target="_blank">2.2.2.4:5060</a> flag=A</div>
            <div><span style="white-space:pre-wrap">        </span>URI:: sip:<a
                moz-do-not-send="true" href="http://2.2.2.5:5060/"
                target="_blank">2.2.2.5:5060</a> flag=A</div>
            <div><span style="white-space:pre-wrap">        </span>URI:: sip:<a
                moz-do-not-send="true" href="http://2.2.2.6:5060/"
                target="_blank">2.2.2.6:5060</a> flag=A</div>
          </div>
          <div>and the ./opensipsctl dispatcher show output is as
            follows -</div>
          <div>
            <div>dispatcher gateways</div>
            <div>+----+-------+------------------+--------+-------+--------+-------+-------------+</div>
            <div>| id | setid | destination      | socket | flags |
              weight | attrs | description |</div>
            <div>+----+-------+------------------+--------+-------+--------+-------+-------------+</div>
            <div>|  3 |    40 | sip:<a moz-do-not-send="true"
                href="http://2.2.2.4:5060/" target="_blank">2.2.2.4:5060</a> |
              NULL   |     0 |      1 |       | test1       |</div>
            <div>|  4 |    40 | sip:<a moz-do-not-send="true"
                href="http://2.2.2.5:5060/" target="_blank">2.2.2.5:5060</a> |
              NULL   |     0 |      1 |       | test1       |</div>
            <div>|  5 |    40 | sip:<a moz-do-not-send="true"
                href="http://2.2.2.6:5060/" target="_blank">2.2.2.6:5060</a> |
              NULL   |     0 |      1 |       | test1       |</div>
            <div>+----+-------+------------------+--------+-------+--------+-------+-------------+</div>
          </div>
          <div><br>
          </div>
          <div>However when I remove the 3 gateways one after another
            using the ./opensipsctl dispatcher rmgw command. I see that
            the gateway that was removed last can still be seen in the
            ds_list command even though 'dispatcher show' does not show
            any gateways present. Here is the sequence of commands I am
            executing-</div>
          <div><br>
          </div>
          <div>
            <div> ./opensipsctl dispatcher rmgw 3</div>
            <div>./opensipsctl fifo ds_list<br>
            </div>
            <div>SET_NO:: 1</div>
            <div>SET:: 40</div>
            <div><span style="white-space:pre-wrap">        </span>URI:: sip:<a
                moz-do-not-send="true" href="http://2.2.2.5:5060/"
                target="_blank">2.2.2.5:5060</a> flag=A</div>
            <div><span style="white-space:pre-wrap">        </span>URI:: sip:<a
                moz-do-not-send="true" href="http://2.2.2.6:5060/"
                target="_blank">2.2.2.6:5060</a> flag=A</div>
            <div> ./opensipsctl dispatcher show</div>
            <div>dispatcher gateways</div>
            <div>+----+-------+------------------+--------+-------+--------+-------+-------------+</div>
            <div>| id | setid | destination      | socket | flags |
              weight | attrs | description |</div>
            <div>+----+-------+------------------+--------+-------+--------+-------+-------------+</div>
            <div>|  4 |    40 | sip:<a moz-do-not-send="true"
                href="http://2.2.2.5:5060/" target="_blank">2.2.2.5:5060</a> |
              NULL   |     0 |      1 |       | test1       |</div>
            <div>|  5 |    40 | sip:<a moz-do-not-send="true"
                href="http://2.2.2.6:5060/" target="_blank">2.2.2.6:5060</a> |
              NULL   |     0 |      1 |       | test1       |</div>
            <div>+----+-------+------------------+--------+-------+--------+-------+-------------+</div>
            <div><br>
            </div>
            <div> ./opensipsctl dispatcher rmgw 4</div>
            <div> ./opensipsctl fifo ds_list<br>
            </div>
            <div>SET_NO:: 1</div>
            <div>SET:: 40</div>
            <div><span style="white-space:pre-wrap">        </span>URI:: sip:<a
                moz-do-not-send="true" href="http://2.2.2.6:5060/"
                target="_blank">2.2.2.6:5060</a> flag=A</div>
            <div> ./opensipsctl dispatcher show</div>
            <div>dispatcher gateways</div>
            <div>+----+-------+------------------+--------+-------+--------+-------+-------------+</div>
            <div>| id | setid | destination      | socket | flags |
              weight | attrs | description |</div>
            <div>+----+-------+------------------+--------+-------+--------+-------+-------------+</div>
            <div>|  5 |    40 | sip:<a moz-do-not-send="true"
                href="http://2.2.2.6:5060/" target="_blank">2.2.2.6:5060</a> |
              NULL   |     0 |      1 |       | test1       |</div>
            <div>+----+-------+------------------+--------+-------+--------+-------+-------------+</div>
            <div><br>
            </div>
            <div> ./opensipsctl dispatcher rmgw 5</div>
            <div> ./opensipsctl fifo ds_list<br>
            </div>
            <div>SET_NO:: 1</div>
            <div>SET:: 40</div>
            <div><span style="white-space:pre-wrap">        </span>URI:: sip:<a
                moz-do-not-send="true" href="http://2.2.2.6:5060/"
                target="_blank">2.2.2.6:5060</a> flag=A</div>
            <div> ./opensipsctl dispatcher show</div>
            <div>dispatcher gateways</div>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>Can you please help in understanding this behavior? Is
            this expected behavior? Is there something I am missing that
            needs to be done to correct this?</div>
          <div class="">
            <div id=":yp" class="" tabindex="0"><img
                moz-do-not-send="true" class=""
                src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"></div>
          </div>
        </div>
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">
          <div dir="ltr">Thanks,
            <div>Gunjan</div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>