<div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>this is the fallback to the next destination in my script:</div><div><br></div><div><div>failure_route[GW_FAILOVER] {</div><div>        if (t_was_cancelled()) {</div><div>                xlog("L_INF","*** Was cancelled \n");</div><div>                exit;</div><div>        }</div><div><br></div><div>        # failure detection with redirect to next available trunk</div><div>        if (t_check_status("(408)|([56][0-9][0-9])")) {</div><div>                xlog("L_INF","Failed trunk $rd/$du->$avp(du_lb) detected \n");</div><div>                if ( lb_next() ) {</div><div>                        xlog("L_INF","Failed trunk detected, load balancer to next $rd/$du \n");</div><div>                        $avp(du_lb)=$du;</div><div>                        t_on_failure("GW_FAILOVER");</div><div>                        t_relay();</div><div>                        exit;</div><div>                }</div><div><br></div><div>                send_reply("500","All GW are down");</div><div>                xlog("L_INF","**** All GW are down \n ");</div><div>      </div><div>        }</div><div>}</div></div><div><br></div><div>Thank you very much</div><div><br></div><div>Rocío</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mar., 5 mar. 2019 a las 16:44, Bogdan-Andrei Iancu (<<a href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <tt>Hi Rocio,<br>
      <br>
      How do you script the fallback to the next destination ? I guess
      via failure route, but could you post here the exact call of
      lb_next() ? also how the initial LB triggering looks like ?<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="gmail-m_7716355977208639056moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="gmail-m_7716355977208639056moz-txt-link-freetext" href="https://www.opensips-solutions.com" target="_blank">https://www.opensips-solutions.com</a>
OpenSIPS Summit 2019
  <a class="gmail-m_7716355977208639056moz-txt-link-freetext" href="https://www.opensips.org/events/Summit-2019Amsterdam/" target="_blank">https://www.opensips.org/events/Summit-2019Amsterdam/</a>
</pre>
    <div class="gmail-m_7716355977208639056moz-cite-prefix">On 02/28/2019 09:16 AM, Rocio Walias
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">Hello,</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>
        <pre style="margin:0cm 0cm 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:11pt;font-family:Calibri,sans-serif" lang="EN-US">I need a little help regarding a load balancer issue. </span></pre>
        <pre style="margin:0cm 0cm 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:11pt;font-family:Calibri,sans-serif" lang="EN-US">I have two destinations (A.X.X.X and B.X.X.X) in the load balancer group. A.X.X.X is working fine but  sometimes B.X.X.X is not responding in time and a 408 response is received. In that case I am doing a lb_next() and load balancer send it to A.X.X.X but in “opensips fifo lb_list“ is showing that B.X.X.X load is 1 and I think it must be 0 because in A.X.X.X load is 2 and there is only 2 dialogs.</span></pre>
        <pre style="margin:0cm 0cm 0.0001pt;font-size:10pt;font-family:"Courier New""><i><span style="color:black" lang="EN-US"> </span></i></pre>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">Destination::
            <a style="color:rgb(5,99,193);text-decoration-line:underline">sip:33@A.X.X.X:5080</a> id=96
            group=1 enabled=yes
            auto-reenable=on</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">       
            Resources::</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">               
            Resource:: channel max=10 <b>load</b>=2</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">Destination::
            <a style="color:rgb(5,99,193);text-decoration-line:underline">sip:33@B.X.X.X:5080</a> id=98
            group=1 enabled=yes
            auto-reenable=on</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">       
            Resources::</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">               
            Resource:: channel max=10 <b>load=</b>1</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">I’m trying
            to remove that “load=1”  but if I use lb_count_call to undo
            :</span></p>
        <p class="MsoNormal" style="text-indent:35.4pt;margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">if (lb_is_destination(“B.X.X.X",
            "5080", "1","1"))</span></p>
        <p class="MsoNormal" style="text-indent:35.4pt;margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">{                      
                  </span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt;text-indent:35.4pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">lb_count_call("B.X.X.X","5080","1","channel","1");</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">               
            }</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">This error
            happens:</span></p>
        <p class="MsoNormal" style="text-indent:35.4pt;margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">Feb 21 13:05:18 [11033]
            ERROR:load_balancer:lb_route: sequential call of LB - failed
            to remove from
            profile [lbXchannel]->[62]</span></p>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>
        <pre style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;margin:0cm 0cm 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:11pt;font-family:Calibri,sans-serif" lang="EN-US">Is there any way to decrease the load of B.X.X.X or how can it not be considered in load count in a</span><span lang="EN-US"> </span><span style="font-size:11pt;font-family:Calibri,sans-serif" lang="EN-US">failure_route? I’m saving load data to statistics purpose  and it  doesn’t match with the number of dialogues.</span></pre>
        <pre style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;margin:0cm 0cm 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:11pt;font-family:Calibri,sans-serif" lang="EN-US">I’m using Opensips 2.4.2</span></pre>
        <pre style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;margin:0cm 0cm 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:11pt;font-family:Calibri,sans-serif" lang="EN-US"> </span></pre>
        <pre style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;margin:0cm 0cm 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:11pt;font-family:Calibri,sans-serif" lang="EN-US">Thank you very much.</span></pre>
        <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US"> </span></p>
      </div>
      <br>
      <fieldset class="gmail-m_7716355977208639056mimeAttachmentHeader"></fieldset>
      <br>
      <pre>_______________________________________________
Users mailing list
<a class="gmail-m_7716355977208639056moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="gmail-m_7716355977208639056moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div>