<font face="trebuchet ms,sans-serif">I see. Thanks. Is this the only way of accomplishing load_balanced failover with opensips?<br></font><br><div class="gmail_quote">On Tue, Mar 27, 2012 at 2:20 PM, Vlad Paiu <span dir="ltr">&lt;<a href="mailto:vladpaiu@opensips.org">vladpaiu@opensips.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

  
    
    
  
  <div bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    In failure_route, there is no need to call again do_routing() if you
    want to route the call based on the same gw list matched the first
    time in request route. It is enough to just call use_next_gw() until
    it fails. <br>
    Also, make sure to call t_on_failure(&quot;1&quot;) even in failure_route() ,
    so you can keep repeating the same process of choosing the next GW,
    in case more than one of your GWs fail.<br>
    <br>
    Regards,<br>
    <br>
    <pre cols="72">Vlad Paiu
OpenSIPS Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a> </pre><div><div></div><div class="h5">
    <br>
    On 03/27/2012 12:12 PM, [Digital^Dude] ® wrote:
    </div></div><blockquote type="cite"><div><div></div><div class="h5"><font face="trebuchet ms,sans-serif">How do I get a
        load balanced setup with failover (through drouting)..?<br>
        1. I have set up my routing logic in the main routing block. <br>
        2. Have set t_on_failure(&quot;1&quot;); in is_method(&quot;INVITE &quot;)<br>
        <br>
        this in my failure_route:<br>
        <br>
        <span style="font-family:courier new,monospace">        if
          (!do_routing(&quot;10&quot;)) {</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">               
          send_reply(&quot;503&quot;, &quot;No Rules matching the URI&quot;);</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">               
          xlog(&quot;Do_Routing failed........\n&quot;);</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">               
          exit;</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">        }</span><br style="font-family:courier new,monospace">
        <br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">        if
          (use_next_gw()) {</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">               
          xlog(&quot;In use_next_gw\n&quot;);</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">               
          t_relay();</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">               
          exit;</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">        }</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">        else {</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">               
          xlog(&quot;In else case.... \n&quot;);</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">               
          t_reply (&quot;503&quot;, &quot;Service not available&quot;);</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">               
          exit;</span><br style="font-family:courier new,monospace">
        <span style="font-family:courier new,monospace">        }</span><br style="font-family:courier new,monospace">
        But it only redirects the first few calls, as soon as the
        dr_status becomes enable=&gt;no. I start getting 503...<br>
        Please point out where I&#39;m going wrong...<br>
        <br>
        Thanks.<br>
      </font>
      </div></div><pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </div>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br>