[SR-Users] Dispatcher and round-robin ignoring priorities?

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 19 15:22:04 CET 2012


Hello,

priority is used to sort the destination addresses list at startup (at 
load time). It has impact on which will be the first time used address 
in round-robin selection.

You should be able to achieve what you want by chaining dispatching over 
two groups of addresses, first round-robin over the group with 'higher 
priority from your point of view', then do to the second if none from 
first group routes it.

Cheers,
Daniel

On 3/19/12 2:23 PM, Øyvind Kolbu wrote:
> Our PSTN provider has three servers. Two of them are located in our town,
> and we prefer them, and the last one much further away. We can use them
> interchangeably.
>
>  From our dispatcher file:
>
>      # 10: PSTN
>      10 sip:preferred1.example.com:7476 0 5
>      10 sip:preferred2.example.com:7476 0 5
>      10 sip:third.example.com:7476 0 4
>
> In our dispatch router we use 'ds_select_dst("10","4")'. Then the
> round-robin algorithm evenly distributes the load on all three of them,
> instead of round robin on the ones with priority 5 and fallbacking to
> priority 4. Is the unconditional round robin as excepted?
>
> When changing the selection algorithm to "8", «use first destination», the
> dispatcher module correctly uses first "preferred2", then "preferred1" and
> then lastly "third".
>
> Why «first destination» is not the first one listed in the dispatcher file
> has always puzzled me..
>
> # kamailio -V
> version: kamailio 3.2.1 (i386/linux) 31c991
> flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
> DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
> USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
> MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> id: 31c991
> compiled on 08:08:06 Dec  6 2011 with gcc 4.1.2
>

-- 
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
http://www.asipto.com/index.php/kamailio-advanced-training/




More information about the sr-users mailing list