[SR-Users] dispatcher.list reversed by dispatch.c reindex_dests()
Giovanni Maruzzelli
gmaruzz at gmail.com
Sat Sep 19 19:58:33 CEST 2015
Hello,
dispatcher gives me destination sets with entries in reverse order:
I have installed from Kamailio deb repository packages version 4.3.2+jessie.
# kamailio -V
version: kamailio 4.3.2 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
F_MALLOC, DBG_F_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 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 4.9.2
I configured dispatcher:
modparam("dispatcher", "use_default", 1)
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
modparam("dispatcher", "flags", 3)
modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")
modparam("dispatcher", "ds_ping_interval", 5)
modparam("dispatcher", "ds_probing_mode", 1)
I have this dispatcher.list:
1 sip:192.168.1.144:5060 2
1 sip:192.168.1.145:5060 2
1 sip:192.168.1.146:5060 2
2 sip:192.168.1.146:5060 2
2 sip:192.168.1.145:5060 2
So, I expect dispatcher to have:
set 1 first two destinations in distribution via hash on callid, and third
destination as failover (192.168.1.146 <http://192.168.1.146:5060>) .
set 2 all traffic on first destination, and if first fails, all traffic
will failover to second destination (192.168.1.145
<http://192.168.1.146:5060>).
Instead reindex_dests shuffle the sets upside down:
DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [1/1] <sip:
192.168.1.144:5060>
DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [1/2] <sip:
192.168.1.145:5060>
DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [1/3] <sip:
192.168.1.146:5060>
DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [2/1] <sip:
192.168.1.146:5060>
DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [2/2] <sip:
192.168.1.145:5060>
DEBUG: dispatcher [dispatch.c:494]: reindex_dests(): found [2] dest sets
DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 2 sip:
192.168.1.145:5060 2 0 (,0,0)
DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 2 sip:
192.168.1.146:5060 2 0 (,0,0)
DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 1 sip:
192.168.1.146:5060 2 0 (,0,0)
DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 1 sip:
192.168.1.145:5060 2 0 (,0,0)
DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 1 sip:
192.168.1.144:5060 2 0 (,0,0)
DEBUG: dispatcher [dispatcher.c:347]: mod_init(): loaded dispatching list
So, Kamailio give me set 1 and set 2 as per post-reindex_dests, and
failover is 192.168.1.144 for set 1, and 192.168.1.146 for set 2.
Is this the expected behavior?
Am I doing something wrong in configuration?
Thank you all in advance,
-giovanni
Sincerely,
Giovanni Maruzzelli
Cell : +39-347-2665618
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150919/c87ec6b8/attachment.html>
More information about the sr-users
mailing list