No subject


Tue Jan 5 13:19:01 CET 2016


rmgw' command also runs a 'ds_reload' after running the database query to
remove the entry. Hence in my above sequence of operations, the primary
storage should have synced with the secondary storage before I ran 'fifo
ds_list' and should not have expected data in the ds_list output -

./opensipsctl dispatcher show
dispatcher gateways
+----+-------+------------------+--------+-------+--------+-------+-------------+
| id | setid | destination      | socket | flags | weight | attrs |
description |
+----+-------+------------------+--------+-------+--------+-------+-------------+
|  5 |    40 | sip:2.2.2.6:5060 | NULL   |     0 |      1 |       | test1
    |
+----+-------+------------------+--------+-------+--------+-------+-------------+

 ./opensipsctl dispatcher rmgw 5 <<<<------ ds_reload here
 ./opensipsctl fifo ds_list <<<----- should show synced output ?
SET_NO:: 1
SET:: 40
URI:: sip:2.2.2.6:5060 flag=A
 ./opensipsctl dispatcher show
dispatcher gateways

I tried the above by running 'fifo ds_reload' explicitly after 'dispatcher
rmgw' as well. However I did not see a difference in the result. Can you
please help in understanding the issue?

Thanks,
Gunjan

On Thu, Jan 14, 2016 at 1:39 AM, Bogdan-Andrei Iancu <bogdan at opensips.org>
wrote:

> Hi Gunjan,
>
> In dispatcher there are 2 storages:
>     - primary storage which is in memory
>     - secondary storage (read only at startup or reload) which is the DB
>
> 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.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
> On 14.01.2016 03:44, Gunjan Korlekar wrote:
>
> Hello,
>
> I am observing some unusual behavior of the ds_list command when adding
> and removing gateways in the dispatcher table for opensips 1.8
>
> I am running the following sequence of commands -
>
> ./opensipsctl dispatcher addgw 40 sip:2.2.2.4:5060 0 'test1'
>  ./opensipsctl dispatcher addgw 40 sip:2.2.2.5:5060 0 'test1'
>  ./opensipsctl dispatcher addgw 40 sip:2.2.2.6:5060 0 'test1'
>
> When I view the dispatcher list using ds_list I see-
>  ./opensipsctl fifo ds_list
> SET_NO:: 1
> SET:: 40
> URI:: sip:2.2.2.4:5060 flag=A
> URI:: sip:2.2.2.5:5060 flag=A
> URI:: sip:2.2.2.6:5060 flag=A
> and the ./opensipsctl dispatcher show output is as follows -
> dispatcher gateways
>
> +----+-------+------------------+--------+-------+--------+-------+-------------+
> | id | setid | destination      | socket | flags | weight | attrs |
> description |
>
> +----+-------+------------------+--------+-------+--------+-------+-------------+
> |  3 |    40 | sip:2.2.2.4:5060 | NULL   |     0 |      1 |       | test1
>       |
> |  4 |    40 | sip:2.2.2.5:5060 | NULL   |     0 |      1 |       | test1
>       |
> |  5 |    40 | sip:2.2.2.6:5060 | NULL   |     0 |      1 |       | test1
>       |
>
> +----+-------+------------------+--------+-------+--------+-------+-------------+
>
> 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-
>
>  ./opensipsctl dispatcher rmgw 3
> ./opensipsctl fifo ds_list
> SET_NO:: 1
> SET:: 40
> URI:: sip:2.2.2.5:5060 flag=A
> URI:: sip:2.2.2.6:5060 flag=A
>  ./opensipsctl dispatcher show
> dispatcher gateways
>
> +----+-------+------------------+--------+-------+--------+-------+-------------+
> | id | setid | destination      | socket | flags | weight | attrs |
> description |
>
> +----+-------+------------------+--------+-------+--------+-------+-------------+
> |  4 |    40 | sip:2.2.2.5:5060 | NULL   |     0 |      1 |       | test1
>       |
> |  5 |    40 | sip:2.2.2.6:5060 | NULL   |     0 |      1 |       | test1
>       |
>
> +----+-------+------------------+--------+-------+--------+-------+-------------+
>
>  ./opensipsctl dispatcher rmgw 4
>  ./opensipsctl fifo ds_list
> SET_NO:: 1
> SET:: 40
> URI:: sip:2.2.2.6:5060 flag=A
>  ./opensipsctl dispatcher show
> dispatcher gateways
>
> +----+-------+------------------+--------+-------+--------+-------+-------------+
> | id | setid | destination      | socket | flags | weight | attrs |
> description |
>
> +----+-------+------------------+--------+-------+--------+-------+-------------+
> |  5 |    40 | sip:2.2.2.6:5060 | NULL   |     0 |      1 |       | test1
>       |
>
> +----+-------+------------------+--------+-------+--------+-------+-------------+
>
>  ./opensipsctl dispatcher rmgw 5
>  ./opensipsctl fifo ds_list
> SET_NO:: 1
> SET:: 40
> URI:: sip:2.2.2.6:5060 flag=A
>  ./opensipsctl dispatcher show
> dispatcher gateways
>
>
> 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?
>
> --
> Thanks,
> Gunjan
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>


