[OpenSIPS-Users] Dispatcher Order SQL DB - version 1.11.5

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Aug 17 10:56:01 CEST 2015

Hi Federico,

This is an known issue with the older versions of OpenSIPS (not being 
able set an order for the records). In 2.1 this was solved by having a 
priority column which dictates the oder of usage of records.

For versions before 2.1, you have to rely on the oder provided by DB :(.


Bogdan-Andrei Iancu
OpenSIPS Founder and Developer

On 14.08.2015 20:49, Federico Edorna wrote:
> Hello Guys,
> I'm using dispatcher module with postgres database. The ds_select_dst 
> function in the script file is used like this:
> ds_select_dst("$(var(ds_set){s.int <http://s.int/>})","8");
> that is, using "8" algorithm (first entry in set is chosen) because I 
> need to use always the same destination in the set while it is up. If 
> not, then the backup destination (next in the set) is used.
> The problem I've found is that when the sets are read from database 
> (opensips restart or fifo ds_reload), the select hasn't a "order" 
> directive  in the sql statement, so the order is defined depending of 
> the last tuple update. The postgres log shows this when doing a fifo 
> ds_reload:
> 2015-08-14 11:36:53 ART [23684]: [1-1] LOG:  duration: 0.582 ms 
>  statement: select setid,destination,socket,state,weight,attrs from 
> sbc.dispatcher
> And the syslog & debug=6 shows:
> DBG:db_postgres:db_postgres_submit_query: 0x7f4344987010 
> PQsendQuery(select setid,destination,socket,state,weight,attrs from 
> sbc.dispatcher )
> So, any sql update in any column will change the order in the set 
> because we don't have the "order by priority" for example.
> Is there any way to use the weight, priority or the id to have a fixed 
> order in the set(s) destination?
> Many Thanks!
> Federico
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150817/d31a5159/attachment.htm>

More information about the Users mailing list