[OpenSIPS-Users] dispatcher not doing fail over itself

Satish Patel satish.txt at gmail.com
Tue Sep 16 19:36:10 CEST 2014


Here is the result of debug, It is saying "ds_mark_dst: mode [2] grp [1]
dst [sip:xxx.xxx.xxx.xxx:5071]"   but not doing it, i can still see status
is "Active"

One more thing let me tell you, I am running both FS1 and FS2 on same box
to testing dispatcher so they are running on 5061 and 5071, it shouldn't be
a problem right?

PARTITION:: default
        SET:: 1
                URI:: sip:example.com:5061 state=Active
                URI:: sip:example.com:5071 state=Active


Sep 16 22:59:13 Opensips_Server ../sbin/opensips[32272]: non loose-route
section
Sep 16 22:59:19 Opensips_Server ../sbin/opensips[32272]: Sending call to
===> Freeswitch
Sep 16 22:59:19 Opensips_Server ../sbin/opensips[32272]: dispatcher:
Attempting to dispatch call to sip:182.xx.xxx.xxx:5071
Sep 16 22:59:19 Opensips_Server ../sbin/opensips[32272]: X-customer:
2002 at sip.example.com
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]: Inside dispatcher
failure route
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
DBG:dispatcher:ds_set_state: no event sent
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
DBG:dispatcher:ds_mark_dst: mode [2] grp [1] dst [sip:xxx.xxx.xxx.xxx:5071]
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
INFO:avpops:ops_print_avp: p=0x7f4e447c65d0, flags=0x0000
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
INFO:avpops:ops_print_avp: #011#011#011name=<i:274>
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
INFO:avpops:ops_print_avp: #011#011#011id=<10>
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
INFO:avpops:ops_print_avp: #011#011#011val_int=<1>
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
INFO:avpops:ops_print_avp: p=0x7f4e447d7310, flags=0x0000
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
INFO:avpops:ops_print_avp: #011#011#011name=<i:273>
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
INFO:avpops:ops_print_avp: #011#011#011id=<9>
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
INFO:avpops:ops_print_avp: #011#011#011val_int=<1>
Sep 16 22:59:24 Opensips_Server ../sbin/opensips[32274]:
R-DISPATCHER-ROLLOVER:LhjAoH_IlGtwfeceul5JjA..-S No more gateways in route
set

On Tue, Sep 16, 2014 at 12:23 PM, Bogdan-Andrei Iancu <bogdan at opensips.org>
wrote:

>  Hi,
>
> Use debug=4 when doing the ds_next_dst() - see the setdebug() function :
>     http://www.opensips.org/Documentation/Script-CoreFunctions-1-11#toc47
>
> Also try an avp_print() after ds_select_dst() to see what data is kept
> into transaction.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
> On 16.09.2014 18:18, Satish Patel wrote:
>
> Thanks for point out but still its not working, does my flags looks good?
> "F" or do i need something else?  If i manually shutdown FS1 then it is
> going inside failure route and saying "No more gateways in route set" but i
> have FS2 active state and if i call again next call works..  do i need to
> set some like ( !ds_select_dst("1", "4", "F"))  in failure_route ?
>
> route[to_dispatcher] {
>         # Dispatch to FS
>         if ( !ds_select_dst("1", "4", "F")) {
>                 send_reply("500","Unable to dispatch call to Freeswitch");
>                 exit;
> ...
> ...
>
>
> failure_route[dispatcher_rollover] {
>         xlog("Inside dispatcher failure route\n");
>         if (t_was_cancelled()) {
>                 exit;
>         }
>
>         ds_mark_dst("p");
>         if(!ds_next_dst()) {
>                 xlog("L_ERR", "R-DISPATCHER-ROLLOVER:$ci No more gateways
> in route set\n");
>                 t_reply("503", "Out of gateways");
>                 exit;
>         }
>
>         xlog("L_INFO", "R-DISPATCHER-ROLLOVER:$ci Attempting relay to new
> gateway: $rd:$rp\n");
>         t_on_failure("dispatcher_rollover");
>         t_relay();
>
>
> On Tue, Sep 16, 2014 at 3:16 AM, Bogdan-Andrei Iancu <bogdan at opensips.org>
> wrote:
>
>>  Hi,
>>
>> your logic in failure route is broken - do the "ds_mark_dst" before
>> selecting a new destination via "ds_next_dst". Firs mark the used one as
>> probing and then use the next one.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>
>>  On 16.09.2014 07:59, Satish Patel wrote:
>>
>>   following is my config,  I have two Freeswitch, if i stop one of
>> freeswitch and call it won't failover itself. but if again i call if send
>> call to other FS and if again i call it send to failed one but not auto
>> failover..
>>
>>  But after my prob detect it is dead then it change status from Active to
>> Probing but that detection time is (10 to 30 second around), mean time it
>> should failover call to other freeswitch right?  we have 1000 call per
>> second and 10/30 second if big :(
>>
>> #### Dispatcher
>> loadmodule "dispatcher.so"
>> modparam("dispatcher", "dst_avp", "$avp(i:271)")
>> modparam("dispatcher", "attrs_avp", "$avp(i:272)")
>> modparam("dispatcher", "grp_avp", "$avp(i:273)")
>> modparam("dispatcher", "cnt_avp", "$avp(i:274)")
>> modparam("dispatcher", "ds_ping_interval", 5)
>> modparam("dispatcher", "ds_probing_threshhold", 10)
>> modparam("dispatcher", "ds_probing_mode", 1)
>> modparam("dispatcher", "options_reply_codes", "501, 403, 200")
>> modparam("dispatcher", "db_url", "mysql://opensips:opensipsrw@localhost
>> /opensips")
>>
>>
>> route[to_dispatcher] {
>>         # Dispatch to FS
>>         if ( !ds_select_dst("1", "4", "F")) {
>>                 send_reply("500","Unable to dispatch call to Freeswitch");
>>                 exit;
>>         } else {
>>         xlog("L_WARN", "dispatcher: Attempting to dispatch call to
>> $du\n");
>>         }
>>         t_on_failure("dispatcher_rollover");
>>         route(relay);
>> }
>>
>> failure_route[dispatcher_rollover] {
>>         xlog("Inside dispatcher failure route\n");
>>         if (t_was_cancelled()) {
>>                 exit;
>>         }
>>
>>         if(!ds_next_dst()) {
>>                 xlog("L_ERR", "R-DISPATCHER-ROLLOVER:$ci No more gateways
>> in route set\n");
>>                 t_reply("503", "Out of gateways");
>>                 exit;
>>         }
>>         ds_mark_dst("p");
>>         xlog("L_INFO", "R-DISPATCHER-ROLLOVER:$ci Attempting relay to new
>> gateway: $rd:$rp\n");
>>         t_on_failure("dispatcher_rollover");
>>         route(relay);
>> }
>>
>>
>>
>>  _______________________________________________
>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140916/0375de71/attachment-0001.htm>


More information about the Users mailing list