-- 
Thanks,
Gunjan

--089e01536fe8f1af9805294e5bae
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Bogdan,<div><br></div><div>Thanks for the clarification=
 regarding the memory and the ds_list command.</div><div>=C2=A0</div><div>F=
rom what I see in the opensipsctl source, the &#39;opensipsctl dispatcher r=
mgw&#39; command also runs a &#39;ds_reload&#39; after running the database=
 query to remove the entry. Hence in my above sequence of operations, the p=
rimary storage should have synced with the secondary storage before I ran &=
#39;fifo ds_list&#39; and should not have expected data in the ds_list outp=
ut -</div><div><br></div><div><div style=3D"font-size:12.8px"><div>./opensi=
psctl dispatcher show</div><div>dispatcher gateways</div><div>+----+-------=
+------------------+--------+-------+--------+-------+-------------+</div><=
div>| id | setid | destination =C2=A0 =C2=A0 =C2=A0| socket | flags | weigh=
t | attrs | description |</div><div>+----+-------+------------------+------=
--+-------+--------+-------+-------------+</div><div>| =C2=A05 | =C2=A0 =C2=
=A040 | sip:<a href=3D"http://2.2.2.6:5060/" target=3D"_blank">2.2.2.6:5060=
</a>=C2=A0| NULL =C2=A0 | =C2=A0 =C2=A0 0 | =C2=A0 =C2=A0 =C2=A01 | =C2=A0 =
=C2=A0 =C2=A0 | test1 =C2=A0 =C2=A0 =C2=A0 |</div><div>+----+-------+------=
------------+--------+-------+--------+-------+-------------+</div><div><br=
></div><div>=C2=A0./opensipsctl dispatcher rmgw 5 &lt;&lt;&lt;&lt;------ ds=
_reload here</div><div>=C2=A0./opensipsctl fifo ds_list &lt;&lt;&lt;----- s=
hould show synced output ?<br></div><div>SET_NO:: 1</div><div>SET:: 40</div=
><div><span style=3D"white-space:pre-wrap">	</span>URI:: sip:<a href=3D"htt=
p://2.2.2.6:5060/" target=3D"_blank">2.2.2.6:5060</a>=C2=A0flag=3DA</div><d=
iv>=C2=A0./opensipsctl dispatcher show</div><div>dispatcher gateways</div><=
div><br></div><div>I tried the above by running &#39;fifo ds_reload&#39; ex=
plicitly after &#39;dispatcher rmgw&#39; as well. However I did not see a d=
ifference in the result. Can you please help in understanding the issue?</d=
iv><div><br></div><div>Thanks,</div><div>Gunjan</div></div></div></div><div=
 class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Thu, Jan 14, 2016 =
at 1:39 AM, Bogdan-Andrei Iancu <span dir=3D"ltr">&lt;<a href=3D"mailto:bog=
dan at opensips.org" target=3D"_blank">bogdan at opensips.org</a>&gt;</span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <tt>Hi Gunjan,<br>
      <br>
      In dispatcher there are 2 storages:<br>
      =C2=A0=C2=A0=C2=A0 - primary storage which is in memory<br>
      =C2=A0=C2=A0=C2=A0 - secondary storage (read only at startup or reloa=
d) 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 &quot;opensipsctl fifo
      ds_list&quot; (via MI command) gets data from memory cache while the
      &quot;opensipsctl dispatcher show&quot; simply dumps db content.<br>
      <br>
      Regards,<br>
    </tt>
    <pre cols=3D"72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href=3D"http://www.opensips-solutions.com" target=3D"_blank">http://www.=
opensips-solutions.com</a></pre><div><div class=3D"h5">
    <div>On 14.01.2016 03:44, Gunjan Korlekar
      wrote:<br>
    </div>
    </div></div><blockquote type=3D"cite"><div><div class=3D"h5">
      <div dir=3D"ltr"><span style=3D"font-size:12.8px">Hello,</span>
        <div style=3D"font-size:12.8px"><br>
        </div>
        <div style=3D"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=3D"font-size:12.8px"><br>
        </div>
        <div style=3D"font-size:12.8px">I am running the following
          sequence of commands -</div>
        <div style=3D"font-size:12.8px"><br>
        </div>
        <div style=3D"font-size:12.8px">
          <div>./opensipsctl dispatcher addgw 40 sip:<a href=3D"http://2.2.=
