<p dir="ltr"><br>
On Sep 21, 2015 1:38 PM, "Daniel-Constantin Mierla" <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> you have to set the priority field to get them ordered as desired.<br>
><br>
> With text file is easier to know (or better said expect) the order as it is written, but for database, there is no guarantee that if you insert three destinations, will be returned in the order of inserting. Therefore, the loading of destinations is not caring of the order retrieved from the storage, will use priority to sort them.</p>
<p dir="ltr">Thank you Daniel !<br></p>
<p dir="ltr">><br>
> Cheers,<br>
> Daniel<br>
><br>
><br>
> On 21/09/15 13:13, Giovanni Maruzzelli wrote:<br>
>><br>
>> Anyone got this one ?<br>
>><br>
>> sent from my mobile,<br>
>> Giovanni Maruzzelli<br>
>> cell: +39 347 266 56 18<br>
>><br>
>> On Sep 19, 2015 7:58 PM, "Giovanni Maruzzelli" <<a href="mailto:gmaruzz@gmail.com">gmaruzz@gmail.com</a>> wrote:<br>
>>><br>
>>> Hello,<br>
>>><br>
>>> dispatcher gives me destination sets with entries in reverse order:<br>
>>><br>
>>> I have installed from Kamailio deb repository packages version 4.3.2+jessie.<br>
>>><br>
>>> # kamailio -V<br>
>>> version: kamailio 4.3.2 (x86_64/linux) <br>
>>> 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<br>
>>> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
>>> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
>>> id: unknown <br>
>>> compiled with gcc 4.9.2<br>
>>><br>
>>> I configured dispatcher:<br>
>>><br>
>>> modparam("dispatcher", "use_default", 1)<br>
>>> modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")<br>
>>> modparam("dispatcher", "flags", 3)<br>
>>> modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")<br>
>>> modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")<br>
>>> modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")<br>
>>> modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")<br>
>>> modparam("dispatcher", "ds_ping_interval", 5)<br>
>>> modparam("dispatcher", "ds_probing_mode", 1)<br>
>>><br>
>>> I have this dispatcher.list:<br>
>>><br>
>>> 1 sip:<a href="http://192.168.1.144:5060">192.168.1.144:5060</a> 2<br>
>>> 1 sip:<a href="http://192.168.1.145:5060">192.168.1.145:5060</a> 2<br>
>>> 1 sip:<a href="http://192.168.1.146:5060">192.168.1.146:5060</a> 2<br>
>>><br>
>>> 2 sip:<a href="http://192.168.1.146:5060">192.168.1.146:5060</a> 2<br>
>>> 2 sip:<a href="http://192.168.1.145:5060">192.168.1.145:5060</a> 2<br>
>>><br>
>>> So, I expect dispatcher to have:<br>
>>><br>
>>> set 1 first two destinations in distribution via hash on callid, and third destination as failover (192.168.1.146) .<br>
>>> set 2 all traffic on first destination, and if first fails, all traffic will failover to second destination (192.168.1.145).<br>
>>><br>
>>> Instead reindex_dests shuffle the sets upside down:<br>
>>><br>
>>> DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [1/1] <sip:<a href="http://192.168.1.144:5060">192.168.1.144:5060</a>><br>
>>> DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [1/2] <sip:<a href="http://192.168.1.145:5060">192.168.1.145:5060</a>><br>
>>> DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [1/3] <sip:<a href="http://192.168.1.146:5060">192.168.1.146:5060</a>><br>
>>> DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [2/1] <sip:<a href="http://192.168.1.146:5060">192.168.1.146:5060</a>><br>
>>> DEBUG: dispatcher [dispatch.c:375]: add_dest2list(): dest [2/2] <sip:<a href="http://192.168.1.145:5060">192.168.1.145:5060</a>><br>
>>> DEBUG: dispatcher [dispatch.c:494]: reindex_dests(): found [2] dest sets<br>
>>> DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 2 sip:<a href="http://192.168.1.145:5060">192.168.1.145:5060</a> 2 0 (,0,0)<br>
>>> DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 2 sip:<a href="http://192.168.1.146:5060">192.168.1.146:5060</a> 2 0 (,0,0)<br>
>>> DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 1 sip:<a href="http://192.168.1.146:5060">192.168.1.146:5060</a> 2 0 (,0,0)<br>
>>> DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 1 sip:<a href="http://192.168.1.145:5060">192.168.1.145:5060</a> 2 0 (,0,0)<br>
>>> DEBUG: dispatcher [dispatch.c:139]: ds_print_sets(): dst>> 1 sip:<a href="http://192.168.1.144:5060">192.168.1.144:5060</a> 2 0 (,0,0)<br>
>>> DEBUG: dispatcher [dispatcher.c:347]: mod_init(): loaded dispatching list<br>
>>><br>
>>> 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.<br>
>>><br>
>>> Is this the expected behavior? <br>
>>> Am I doing something wrong in configuration?<br>
>>><br>
>>> Thank you all in advance,<br>
>>><br>
>>> -giovanni<br>
>>><br>
>>><br>
>>> Sincerely,<br>
>>><br>
>>> Giovanni Maruzzelli<br>
>>> Cell : +39-347-2665618<br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
>> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
><br>
> -- <br>
> Daniel-Constantin Mierla<br>
> <a href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><br>
> Book: SIP Routing With Kamailio - <a href="http://www.asipto.com">http://www.asipto.com</a><br>
> Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a href="http://asipto.com/u/kat">http://asipto.com/u/kat</a><br>
><br>
><br>
> _______________________________________________<br>
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
</p>