Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Bogdan-Andrei Iancu

Hi Ben, David,

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.


Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 9/6/22 7:35 PM, Ben Newlin wrote:


Sorry, forgot the link for my reference.

[1] - 
https://opensips.org/docs/modules/2.4.x/drouting.html#param_carrier_id_avp 
<https://opensips.org/docs/modules/2.4.x/drouting.html#param_carrier_id_avp>


Ben Newlin

*From: *Users  on behalf of Ben 
Newlin 

*Date: *Tuesday, September 6, 2022 at 12:24 PM
*To: *OpenSIPS users mailling list 
*Subject: *Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on 
the provider and continue


* EXTERNAL EMAIL - Please use caution with links and attachments *



Ah, I see now in my response I did misunderstand the problem.

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.


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.


A use_next_carrier function does seem like a very useful feature 
enhancement though.


Ben Newlin

*From: *Users  on behalf of David 
Villasmil 

*Date: *Tuesday, September 6, 2022 at 12:09 PM
*To: *users@lists.opensips.org 
*Subject: *Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on 
the provider and continue


* EXTERNAL EMAIL - Please use caution with links and attachments *



Is there anything like “use_next_carrier”? I.e.: decide when I want to 
stop trying gws for the current carrier.


On Tue, 6 Sep 2022 at 18:04, David Villasmil 
<mailto:david.villasmil.w...@gmail.com>> wrote:


I may not have been clear, I want to try the first _two_ (2) gws
for each carrier.

Is this possible?

On Tue, 6 Sep 2022 at 17:14, David Villasmil
mailto:david.villasmil.w...@gmail.com>> wrote:

Hey Bodgan,

Sorry for the caps, was just trying to illustrate a very
important point.

That was a typo: it's provider.

So what i mean is:

- Provier1

  - gw1

  - gw2

- Provider2

  - gw1

  - gw2

and so on.

The providers could have more than 2 gws, but i only want it
to attempt the first 2.

Is this possible?


Regards,

David Villasmil

email: david.villasmil.w...@gmail.com
<mailto:david.villasmil.w...@gmail.com>

phone: +34669448337

On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu
mailto:bog...@opensips.org>> wrote:

David,

Define the "provide" as carrier and set the "use only
first gw from cr" flag for it, see

https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS

<https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS>

PS: no need for caps ;)

Regards,


Bogdan-Andrei Iancu

  


OpenSIPS Founder and Developer

   https://www.opensips-solutions.com  
<https://www.opensips-solutions.com>

OpenSIPS Summit 27-30 Sept 2022, Athens

   https://www.opensips.org/events/Summit-2022Athens/  
<https://www.opensips.org/events/Summit-2022Athens/>

On 9/6/22 4:57 PM, David Villasmil wrote:

Hello folks,

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.

Is this possible on 2.4.7?

I really appreciate your help!

David Villasmil

email: david.villasmil.w...@gmail.com
<mailto:david.villasmil.w...@gmail.com>

phone: +34669448337





Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Ben Newlin
Sorry, forgot the link for my reference.

[1] - https://opensips.org/docs/modules/2.4.x/drouting.html#param_carrier_id_avp

Ben Newlin

From: Users  on behalf of Ben Newlin 

Date: Tuesday, September 6, 2022 at 12:24 PM
To: OpenSIPS users mailling list 
Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the 
provider and continue
 EXTERNAL EMAIL - Please use caution with links and attachments


Ah, I see now in my response I did misunderstand the problem.

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.

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.

A use_next_carrier function does seem like a very useful feature enhancement 
though.

Ben Newlin

From: Users  on behalf of David Villasmil 

Date: Tuesday, September 6, 2022 at 12:09 PM
To: users@lists.opensips.org 
Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the 
provider and continue
 EXTERNAL EMAIL - Please use caution with links and attachments


Is there anything like “use_next_carrier”? I.e.: decide when I want to stop 
trying gws for the current carrier.

On Tue, 6 Sep 2022 at 18:04, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> wrote:
I may not have been clear, I want to try the first _two_ (2) gws for each 
carrier.

Is this possible?

On Tue, 6 Sep 2022 at 17:14, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> wrote:
Hey Bodgan,

Sorry for the caps, was just trying to illustrate a very important point.

That was a typo: it's provider.

