Hi Daniel,

I attached a pcap trace. It contains several SIP messages, but please check the INVITEs from 10.224.74.36 (Kamailio) to 10.126.54.51/10.126.55.51.

Thanks for you support,
Cristian

On Thu, May 25, 2017 at 5:04 PM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
Hello,

can you sent pcap or ngrep output with all sip messages of such case exposing the issue you have?

Cheers,
Daniel

On Thu, May 25, 2017 at 2:18 PM, Cristi Constantin <cristi.constantin@gmail.com> wrote:
Hello,

I have an issue with the behavior of ds_select_dst() method in case of using algorithm 8 (dispatch based on priority). In case both destinations are available, they are used alternatively, instead of always using the one with the highest priority.

By searching through the mailing list I found that the lower the priority number, the higher the priority (1 is first, 2 is second, etc.).
Based on this, I set the following in dispatcher.list:
7 sip:10.126.54.51:5060;transport=sctp 9 1
7 sip:10.126.55.51:5060;transport=sctp 9 2

After running "kamcmd dispatcher.reload" and "kamcmd dispatcher.list", I have the confirmation that the priorities are correctly set:
                SET: {
                        ID: 7
                        TARGETS: {
                                DEST: {
                                        URI: sip:10.126.55.51:5060;transport=sctp
                                        FLAGS: AP
                                        PRIORITY: 2
                                }
                                DEST: {
                                        URI: sip:10.126.54.51:5060;transport=sctp
                                        FLAGS: AP
                                        PRIORITY: 1
                                }
                        }
                }

The dispatcher settings from kamailio.cfg is the following:
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "ds_ping_interval", 10)
modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_from", "sip:kamailio@sdp-t-lb2")
modparam("dispatcher", "ds_probing_mode", 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)")

And the code which should do the displatch is the following:

      if (ds_is_from_list(7, 3, "$ru")) {
          remove_hf("Route");
          if(!ds_select_dst("7", "8")) {
            send_reply("404", "No destination");
            exit;
          }
      }

With the settings above, I was expecting to always have the messages delivered to 10.126.54.51. Instead, they are dispathed to 10.126.54.51 and 10.126.55.51 alternatively.

Thanks a lot,
Cristian


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users




--

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users