Issue with Dispatcher Failover algorithm

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with Dispatcher Failover algorithm

Cristi Constantin
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
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Dispatcher Failover algorithm

Daniel-Constantin Mierla-6
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 <[hidden email]> 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
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users




--

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Dispatcher Failover algorithm

Cristi Constantin
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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users




--

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



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

dispatch_with_failover_algorithm.pcap (462K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Dispatcher Failover algorithm

Cristi Constantin
Hi Daniel,

Did you got the chance to look at the trace attached?
I still not managed to figure out why failover is not working in my Kamailio configuration.. 

Thank you,
Cristian

On Thu, May 25, 2017 at 5:17 PM, Cristi Constantin <[hidden email]> wrote:
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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users




--

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




_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Dispatcher Failover algorithm

Daniel-Constantin Mierla-6

Hello,

I was traveling during the past two weeks and didn't have the time to look properly at it. Hopefully today or tomorrow I will get to it.

Cheers,
Daniel


On 29.05.17 23:14, Cristi Constantin wrote:
Hi Daniel,

Did you got the chance to look at the trace attached?
I still not managed to figure out why failover is not working in my Kamailio configuration.. 

Thank you,
Cristian

On Thu, May 25, 2017 at 5:17 PM, Cristi Constantin <[hidden email]> wrote:
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 <[hidden email]> 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 <[hidden email]> 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", <a class="moz-txt-link-rfc2396E" href="sip:kamailio@sdp-t-lb2">"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
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users




--

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





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

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Dispatcher Failover algorithm

Cristi Constantin
That's great. Thanks a lot.

Best regards,
Cristian

On 5/30/17, Daniel-Constantin Mierla <[hidden email]> wrote:

> Hello,
>
> I was traveling during the past two weeks and didn't have the time to
> look properly at it. Hopefully today or tomorrow I will get to it.
>
> Cheers,
> Daniel
>
>
> On 29.05.17 23:14, Cristi Constantin wrote:
>> Hi Daniel,
>>
>> Did you got the chance to look at the trace attached?
>> I still not managed to figure out why failover is not working in my
>> Kamailio configuration..
>>
>> Thank you,
>> Cristian
>>
>> On Thu, May 25, 2017 at 5:17 PM, Cristi Constantin
>> <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>     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 <http://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
>>     <[hidden email] <mailto:[hidden email]>> 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
>>         <[hidden email]
>>         <mailto:[hidden email]>> 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
>>             <http://10.126.54.51:5060>;transport=sctp 9 1
>>             7 sip:10.126.55.51:5060
>>             <http://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
>>             <http://10.126.55.51:5060>;transport=sctp
>>                                                     FLAGS: AP
>>                                                     PRIORITY: 2
>>                                             }
>>                                             DEST: {
>>                                                     URI:
>>             sip:10.126.54.51:5060
>>             <http://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
>>             [hidden email]
>>             <mailto:[hidden email]>
>>             https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>>
>>
>>
>>
>>         --
>>         Daniel-Constantin Mierla - http://www.asipto.com
>>         http://twitter.com/#!/miconda
>>         <http://twitter.com/#%21/miconda> -
>>         http://www.linkedin.com/in/miconda
>>         <http://www.linkedin.com/in/miconda>
>>
>>         _______________________________________________
>>         Kamailio (SER) - Users Mailing List
>>         [hidden email] <mailto:[hidden email]>
>>         https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>         <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> [hidden email]
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
>
>

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Dispatcher Failover algorithm

Daniel-Constantin Mierla-6
I looked at the code and all seems ok there -- the first destination is
selected to be used first.

Can you print $(avp(AVP_DST)[*]) after ds_select_dst(...)? Like:

xlog("selected destinations: $(avp(AVP_DST)[*])\n");

Send the log message after doing three test calls.

Cheers,
Daniel


On 30.05.17 13:18, Cristi Constantin wrote:

> That's great. Thanks a lot.
>
> Best regards,
> Cristian
>
> On 5/30/17, Daniel-Constantin Mierla <[hidden email]> wrote:
>> Hello,
>>
>> I was traveling during the past two weeks and didn't have the time to
>> look properly at it. Hopefully today or tomorrow I will get to it.
>>
>> Cheers,
>> Daniel
>>
>>
>> On 29.05.17 23:14, Cristi Constantin wrote:
>>> Hi Daniel,
>>>
>>> Did you got the chance to look at the trace attached?
>>> I still not managed to figure out why failover is not working in my
>>> Kamailio configuration..
>>>
>>> Thank you,
>>> Cristian
>>>
>>> On Thu, May 25, 2017 at 5:17 PM, Cristi Constantin
>>> <[hidden email] <mailto:[hidden email]>> wrote:
>>>
>>>     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 <http://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
>>>     <[hidden email] <mailto:[hidden email]>> 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
>>>         <[hidden email]
>>>         <mailto:[hidden email]>> 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
>>>             <http://10.126.54.51:5060>;transport=sctp 9 1
>>>             7 sip:10.126.55.51:5060
>>>             <http://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
>>>             <http://10.126.55.51:5060>;transport=sctp
>>>                                                     FLAGS: AP
>>>                                                     PRIORITY: 2
>>>                                             }
>>>                                             DEST: {
>>>                                                     URI:
>>>             sip:10.126.54.51:5060
>>>             <http://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
>>>             [hidden email]
>>>             <mailto:[hidden email]>
>>>             https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>> <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>>>
>>>
>>>
>>>
>>>         --
>>>         Daniel-Constantin Mierla - http://www.asipto.com
>>>         http://twitter.com/#!/miconda
>>>         <http://twitter.com/#%21/miconda> -
>>>         http://www.linkedin.com/in/miconda
>>>         <http://www.linkedin.com/in/miconda>
>>>
>>>         _______________________________________________
>>>         Kamailio (SER) - Users Mailing List
>>>         [hidden email] <mailto:[hidden email]>
>>>         https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>         <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Kamailio (SER) - Users Mailing List
>>> [hidden email]
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> --
>> Daniel-Constantin Mierla
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
>> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
>>
>>

--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Dispatcher Failover algorithm

Sebastian Damm-2
In reply to this post by Cristi Constantin
Hi,

On Thu, May 25, 2017 at 2:18 PM, Cristi Constantin
<[hidden email]> wrote:
>       if (ds_is_from_list(7, 3, "$ru")) {
>           remove_hf("Route");
>           if(!ds_select_dst("7", "8")) {
>             send_reply("404", "No destination");
>             exit;
>           }
>       }

I might be off, but what exactly is this line good for?

>       if (ds_is_from_list(7, 3, "$ru")) {

As I understand the documentation, you are checking whether the
request URI of your packet is in the dispatcher set for group 7. But
unless you modify $ru somewhere above this snippet to match one of the
entries of your dispatcher set 7, this if statement should never
evaluate to "true", so the ds_select_dst("7", "8") is never evaluated.

Maybe your call gets dispatched by some other part of your main route?

Regards,
Sebastian

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

newbie here

Luís Torres
In reply to this post by Daniel-Constantin Mierla-6

Hello all,

 

just recently discover Kamailio and trying to improve my asterisk boxes with it. Just want a simple thing to start:

 

- load balancing 

- distributed states ( for bliking lamps only )

 

can you guys point me some directions where to start?

 

thank you

 


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie here

Antony Stone-2
On Thursday 01 June 2017 16:45:15 Luís Torres wrote:

> Hello all,
>
> just recently discover Kamailio and trying to improve
> my asterisk boxes with it. Just want a simple thing to start:
>
> - load balancing

Um, load balancing what?

SIP registrations?
Dial plan / call setup?
Audio / call flow?

> - distributed states ( for bliking lamps only )

Which version of Asterisk are you starting from?


Antony.

--
Just when you think you're done, a cat floats by with buttered toast strapped
to its back.

 - Steve Krug, "Don't make me think"

                                                   Please reply to the list;
                                                         please *don't* CC me.


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie here

Luís Torres

Hi Antony,

 

For begining is only to balance the Sip Regs between the two Asterisk 13.14.0 boxes cause Im sharing the diaplan through dundi. But I want to have BLF between the phones random registered .

 

thank you

 

Em 2017-06-01 16:50, Antony Stone escreveu:

On Thursday 01 June 2017 16:45:15 Luís Torres wrote:
Hello all, just recently discover Kamailio and trying to improve my asterisk boxes with it. Just want a simple thing to start: - load balancing
Um, load balancing what?

SIP registrations?
Dial plan / call setup?
Audio / call flow?
- distributed states ( for bliking lamps only )
Which version of Asterisk are you starting from?


Antony.

 

 

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie here

Stefan Mititelu-2
For begining is only to balance the Sip Regs between the two Asterisk 13.14.0 boxes


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie here

Luís Torres

Thanks :) manage to put it loadbalancing

 

And presence server to share phone states like BLF, is it possible?

 

 

Em 2017-06-01 19:40, Mititelu Stefan escreveu:

For begining is only to balance the Sip Regs between the two Asterisk 13.14.0 boxes
 
 

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

 

 

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie here

Daniel-Constantin Mierla-6

Hello,

look at presence_dialoginfo and pua_dialoginfo modules.

Cheers,
Daniel


On 05.06.17 16:04, Luís Torres wrote:

Thanks :) manage to put it loadbalancing

 