2.4:5060/" target=3D"_blank">2.2.2.4:5060</a>=C2=A00 &#39;test1&#39;</div>
          <div>=C2=A0./opensipsctl dispatcher addgw 40 sip:<a href=3D"http:=
//2.2.2.5:5060/" target=3D"_blank">2.2.2.5:5060</a>=C2=A00 &#39;test1&#39;<=
/div>
          <div>=C2=A0./opensipsctl dispatcher addgw 40 sip:<a href=3D"http:=
//2.2.2.6:5060/" target=3D"_blank">2.2.2.6:5060</a>=C2=A00 &#39;test1&#39;<=
/div>
          <div><br>
          </div>
          <div>When I view the dispatcher list using ds_list I see-</div>
          <div>=C2=A0./opensipsctl fifo ds_list</div>
          <div>
            <div>SET_NO:: 1</div>
            <div>SET:: 40</div>
            <div><span style=3D"white-space:pre-wrap">	</span>URI:: sip:<a =
href=3D"http://2.2.2.4:5060/" target=3D"_blank">2.2.2.4:5060</a>=C2=A0flag=
=3DA</div>
            <div><span style=3D"white-space:pre-wrap">	</span>URI:: sip:<a =
href=3D"http://2.2.2.5:5060/" target=3D"_blank">2.2.2.5:5060</a>=C2=A0flag=
=3DA</div>
            <div><span style=3D"white-space:pre-wrap">	</span>URI:: sip:<a =
href=3D"http://2.2.2.6:5060/" target=3D"_blank">2.2.2.6:5060</a>=C2=A0flag=
=3DA</div>
          </div>
          <div>and the=C2=A0./opensipsctl dispatcher show output is as
            follows -</div>
          <div>
            <div>dispatcher gateways</div>
            <div>+----+-------+------------------+--------+-------+--------=
+-------+-------------+</div>
            <div>| id | setid | destination =C2=A0 =C2=A0 =C2=A0| socket | =
flags |
              weight | attrs | description |</div>
            <div>+----+-------+------------------+--------+-------+--------=
+-------+-------------+</div>
            <div>| =C2=A03 | =C2=A0 =C2=A040 | sip:<a href=3D"http://2.2.2.=
4:5060/" target=3D"_blank">2.2.2.4:5060</a>=C2=A0|
              NULL =C2=A0 | =C2=A0 =C2=A0 0 | =C2=A0 =C2=A0 =C2=A01 | =C2=
=A0 =C2=A0 =C2=A0 | test1 =C2=A0 =C2=A0 =C2=A0 |</div>
            <div>| =C2=A04 | =C2=A0 =C2=A040 | sip:<a href=3D"http://2.2.2.=
5:5060/" target=3D"_blank">2.2.2.5:5060</a>=C2=A0|
              NULL =C2=A0 | =C2=A0 =C2=A0 0 | =C2=A0 =C2=A0 =C2=A01 | =C2=
=A0 =C2=A0 =C2=A0 | test1 =C2=A0 =C2=A0 =C2=A0 |</div>
            <div>| =C2=A05 | =C2=A0 =C2=A040 | sip:<a href=3D"http://2.2.2.=
6:5060/" target=3D"_blank">2.2.2.6:5060</a>=C2=A0|
              NULL =C2=A0 | =C2=A0 =C2=A0 0 | =C2=A0 =C2=A0 =C2=A01 | =C2=
=A0 =C2=A0 =C2=A0 | test1 =C2=A0 =C2=A0 =C2=A0 |</div>
            <div>+----+-------+------------------+--------+-------+--------=
+-------+-------------+</div>
          </div>
          <div><br>
          </div>
          <div>However when I remove the 3 gateways one after another
            using the=C2=A0./opensipsctl dispatcher rmgw command. I see tha=
t
            the gateway that was removed last can still be seen in the
            ds_list command even though &#39;dispatcher show&#39; does not =
show
            any gateways present. Here is the sequence of commands I am
            executing-</div>
          <div><br>
          </div>
          <div>
            <div>=C2=A0./opensipsctl dispatcher rmgw 3</div>
            <div>./opensipsctl fifo ds_list<br>
            </div>
            <div>SET_NO:: 1</div>
            <div>SET:: 40</div>
            <div><span style=3D"white-space:pre-wrap">	</span>URI:: sip:<a =
