<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<font face="monospace">Hi Ben, David,<br>
<br>
Yes, by default the module can use either the first-only GW,
either all the GWs from a carrier definition. But it cannot do the
first 2. Still, as Ben said, you can implement your logic at
script level - loop on "use_next_gw" until the carrier ID changes,
so you can skip the GWs after the first two.<br>
<br>
Best regards,<br>
</font>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS Summit 27-30 Sept 2022, Athens
<a class="moz-txt-link-freetext" href="https://www.opensips.org/events/Summit-2022Athens/">https://www.opensips.org/events/Summit-2022Athens/</a></pre>
<div class="moz-cite-prefix">On 9/6/22 7:35 PM, Ben Newlin wrote:<br>
</div>
<blockquote type="cite"
cite="mid:BN0PR10MB5208325647E8E246C62B0355957E9@BN0PR10MB5208.namprd10.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<style>@font-face
{font-family:Helvetica;
panose-1:0 0 0 0 0 0 0 0 0 0;}@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 11 6 4 2 2 2 2 2 4;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Sorry,
forgot the link for my reference.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">[1] - <a
href="https://opensips.org/docs/modules/2.4.x/drouting.html#param_carrier_id_avp"
moz-do-not-send="true">
https://opensips.org/docs/modules/2.4.x/drouting.html#param_carrier_id_avp</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Ben
Newlin </span>
<span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Users
<a class="moz-txt-link-rfc2396E" href="mailto:users-bounces@lists.opensips.org"><users-bounces@lists.opensips.org></a> on behalf of Ben
Newlin <a class="moz-txt-link-rfc2396E" href="mailto:Ben.Newlin@genesys.com"><Ben.Newlin@genesys.com></a><br>
<b>Date: </b>Tuesday, September 6, 2022 at 12:24 PM<br>
<b>To: </b>OpenSIPS users mailling list
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
<b>Subject: </b>Re: [OpenSIPS-Users] dynamic routing
failover ONLY ONCE on the provider and continue<o:p></o:p></span></p>
</div>
<div>
<div>
<table class="MsoNormalTable"
style="border-collapse:collapse;border:none"
cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr>
<td style="border:solid #B60000
1.0pt;background:white;padding:.75pt .75pt .75pt
.75pt">
<p class="MsoNormal"><b><span
style="font-size:12.0pt;color:#B60000"> EXTERNAL
EMAIL - Please use caution with links and
attachments <o:p></o:p></span></b></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span
style="font-size:9.0pt;font-family:Helvetica;color:black"><o:p> </o:p></span></p>
<div class="MsoNormal" style="text-align:center"
align="center"><span style="font-size:11.0pt">
<hr width="100%" size="0" align="center">
</span></div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">Ah, I see
now in my response I did misunderstand the problem.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">There is no
use_next_carrier function, however the AVP that contains the
carrier list is accessible to you [1]. Our implementation
has a similar requirement that we should skip to the next
carrier rather than next gateway on certain response codes.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">What we do
is after calling do_routing, we copy the carrier_id_avp
contents into our own AVP and then we call route_to_carrier
on each carrier in that list. So then use_next_gw will only
failover on the gateways on a specific carrier. When there
are no more gateways, or whenever we decide based on our
needs, then we can skip to the next carrier by calling
route_to_carrier with the next carrier in our list.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">A
use_next_carrier function does seem like a very useful
feature enhancement though.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Ben
Newlin </span>
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Users
<a class="moz-txt-link-rfc2396E" href="mailto:users-bounces@lists.opensips.org"><users-bounces@lists.opensips.org></a> on behalf of
David Villasmil <a class="moz-txt-link-rfc2396E" href="mailto:david.villasmil.work@gmail.com"><david.villasmil.work@gmail.com></a><br>
<b>Date: </b>Tuesday, September 6, 2022 at 12:09 PM<br>
<b>To: </b><a class="moz-txt-link-abbreviated" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
<b>Subject: </b>Re: [OpenSIPS-Users] dynamic routing
failover ONLY ONCE on the provider and continue</span><o:p></o:p></p>
</div>
<div>
<div>
<div>
<table class="MsoNormalTable"
style="border-collapse:collapse" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td style="border:solid #B60000
1.0pt;background:white;padding:.75pt .75pt .75pt
.75pt">
<p class="MsoNormal"><b><span
style="font-size:12.0pt;color:#B60000"> EXTERNAL
EMAIL - Please use caution with links and
attachments </span></b><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span
style="font-size:9.0pt;font-family:Helvetica;color:black"> </span><o:p></o:p></p>
<div class="MsoNormal" style="text-align:center"
align="center"><span style="font-size:11.0pt">
<hr width="100%" size="1" align="center">
</span></div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">Is there
anything like “use_next_carrier”? I.e.: decide when I want
to stop trying gws for the current carrier.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">On
Tue, 6 Sep 2022 at 18:04, David Villasmil <<a
href="mailto:david.villasmil.work@gmail.com"
moz-do-not-send="true">david.villasmil.work@gmail.com</a>>
wrote:</span><o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">I
may not have been clear, I want to try the first
_two_ (2) gws for each carrier.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Is
this possible?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">On
Tue, 6 Sep 2022 at 17:14, David Villasmil <<a
href="mailto:david.villasmil.work@gmail.com"
target="_blank" moz-do-not-send="true">david.villasmil.work@gmail.com</a>>
wrote:</span><o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid
#CCCCCC 1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">Hey Bodgan,</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">Sorry for the caps,
was just trying to illustrate a very
important point.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">That was a typo:
it's provider.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">So what i mean is:</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">- Provier1</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> - gw1</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> - gw2</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">- Provider2</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> - gw1</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> - gw2</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">and so on.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">The providers could
have more than 2 gws, but i only want it to
attempt the first 2.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">Is this possible?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"><br clear="all">
</span><o:p></o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">Regards,</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span
style="font-size:11.0pt">David
Villasmil</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">email: <a
href="mailto:david.villasmil.work@gmail.com" target="_blank"
moz-do-not-send="true">
david.villasmil.work@gmail.com</a></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">phone:
+34669448337</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">On Tue, Sep 6, 2022
at 4:05 PM Bogdan-Andrei Iancu <<a
href="mailto:bogdan@opensips.org"
target="_blank" moz-do-not-send="true">bogdan@opensips.org</a>>
wrote:</span><o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid
#CCCCCC 1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Courier
New"">David,<br>
<br>
Define the "provide" as carrier and set
the "use only first gw from cr" flag for
it, see
<a
href="https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS"
target="_blank" moz-do-not-send="true">
https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS</a><br>
<br>
PS: no need for caps ;)<br>
<br>
Regards,<br>
<br>
<br>
</span><o:p></o:p></p>
<pre>Bogdan-Andrei Iancu<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>OpenSIPS Founder and Developer<o:p></o:p></pre>
<pre> <a href="https://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">https://www.opensips-solutions.com</a><o:p></o:p></pre>
<pre>OpenSIPS Summit 27-30 Sept 2022, Athens<o:p></o:p></pre>
<pre> <a href="https://www.opensips.org/events/Summit-2022Athens/" target="_blank" moz-do-not-send="true">https://www.opensips.org/events/Summit-2022Athens/</a><o:p></o:p></pre>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">On 9/6/22 4:57
PM, David Villasmil wrote:</span><o:p></o:p></p>
</div>
<blockquote
style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">Hello folks,
</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">I'm
trying to route to the first
provider and if the first gw
attempted fails, try the next gw on
that provider, and if that fails
THEN failover to the next provider.
NOTE ALL PROVIDERS CAN HAVE MULTIPLE
gws.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">Is this
possible on 2.4.7?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">I really
appreciate your help!</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">David
Villasmil </span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">email:
<a
href="mailto:david.villasmil.work@gmail.com"
target="_blank"
moz-do-not-send="true">
david.villasmil.work@gmail.com</a></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt">phone:
+34669448337</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span
style="font-size:11.0pt"><br>
<br>
<br>
</span><o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Users mailing list<o:p></o:p></pre>
<pre><a href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a><o:p></o:p></pre>
<pre><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span
style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">-- </span><o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Regards,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">David
Villasmil</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">email:
<a href="mailto:david.villasmil.work@gmail.com"
target="_blank" moz-do-not-send="true">
david.villasmil.work@gmail.com</a></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">phone:
+34669448337</span><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">-- </span><o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Regards,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">David
Villasmil</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">email:
<a href="mailto:david.villasmil.work@gmail.com"
target="_blank" moz-do-not-send="true">
david.villasmil.work@gmail.com</a></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">phone:
+34669448337</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
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>
<br>
</body>
</html>