And presence server to share phone states like BLF, is it possible?

 

 

Em 2017-06-01 19:40, Mititelu Stefan escreveu:

For begining is only to balance the Sip Regs between the two Asterisk 13.14.0 boxes
 
 

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

 

 


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

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Dispatcher Failover algorithm

Cristi Constantin
In reply to this post by Sebastian Damm-2
Hello Sebastian, Daniel,

Please excuse me for the late response, I had few days off.

You are right, Sebastian. After adding several log messages, I figured out the messages were dispatched in other part of the routing code. 
The problem is fixed now and the dispatcher failover mechanism is working as expected. 

Thank you very much,
Cristian

On Wed, May 31, 2017 at 5:20 PM, Sebastian Damm <[hidden email]> wrote:
Hi,

On Thu, May 25, 2017 at 2:18 PM, Cristi Constantin
<[hidden email]> wrote:
>       if (ds_is_from_list(7, 3, "$ru")) {
>           remove_hf("Route");
>           if(!ds_select_dst("7", "8")) {
>             send_reply("404", "No destination");
>             exit;
>           }
>       }

I might be off, but what exactly is this line good for?

>       if (ds_is_from_list(7, 3, "$ru")) {

As I understand the documentation, you are checking whether the
request URI of your packet is in the dispatcher set for group 7. But
unless you modify $ru somewhere above this snippet to match one of the
entries of your dispatcher set 7, this if statement should never
evaluate to "true", so the ds_select_dst("7", "8") is never evaluated.

Maybe your call gets dispatched by some other part of your main route?

Regards,
Sebastian

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


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Dispatcher Failover algorithm

Daniel-Constantin Mierla-6

Hello,

ok, good that it was sorted out and nothing broken inside dispatcher module...

Cheers,
Daniel


On 07.06.17 07:50, Cristi Constantin wrote:
Hello Sebastian, Daniel,

Please excuse me for the late response, I had few days off.

You are right, Sebastian. After adding several log messages, I figured out the messages were dispatched in other part of the routing code. 
The problem is fixed now and the dispatcher failover mechanism is working as expected. 

Thank you very much,
Cristian

On Wed, May 31, 2017 at 5:20 PM, Sebastian Damm <[hidden email]> wrote:
Hi,

On Thu, May 25, 2017 at 2:18 PM, Cristi Constantin
<[hidden email]> wrote:
>       if (ds_is_from_list(7, 3, "$ru")) {
>           remove_hf("Route");
>           if(!ds_select_dst("7", "8")) {
>             send_reply("404", "No destination");
>             exit;
>           }
>       }

I might be off, but what exactly is this line good for?

>       if (ds_is_from_list(7, 3, "$ru")) {

As I understand the documentation, you are checking whether the
request URI of your packet is in the dispatcher set for group 7. But
unless you modify $ru somewhere above this snippet to match one of the
entries of your dispatcher set 7, this if statement should never
evaluate to "true", so the ds_select_dst("7", "8") is never evaluated.

Maybe your call gets dispatched by some other part of your main route?

Regards,
Sebastian

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



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

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

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