So what i mean is:

- Provier1
  - gw1
  - gw2
- Provider2
  - gw1
  - gw2

and so on.

The providers could have more than 2 gws, but i only want it to attempt the 
first 2.

Is this possible?

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337


On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:
David,

Define the "provide" as carrier and set the "use only first gw from cr" flag 
for it, see 
https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS<https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS>

PS: no need for caps ;)

Regards,



Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  https://www.opensips-solutions.com<https://www.opensips-solutions.com>

OpenSIPS Summit 27-30 Sept 2022, Athens

  
https://www.opensips.org/events/Summit-2022Athens/<https://www.opensips.org/events/Summit-2022Athens/>
On 9/6/22 4:57 PM, David Villasmil wrote:
Hello folks,

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.

Is this possible on 2.4.7?


I really appreciate your help!


David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337




___

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>

--
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337
--
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Ben Newlin
Ah, I see now in my response I did misunderstand the problem.

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.

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.

A use_next_carrier function does seem like a very useful feature enhancement 
though.

Ben Newlin

From: Users  on behalf of David Villasmil 

Date: Tuesday, September 6, 2022 at 12:09 PM
To: users@lists.opensips.org 
Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the 
provider and continue
 EXTERNAL EMAIL - Please use caution with links and attachments


Is there anything like “use_next_carrier”? I.e.: decide when I want to stop 
trying gws for the current carrier.

On Tue, 6 Sep 2022 at 18:04, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> wrote:
I may not have been clear, I want to try the first _two_ (2) gws for each 
carrier.

Is this possible?

On Tue, 6 Sep 2022 at 17:14, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> wrote:
Hey Bodgan,

Sorry for the caps, was just trying to illustrate a very important point.

That was a typo: it's provider.

So what i mean is:

- Provier1
  - gw1
  - gw2
- Provider2
  - gw1
  - gw2

and so on.

The providers could have more than 2 gws, but i only want it to attempt the 
first 2.

Is this possible?

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337


On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:
David,

Define the "provide" as carrier and set the "use only first gw from cr" flag 
for it, see 
https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS<https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS>

PS: no need for caps ;)

Regards,


Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  https://www.opensips-solutions.com<https://www.opensips-solutions.com>

OpenSIPS Summit 27-30 Sept 2022, Athens

  
https://www.opensips.org/events/Summit-2022Athens/<https://www.opensips.org/events/Summit-2022Athens/>
On 9/6/22 4:57 PM, David Villasmil wrote:
Hello folks,

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.

Is this possible on 2.4.7?


I really appreciate your help!


David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337



___

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>

--
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337
--
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread David Villasmil
Hey Bodgan,

Sorry for the caps, was just trying to illustrate a very important point.

That was a typo: it's provider.

So what i mean is:

- Provier1
  - gw1
  - gw2
- Provider2
  - gw1
  - gw2

and so on.

The providers could have more than 2 gws, but i only want it to attempt the
first 2.

Is this possible?

Regards,

On Tue, 6 Sep 2022 at 16:41, Ben Newlin  wrote:

> If I’m not mistaken, the functionality David is describing is the default
> behavior of the module and the use_next_gw function. All carriers are
> loaded on the call to do_routing, and use_next_gw will go through each
> gateway of each carrier in order, unless the flag Bogdan referenced below
> is set.
>
>
>
> Ben Newlin
>
>
>
> *From: *Users  on behalf of
> Bogdan-Andrei Iancu 
> *Date: *Tuesday, September 6, 2022 at 10:06 AM
> *To: *OpenSIPS users mailling list , David
> Villasmil 
> *Subject: *Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the
> provider and continue
>
> * EXTERNAL EMAIL - Please use caution with links and attachments *
>
>
> --
>
> David,
>
> Define the "provide" as carrier and set the "use only first gw from cr"
> flag for it, see
> https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS
>
> PS: no need for caps ;)
>
> Regards,
>
> Bogdan-Andrei Iancu
>
>
>
> OpenSIPS Founder and Developer
>
>   https://www.opensips-solutions.com
>
> OpenSIPS Summit 27-30 Sept 2022, Athens
>
>   https://www.opensips.org/events/Summit-2022Athens/
>
> On 9/6/22 4:57 PM, David Villasmil wrote:
>
> Hello folks,
>
>
>
> 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.
>
>
>
> Is this possible on 2.4.7?
>
>
>
>
>
> I really appreciate your help!
>
>
>
>
>
> David Villasmil
>
> email: david.villasmil.w...@gmail.com
>
> phone: +34669448337
>
>
>
> ___
>
> Users mailing list
>
> Users@lists.opensips.org
>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
-- 
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread David Villasmil
Is there anything like “use_next_carrier”? I.e.: decide when I want to stop
trying gws for the current carrier.

