<p>Greetings;</p>

<p>On OpenSIPS v1.8.5 (presumed still present in 1.8.7):</p>

<h2>Given a dbtext dispatcher database of the following:</h2>

<p>id(int,auto) setid(int) destination(string) socket(string,null) flags(int) weight(int) attrs(string) description(string)<br>
0:1:sip:192.168.55.9:5060::0:1:'':'handler01'</p>

<h2>1:1:sip:192.168.55.8:5060::0:1:'':'handler02'</h2>

<p>When the database is loaded into dispatcher the order unexpectedly gets sorted by the 'destination' field. No amount of changing the 'id' value will get the order altered from an apparent alpha sort of the 'destination' field, ala:</p>

<hr>

<p>SET_NO:: 1<br>
SET:: 1<br>
         URI:: sip:192.168.55.8</p>

<h2>         URI:: sip:192.168.55.9</h2>

<p>Using dispatcher in a 'fail over' mode requires the data to be loaded from disk in a specific order and this is not possible with this fault present, unfortunately. If it could remain sorted by the 'id' field, or the on-disk order (I'm not sure which is easiest to implement), then it can be reliably configured in the correct order to solve the issue.</p>

<p>Thank you!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/479">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciToFjvERlCI0Xn10d8G68usO5_miks5oCS2agaJpZM4EHKyR.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/479"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>