<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>Hi Bogdan,<br><br>Will "use only the first gateway from the carrier"  allow for round-robin for the regular calls (ie. does it choose the first gw randomly ) ? <br><br>Thank you.<br><br>Alex<br><div data-zbluepencil-ignore="true" style="" class="zmail_extra"><br><div id="Zm-_Id_-Sgn1">---- On Thu, 30 Apr 2020 03:40:21 -0400 <b>Bogdan-Andrei Iancu <<a target="_blank" href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>></b> wrote ----<br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); padding-left: 6px; margin: 0px 0px 0px 5px;"><div>Hi Alex,<br> <br> Have you tried the "use only the first GW" flag in the carrier
      definition? See <a target="_blank" href="https://opensips.org/html/docs/modules/3.0.x/drouting.html#idp25339408" class="x_-838338517moz-txt-link-freetext">https://opensips.org/html/docs/modules/3.0.x/drouting.html#idp25339408</a>,
      "Carriers" subsection:<br> <br> flags : 0x1 - use weight for sorting the list and not
      definition order; 0x2 - use only the first gateway from the
      carrier (depending on the sorting); 0x4 - disable the usage of
      this carrier<br> <br> Regards,<br> <pre class="x_-838338517moz-signature">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a target="_blank" href="https://www.opensips-solutions.com" class="x_-838338517moz-txt-link-freetext">https://www.opensips-solutions.com</a>

<br></pre><div class="x_-838338517moz-cite-prefix">On 4/29/20 9:38 PM, Alex A wrote:<br></div><div><br></div><br></div><blockquote><div style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10.0pt;"><div>Hi Everyone,<br></div><div><br></div><div>Is it possible to failover to next carrier (instead next
          gateway) while using drouting? <br></div><div><br></div><div><br></div><div>I got the below to work; however currently, use_next_gw
          gets the next gateway in the list, so <br></div><div>if gwlist= #0,#3  <br></div><div><br></div><div>and one of the carriers has multiple gateway IPs, the retry
          happens many times to the same carrier: <br></div><div><br></div><div><br></div><div><div>route[droute] {<br></div><div><br></div><div>        xlog("DRoute GATEWAY: source:$si - $fU ->
            $rU\n");<br></div><div>        if (!do_routing(0,"F")) {<br></div><div>                xlog("DRoute GATEWAY: Failed. source:$si
            -$fU -> $rU\n");<br></div><div>                send_reply(500, "No Gateway to Route
            found");<br></div><div>                exit;<br></div><div>        }<br></div><div>        route(relay);<br></div><div>        exit;<br></div><div><br></div><div>        }<br></div><div><br></div></div><div>route[relay] {<br></div><div><br></div><div>        if (is_method("INVITE")) {<br></div><div>                t_on_failure("missed_call");<br></div><div>        }<br></div><div><br></div><div>        if (!t_relay()) {<br></div><div>                if (use_next_gw()) {<br></div><div>                      xlog("L_INFO","Next Gateway:
          From=$fu, To=$tu,RU=$ru, CI=$ci IP=$si\n");<br></div><div>                      t_on_failure("missed_call");<br></div><div>                      route(relay);<br></div><div>                      exit;<br></div><div>                }<br></div><div>                else {<br></div><div>                        send_reply(503, "Service not
          available, no more gws");<br></div><div>                        exit;<br></div><div>                }<br></div><div>        };<br></div><div>        exit;<br></div><div>}<br></div><div><br></div><div><br></div><div>failure_route[missed_call] {<br></div><div><br></div><div>                #if (use_next_gw(, , $var(carrier_attrs)))
          {<br></div><div>                if (use_next_gw(,
          $avp(gw_id),$avp(carrier_id))) {<br></div><div>                      xlog("MissedCall--Next Gateway:
          From=$fu, To=$tu,RU=$ru, CI=$ci IP=$si\n");<br></div><div>                      xlog("Carrier attributes of current
          gateway: $avp(gw_id). carrier: $avp(carrier_id)\n");<br></div><div><br></div><div>                      t_on_failure("missed_call");<br></div><div>                      route(relay);<br></div><div>                      exit;<br></div><div>                }<br></div><div>                else {<br></div><div>                        send_reply(503, "Service not
          available, no more gws");<br></div><div>                        exit;<br></div><div>                }<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>Thank you.<br></div><div><br></div><div><br></div><div><br></div></div><br><br><pre class="x_-838338517moz-quote-pre">_______________________________________________
Users mailing list
<a target="_blank" href="mailto:Users@lists.opensips.org" class="x_-838338517moz-txt-link-abbreviated">Users@lists.opensips.org</a>
<a target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" class="x_-838338517moz-txt-link-freetext">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
<br></pre></blockquote></blockquote></div></div><div><br></div></div><br></body></html>