[OpenSIPS-Users] Dispatcher/dbtext load order incorrect

Jock McKechnie jock.mckechnie at gmail.com
Wed Apr 22 18:37:26 CEST 2015


My apologies if this one has been covered before, my google fu is failing
me, but we're running a pretty large load out of OpenSIPS v1.8.5 (LTS) and
have struck an oddity that I don't appear to have noticed before.

We're using the dispatcher module with a dbtext database  source and the
order that the entries are being loaded are not in row order. I do see the
dbtext documentation is clear that ORDER BY is not possible, so perhaps
this is a unfixable situation with this DB back-end, but I kind of assumed
that the order would always match the order in the dbtext data file itself
(based on the id auto column).

There are only two entries in the dispatcher table:
id(int,auto) setid(int) destination(string) socket(string,null) flags(int)
weight(int) attrs(string) description(string)
0:1:sip\:192.168.55.9\:5060::0:1:'':'handler01'
1:1:sip\:192.168.55.8\:5060::0:1:'':'handler02'

When I run a 'ds_list' (calls through the system prove it's using the order
below, also):
SET_NO:: 1
SET:: 1
         URI:: sip:192.168.55.8
         URI:: sip:192.168.55.9

Clearly the dbtext module is sorting, or possibly unsorting in a hash, on
the destination. If I was just doing a round-robin, which normally I am,
it's completely moot - but today's problem is I'm trying to implement a
"failover" (ds_select_domain("1", "8")) scenario which means I need the
data to remain in order.

Suggestions? Hopefully other than "move to a real DB" as we're trying to
keep this as lean as possible.

My thanks for your time!

 - Jock
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150422/9a380b30/attachment.htm>


More information about the Users mailing list