[OpenSIPS-Users] dispatcher - not getting out of Pending mode

Matt Hamilton mistral9999 at hotmail.com
Fri Nov 25 14:10:47 CET 2011


Hi Vlad,

Thanks for your response. There was a problem with one of the asterisk configurations and it was replying with 404 (not found). I fixed it, the reply codes are 200 now, and everything is running fine.
However, case 3 below confuses me a little:
1. When there was no response from Asterisk (Asterisk not running), the node was set to Pending. (as expected)
2. When I started asterisk, the node still showed Pending because the reply code wasn't 200, but 404. (as expected)
3. At Opensips start, if Asterisk was running, the node was set to Active even if the reply code was 404. (?)

Anyway, the problem is gone. Thanks again.
Matt



Date: Fri, 25 Nov 2011 12:23:22 +0200
From: vladpaiu at opensips.org
To: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] dispatcher - not getting out of Pending mode



  


    
    
  
  
    Hello,

    

    What reply code doe the Asterisk replies have ? 

    If it's not 200 Ok, you might want to check out the
    options_reply_codes parameter [1] .

    

    [1]
    http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id292810

    

    Regards,

    Vlad Paiu
OpenSIPS Developer
    

    On 11/25/2011 05:12 AM, Matt Hamilton wrote:
    
      
      
        

        I'm testing dispatcher with failover (tesitng both
        probing_modes: automatic with 1, and 0 with failure_route).
        Opensips is dispatching calls to 2 Asterisk servers. If I stop
        one of the Asterisk servers, that node becomes Pending as
        expected, but when I restart the node, it doesn't turn Active
        again.

        

        Here is my test: 

        

        

        1. I start Opensips with both Asterisk nodes Active (Asterisk is
        running on both servers)

        ds_list ( opensipsctl fifo ds_list) shows both nodes Active

        

        2. I stop Asterisk in Server B

        ds_list shows 2nd node as "P" pretty much right away for mode 1,
        and after the 1st failed request comes for mode 2

        So far, everything is OK

        

        3. I start Asterisk in server B

        ds_list still shows Server B as Pending (both for mode 1 and 2);
        however, it never goes back to Active unless I restart Opensips

        

        

        If I start Opensips when one of the nodes Pending (Asterisk
        off), and later start Asterisk on that node, ds_list still
        doesn't report it Active.

        

        

        The log (debug=4) shows both nodes sending the <OPTION>
        reply, but for some reason ds_list doesn't reflect that, and
        ds_select_dst ignores the new "active" node.

        

        

        Any suggestions? I'm pretty sure I'm missing something very
        simple.

        

        

        Below is my code. 

        

        Thanks,

        Matt

        

        

        

        

###############################################################################################

        

        # gateways

        1 sip:10.0.1.128:5060

        1 sip:10.0.1.129:5060

        

        

        

###############################################################################################

        

        modparam("dispatcher",
        "list_file","/usr/local/etc/opensips/dispatcher.list")

        modparam("dispatcher", "flags", 2)   

        modparam("dispatcher", "dst_avp", "$avp(271)")

        modparam("dispatcher", "grp_avp", "$avp(272)")

        modparam("dispatcher", "cnt_avp", "$avp(273)")

        modparam("dispatcher", "hash_pvar", "$si")   

        modparam("dispatcher", "ds_ping_method", "OPTIONS")

        modparam("dispatcher", "ds_ping_interval", 1)   

        modparam("dispatcher", "ds_probing_mode", 0)     

        modparam("dispatcher", "ds_probing_threshhold", 1) 

        

        modparam("tm", "fr_timer", 3)

        

        

        

        route{

            if (!ds_is_in_list("$si", "$sp")) {      /* if it's not
        asterisk replying back to opensips  */

                t_on_failure("1");

                ds_select_dst("1", "7");   

                }

            route(1);

        }

        

        route[1] {

            if (!t_relay()) {

                sl_reply_error();

            };

            exit;

        }

        

        

        failure_route[1]{

                if (t_was_cancelled()) {

                        exit;

                }

                if (t_check_status("408")) {

                        ds_mark_dst("p");

                        

                t_on_failure("1");        

                ds_next_dst();

                route(1);

                }

        }

        

        

###############################################################################################

        

      
      
_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

    
  


_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20111125/eb9169c5/attachment.htm>


More information about the Users mailing list