On Tue, 6 Sep 2022 at 18:04, David Villasmil 
wrote:

> I may not have been clear, I want to try the first _two_ (2) gws for each
> carrier.
>
> Is this possible?
>
> On Tue, 6 Sep 2022 at 17:14, David Villasmil <
> david.villasmil.w...@gmail.com> wrote:
>
>> Hey Bodgan,
>>
>> Sorry for the caps, was just trying to illustrate a very important point.
>>
>> That was a typo: it's provider.
>>
>> So what i mean is:
>>
>> - Provier1
>>   - gw1
>>   - gw2
>> - Provider2
>>   - gw1
>>   - gw2
>>
>> and so on.
>>
>> The providers could have more than 2 gws, but i only want it to attempt
>> the first 2.
>>
>> Is this possible?
>>
>> Regards,
>>
>> David Villasmil
>> email: david.villasmil.w...@gmail.com
>> phone: +34669448337
>>
>>
>> On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu 
>> wrote:
>>
>>> David,
>>>
>>> Define the "provide" as carrier and set the "use only first gw from cr"
>>> flag for it, see
>>> https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS
>>>
>>> PS: no need for caps ;)
>>>
>>> Regards,
>>>
>>> Bogdan-Andrei Iancu
>>>
>>> OpenSIPS Founder and Developer
>>>   https://www.opensips-solutions.com
>>> OpenSIPS Summit 27-30 Sept 2022, Athens
>>>   https://www.opensips.org/events/Summit-2022Athens/
>>>
>>> On 9/6/22 4:57 PM, David Villasmil wrote:
>>>
>>> Hello folks,
>>>
>>> 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.
>>>
>>> Is this possible on 2.4.7?
>>>
>>>
>>> I really appreciate your help!
>>>
>>>
>>> David Villasmil
>>> email: david.villasmil.w...@gmail.com
>>> phone: +34669448337
>>>
>>> ___
>>> Users mailing 
>>> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>> --
> Regards,
>
> David Villasmil
> email: david.villasmil.w...@gmail.com
> phone: +34669448337
>
-- 
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Ben Newlin
If I’m not mistaken, the functionality David is describing is the default 
behavior of the module and the use_next_gw function. All carriers are loaded on 
the call to do_routing, and use_next_gw will go through each gateway of each 
carrier in order, unless the flag Bogdan referenced below is set.

Ben Newlin

From: Users  on behalf of Bogdan-Andrei Iancu 

Date: Tuesday, September 6, 2022 at 10:06 AM
To: OpenSIPS users mailling list , David Villasmil 

Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the 
provider and continue
 EXTERNAL EMAIL - Please use caution with links and attachments


David,

Define the "provide" as carrier and set the "use only first gw from cr" flag 
for it, see 
https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS<https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS>

PS: no need for caps ;)

Regards,


Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  https://www.opensips-solutions.com<https://www.opensips-solutions.com>

OpenSIPS Summit 27-30 Sept 2022, Athens

  
https://www.opensips.org/events/Summit-2022Athens/<https://www.opensips.org/events/Summit-2022Athens/>
On 9/6/22 4:57 PM, David Villasmil wrote:
Hello folks,

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.

Is this possible on 2.4.7?


I really appreciate your help!


David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337



___

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Bogdan-Andrei Iancu

David,

Define the "provide" as carrier and set the "use only first gw from cr" 
flag for it, see 
https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS


PS: no need for caps ;)

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 9/6/22 4:57 PM, David Villasmil wrote:

Hello folks,

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.


Is this possible on 2.4.7?


I really appreciate your help!


David Villasmil
email: david.villasmil.w...@gmail.com 


phone: +34669448337

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread David Villasmil
Hello folks,

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.

Is this possible on 2.4.7?


I really appreciate your help!


David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users