[Kamailio-Users] [dispatcher] configure the sending of OPTIONS pings

Pascal Maugeri pascal.maugeri at gmail.com
Mon Oct 27 11:24:17 CET 2008


Hi

I get the following unexpected behavior:

Two kamailio servers configured to handle REGISTER and OPTIONS receive a
traffic load-balanced by a third kamailio/dispatcher node. This works and
both servers are receiving equal loads of REGISTER and periodic OPTIONS.

I shutdown first kamailio gateway and I see that almost imediately all the
traffic goes to this server instead of being rerouted to the running server
?! After some seconds (eg. 10 seconds) the running gateway does not receive
anymore traffic and all the traffic is sent to the server that is shutdown.
After more than 20 seconds, the running gateway starts receiving all the
traffic.

Nevertheless, when I start again the gateway I've shutdowned, traffic is
almost immediately load-balanced again.

I'm testing the following configuration:

modparam("dispatcher", "list_file",
"/usr/local/etc/kamailio/dispatcher.list")
modparam("dispatcher", "flags", 3)
modparam("dispatcher", "dst_avp", "$avp(i:271)")
modparam("dispatcher", "grp_avp", "$avp(i:272)")
modparam("dispatcher", "cnt_avp", "$avp(i:273)")
modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_interval", 3)
modparam("dispatcher", "ds_ping_from",
"sip:fend1 at 10.132.184.33<sip%3Afend1 at 10.132.184.33>
")
modparam("dispatcher", "ds_probing_threshhold", 1)
modparam("dispatcher", "ds_probing_mode", 1)

route{
        if (is_method("REGISTER") || is_method("OPTIONS")) {
                ds_select_dst("1", "0");
                t_on_failure("1");
                t_relay();
                exit;
        }
}

failure_route[1] {

        xlog("L_INFO", "Marking GW as failed...\n");
        ds_mark_dst("p");
        ds_next_dst();
        t_on_failure("1");
        t_relay();

}


Any idea of what is wrong ?

Regards,
Pascal







On Mon, Oct 27, 2008 at 11:04 AM, Pascal Maugeri
<pascal.maugeri at gmail.com>wrote:

> Hi
>
> Thanks this is what I was testing right now :-)
> I'm also testing the "ds_probing_mode" = 1 that recommended me Klaus.
>
> I understand that the scenario you describe is that OPTIONS are sent when
> the gw is set in "probe" mode ? I have exactly the opposite behaviour here:
>
> modparam("dispatcher", "list_file",
> "/usr/local/etc/kamailio/dispatcher.list")
> modparam("dispatcher", "flags", 3)
> modparam("dispatcher", "dst_avp", "$avp(i:271)")
> modparam("dispatcher", "grp_avp", "$avp(i:272)")
> modparam("dispatcher", "cnt_avp", "$avp(i:273)")
> modparam("dispatcher", "ds_ping_method", "OPTIONS")
> modparam("dispatcher", "ds_ping_interval", 3)
> modparam("dispatcher", "ds_ping_from", "sip:fend1 at 10.132.184.33<sip%3Afend1 at 10.132.184.33>
> ")
> modparam("dispatcher", "ds_probing_threshhold", 3)
> modparam("dispatcher", "ds_probing_mode", 1)
>
> I have a simple scenario of load-balancing REGISTER and it looks to work
> somehow also when I shutdown one gateway my load-balancer takes to much time
> to detect it.
> Does the failure-route also apply to timeout error (REGISTER messages are
> not handled by the gw that is shutdown) ?
>
> Regards,
> Pascal
>
>
>
> On Mon, Oct 27, 2008 at 10:45 AM, Carsten Bock <lists at bock.info> wrote:
>
>> Hi,
>>
>> you have to add a failure-route, where you set the state to probing
>> (e.g. ds_set_state("p")). If this is set 3 times
>> (ds_probing_threshhold), the gateway will be longer selected from
>> ds_select_domain / .._dst and will be queried with an OPTIONS-request.
>> In case of a successful query, the gateway will be enabled again.
>> As long as the state is active, you will not see any OPTIONS-request.
>>
>> Carsten
>>
>> Am Freitag, den 24.10.2008, 18:08 +0200 schrieb Klaus Darilion:
>> > Maybe try
>> > http://www.kamailio.org/docs/modules/devel/dispatcher.html#id2467955
>> >
>> > klaus
>> >
>> > Pascal Maugeri schrieb:
>> > > Hi
>> > >
>> > > How do you configure dispatcher to send OPTIONS ping to load-balanced
>> > > proxies ?
>> > >
>> > > I'm using kamailio 1.4.2 with this of configuration:
>> > >
>> > > [...]
>> > > modparam("dispatcher", "ds_ping_method", "OPTIONS")
>> > > modparam("dispatcher", "ds_ping_interval", 5)
>> > > modparam("dispatcher", "ds_ping_from", "sip:fend1 at 10.132.184.33<sip%3Afend1 at 10.132.184.33>
>> > > <mailto:sip%3Afend1 at 10.132.184.33 <sip%253Afend1 at 10.132.184.33>>")
>> > > modparam("dispatcher", "ds_probing_threshhold", 3)
>> > > [...]
>> > >
>> > > The load-balancing works properly : I see the traffic being sent to my
>> > > proxies. But I don't see any SIP OPTIONS packets.
>> > >
>> > > I've read in module doc "This method is only available, if compiled
>> with
>> > > the probing of failed gateways enabled. " but I can't find how to
>> > > activate this on compilation time, so I'm not sure if I have this
>> > > feature or not enable.
>> > >
>> > > Regards,
>> > > Pascal
>> > >
>> > >
>> > >
>> > >
>> ------------------------------------------------------------------------
>> > >
>> > > _______________________________________________
>> > > Users mailing list
>> > > Users at lists.kamailio.org
>> > > http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.kamailio.org
>> > http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20081027/52722651/attachment.htm 


More information about the Users mailing list