<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body 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("1") 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 class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a> </pre>
    <br>
    On 03/27/2012 12:12 PM, [Digital^Dude] &reg; wrote:
    <blockquote
cite="mid:CAArAGKnzUqaCHG5Smrj=ziVxoGVkELkAz4a9tPE-yjCjtGN=jg@mail.gmail.com"
      type="cite"><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("1"); in is_method("INVITE ")<br>
        <br>
        this in my failure_route:<br>
        <br>
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if
          (!do_routing("10")) {</span><br style="font-family: courier
          new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          send_reply("503", "No Rules matching the URI");</span><br
          style="font-family: courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          xlog("Do_Routing failed........\n");</span><br
          style="font-family: courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          exit;</span><br style="font-family: courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br
          style="font-family: courier new,monospace;">
        <br style="font-family: courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if
          (use_next_gw()) {</span><br style="font-family: courier
          new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          xlog("In use_next_gw\n");</span><br style="font-family:
          courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          t_relay();</span><br style="font-family: courier
          new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          exit;</span><br style="font-family: courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br
          style="font-family: courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else {</span><br
          style="font-family: courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          xlog("In else case.... \n");</span><br style="font-family:
          courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          t_reply ("503", "Service not available");</span><br
          style="font-family: courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          exit;</span><br style="font-family: courier new,monospace;">
        <span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</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'm going wrong...<br>
        <br>
        Thanks.<br>
      </font>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </body>
</html>