href=3D"http://2.2.2.5:5060/" target=3D"_blank">2.2.2.5:5060</a>=C2=A0flag=
=3DA</div>
            <div><span style=3D"white-space:pre-wrap">	</span>URI:: sip:<a =
href=3D"http://2.2.2.6:5060/" target=3D"_blank">2.2.2.6:5060</a>=C2=A0flag=
=3DA</div>
            <div>=C2=A0./opensipsctl dispatcher show</div>
            <div>dispatcher gateways</div>
            <div>+----+-------+------------------+--------+-------+--------=
+-------+-------------+</div>
            <div>| id | setid | destination =C2=A0 =C2=A0 =C2=A0| socket | =
flags |
              weight | attrs | description |</div>
            <div>+----+-------+------------------+--------+-------+--------=
+-------+-------------+</div>
            <div>| =C2=A04 | =C2=A0 =C2=A040 | sip:<a href=3D"http://2.2.2.=
5:5060/" target=3D"_blank">2.2.2.5:5060</a>=C2=A0|
              NULL =C2=A0 | =C2=A0 =C2=A0 0 | =C2=A0 =C2=A0 =C2=A01 | =C2=
=A0 =C2=A0 =C2=A0 | test1 =C2=A0 =C2=A0 =C2=A0 |</div>
            <div>| =C2=A05 | =C2=A0 =C2=A040 | sip:<a href=3D"http://2.2.2.=
6:5060/" target=3D"_blank">2.2.2.6:5060</a>=C2=A0|
              NULL =C2=A0 | =C2=A0 =C2=A0 0 | =C2=A0 =C2=A0 =C2=A01 | =C2=
=A0 =C2=A0 =C2=A0 | test1 =C2=A0 =C2=A0 =C2=A0 |</div>
            <div>+----+-------+------------------+--------+-------+--------=
+-------+-------------+</div>
            <div><br>
            </div>
            <div>=C2=A0./opensipsctl dispatcher rmgw 4</div>
            <div>=C2=A0./opensipsctl fifo ds_list<br>
            </div>
            <div>SET_NO:: 1</div>
            <div>SET:: 40</div>
            <div><span style=3D"white-space:pre-wrap">	</span>URI:: sip:<a =
href=3D"http://2.2.2.6:5060/" target=3D"_blank">2.2.2.6:5060</a>=C2=A0flag=
=3DA</div>
            <div>=C2=A0./opensipsctl dispatcher show</div>
            <div>dispatcher gateways</div>
            <div>+----+-------+------------------+--------+-------+--------=
+-------+-------------+</div>
            <div>| id | setid | destination =C2=A0 =C2=A0 =C2=A0| socket | =
flags |
              weight | attrs | description |</div>
            <div>+----+-------+------------------+--------+-------+--------=
+-------+-------------+</div>
            <div>| =C2=A05 | =C2=A0 =C2=A040 | sip:<a href=3D"http://2.2.2.=
6:5060/" target=3D"_blank">2.2.2.6:5060</a>=C2=A0|
              NULL =C2=A0 | =C2=A0 =C2=A0 0 | =C2=A0 =C2=A0 =C2=A01 | =C2=
=A0 =C2=A0 =C2=A0 | test1 =C2=A0 =C2=A0 =C2=A0 |</div>
            <div>+----+-------+------------------+--------+-------+--------=
+-------+-------------+</div>
            <div><br>
            </div>
            <div>=C2=A0./opensipsctl dispatcher rmgw 5</div>
            <div>=C2=A0./opensipsctl fifo ds_list<br>
            </div>
            <div>SET_NO:: 1</div>
            <div>SET:: 40</div>
            <div><span style=3D"white-space:pre-wrap">	</span>URI:: sip:<a =
href=3D"http://2.2.2.6:5060/" target=3D"_blank">2.2.2.6:5060</a>=C2=A0flag=
=3DA</div>
            <div>=C2=A0./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>
            <div><img src=3D"https://ssl.gstatic.com/ui/v1/icons/mail/image=
s/cleardot.gif"></div>
          </div>
        </div>
        <div><br>
        </div>
        -- <br>
        <div>
          <div dir=3D"ltr">Thanks,
            <div>Gunjan</div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
Users mailing list
<a href=3D"mailto:Users at lists.opensips.org" target=3D"_blank">Users at lists.o=
pensips.org</a>
<a href=3D"http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target=
=3D"_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature"><div dir=3D"ltr">Thanks,<div>Gunjan</div></div></div>
</div>

--089e01536fe8f1af9805294e5bae--



More information about the Users mailing list