<div dir="ltr"><div>How extraordinarily odd. I was absolutely certain I had tested this. I spent a lot of time monkeying around with the db_text file to try and accidentally make it work before I submitted the question, but, it certainly works. Hmz.<br></div><div><br></div><div>Well, er, in this case, I think my issue has been solved - including the lack of reload. I think I&#39;ll update the bug to include this information and let the devs decide whether they want to mess with it or not. If they do, they&#39;ll break this existing behaviour which is... logically wrong, but controllable. I&#39;ll let their wisdom decide for them.</div><div><br></div><div>My thanks to everyone who helped and my apologies for apparently goofing up my own testing before posting.</div><div><br></div><div> - Jock</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 23, 2015 at 3:55 PM, Ovidiu Sas <span dir="ltr">&lt;<a href="mailto:osas@voipembedded.com" target="_blank">osas@voipembedded.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Even the destination should be respected. The cached list is the same as the one listed through the mi command. Switch the order on your db_text file, reload and you should see the list on the mi command reversed.</p>
<p dir="ltr">Regards,<br>
Ovidiu Sas</p><div class="HOEnZb"><div class="h5">
<div style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Unfortunately upgrading the OpenSIPS we have in deployment is not likely to happen - we have something like 250 OpenSIPS systems running and upgrading just one for this bug is... probably not going to get past the IT nuts. We picked 1.8 as we were moving up from 1.6 and this would provide the smallest jump - and is an LTS.<br></div><div><br></div><div>We do run db_text in caching mode - the logic behind it was so that every call would not require a disk check. However, upon rethinking this (as prompted by your suggestion) I now realise that dispatcher does the caching, so we should turn it off on db_text.</div><div><br></div><div>I have confirmed that turning off db_text caching allows me to reload - my thanks!</div><div><br></div><div> -  Jock </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 23, 2015 at 1:25 PM, Ovidiu Sas <span dir="ltr">&lt;<a href="mailto:osas@voipembedded.com" target="_blank">osas@voipembedded.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You should try on the latest stable (or the new 2.1 release candidate).<br>
AFAIR, this used to work and reload works for sure.<br>
You need to read the documentation on the db_text module and make sure<br>
that you are not using db_text in cached mode.<br>
<br>
Regards,<br>
Ovidiu Sas<br>
<div><div><br>
On Thu, Apr 23, 2015 at 2:16 PM, Jock McKechnie<br>
&lt;<a href="mailto:jock.mckechnie@gmail.com" target="_blank">jock.mckechnie@gmail.com</a>&gt; wrote:<br>
&gt; Thank you kindly, Liviu;<br>
&gt;<br>
&gt; Unfortunately reordering the gateways makes no difference - I believe it&#39;s<br>
&gt; implicitly doing an ORDER BY of the destination field. I have submitted a<br>
&gt; bug.<br>
&gt;<br>
&gt; As a side note, curiously ds_reload does not actually work from dbtext<br>
&gt; dispatcher tables. I wasn&#39;t sure if this was a &quot;bug&quot; or a &quot;feature&quot; so I<br>
&gt; have never asked, I wasn&#39;t sure if it was related to how dbtext was<br>
&gt; implemented that it was simply not an option. Should it work, do you think?<br>
&gt;<br>
&gt; Also, while I&#39;m asking - do you know when someone will update the Debian<br>
&gt; repository for OpenSIPs? It&#39;s still listing 1.8.5 as the latest release, and<br>
&gt; you&#39;re now up to 1.8.7 -- and presumably any &#39;fix&#39; for me will be in a later<br>
&gt; subversion too. Is there someone I can suck up to who will push the latest<br>
&gt; packages when the time comes?<br>
&gt;<br>
&gt; My thanks again for your suggestions;<br>
&gt;<br>
&gt;  - Jock<br>
&gt;<br>
&gt; On Thu, Apr 23, 2015 at 5:23 AM, Liviu Chircu &lt;<a href="mailto:liviu@opensips.org" target="_blank">liviu@opensips.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hello Jock,<br>
&gt;&gt;<br>
&gt;&gt; I can definitely confirm that the issue is specific to &quot;db_text&quot;.<br>
&gt;&gt; Dispatcher is just storing the gateways exactly as they arrive from the<br>
&gt;&gt; generic db driver.<br>
&gt;&gt;<br>
&gt;&gt; Two solutions:<br>
&gt;&gt;     - quick-and-dirty: reverse the order of the gateways of each setid in<br>
&gt;&gt; dbtext&#39;s &quot;dispatcher&quot; file (you could even automate this!), then do<br>
&gt;&gt; &quot;opensipsctl fifo ds_reload&quot;<br>
&gt;&gt;     - slow-and-clean: submit a bug report on GitHub [1]. should be solved<br>
&gt;&gt; during the upcoming week<br>
&gt;&gt;<br>
&gt;&gt; [1]<br>
&gt;&gt; <a href="https://github.com/OpenSIPS/opensips/issues?q=is%3Aopen+is%3Aissue+label%3Abug" target="_blank">https://github.com/OpenSIPS/opensips/issues?q=is%3Aopen+is%3Aissue+label%3Abug</a><br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt;<br>
&gt;&gt; Liviu Chircu<br>
&gt;&gt; OpenSIPS Developer<br>
&gt;&gt; <a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a><br>
&gt;&gt;<br>
&gt;&gt; On <a href="tel:22.04.2015%2019" value="+12204201519" target="_blank">22.04.2015 19</a>:37, Jock McKechnie wrote:<br>
&gt;&gt;<br>
&gt;&gt; My apologies if this one has been covered before, my google fu is failing<br>
&gt;&gt; me, but we&#39;re running a pretty large load out of OpenSIPS v1.8.5 (LTS) and<br>
&gt;&gt; have struck an oddity that I don&#39;t appear to have noticed before.<br>
&gt;&gt;<br>
&gt;&gt; We&#39;re using the dispatcher module with a dbtext database  source and the<br>
&gt;&gt; order that the entries are being loaded are not in row order. I do see the<br>
&gt;&gt; dbtext documentation is clear that ORDER BY is not possible, so perhaps this<br>
&gt;&gt; is a unfixable situation with this DB back-end, but I kind of assumed that<br>
&gt;&gt; the order would always match the order in the dbtext data file itself (based<br>
&gt;&gt; on the id auto column).<br>
&gt;&gt;<br>
&gt;&gt; There are only two entries in the dispatcher table:<br>
&gt;&gt; id(int,auto) setid(int) destination(string) socket(string,null) flags(int)<br>
&gt;&gt; weight(int) attrs(string) description(string)<br>
&gt;&gt; 0:1:sip\:192.168.55.9\:5060::0:1:&#39;&#39;:&#39;handler01&#39;<br>
&gt;&gt; 1:1:sip\:192.168.55.8\:5060::0:1:&#39;&#39;:&#39;handler02&#39;<br>
&gt;&gt;<br>
&gt;&gt; When I run a &#39;ds_list&#39; (calls through the system prove it&#39;s using the<br>
&gt;&gt; order below, also):<br>
&gt;&gt; SET_NO:: 1<br>
&gt;&gt; SET:: 1<br>
&gt;&gt;          URI:: sip:192.168.55.8<br>
&gt;&gt;          URI:: sip:192.168.55.9<br>
&gt;&gt;<br>
&gt;&gt; Clearly the dbtext module is sorting, or possibly unsorting in a hash, on<br>
&gt;&gt; the destination. If I was just doing a round-robin, which normally I am,<br>
&gt;&gt; it&#39;s completely moot - but today&#39;s problem is I&#39;m trying to implement a<br>
&gt;&gt; &quot;failover&quot; (ds_select_domain(&quot;1&quot;, &quot;8&quot;)) scenario which means I need the data<br>
&gt;&gt; to remain in order.<br>
&gt;&gt;<br>
&gt;&gt; Suggestions? Hopefully other than &quot;move to a real DB&quot; as we&#39;re trying to<br>
&gt;&gt; keep this as lean as possible.<br>
&gt;&gt;<br>
&gt;&gt; My thanks for your time!<br>
&gt;&gt;<br>
&gt;&gt;  - Jock<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Users mailing list<br>
&gt;&gt; <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
&gt;&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Users mailing list<br>
&gt;&gt; <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
&gt;&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
<br>
<br>
<br>
</div></div><span><font color="#888888">--<br>
VoIP Embedded, Inc.<br>
<a href="http://www.voipembedded.com" target="_blank">http://www.voipembedded.com</a><br>
</font></span><div><div><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></div>
</div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>