drouting module -- How to use registered gateway as outbound gateway

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

drouting module -- How to use registered gateway as outbound gateway

Jeffrey Zhao
Dear all
We are using drouting module for dialplan routing,  for NAT issues, we need to register outbound voice gateway to opensips, instead of fixed static IP.
Is there any way to use registered gateway as routing destination?

Thanks.

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting module -- How to use registered gateway as outbound gateway

Bogdan-Andrei Iancu-2
Hi Jeffrey,

To do something like that, you need to have in DR  (as gateway) the AOR
used by the GW to register with. And after you do do_routing() you do
lookup(location).

Now the tricky part is to link them, as Drouting is IP/domain driven
while user location is AOR driven.

So, in DR use as GW 127.0.0.1 (.2 and so on) - even if there is
something phony, it has to be a valid IP. Now, after do_routing() you
will have in RURI sip:DID@127.0.0.1 which needs to be pushed into user
location. Do transform it into a valid AOR (to be used as search key by
user location), save the username part of RURI into a variable (for
later restoring) and strip it -> ruri = sip:127.0.0.1 .Further use some
subst/string transformation to do a static transformation from 127.0.0.N
to gwN string and build AOR as sip:gwN@opensips_domain. So, in your case
you will get sip:gw1@opensips_domain as an AOR that can be used for
lookup location (of course, your GW must register under the AOR of
sip:gw1@opensips_domain). After lookup(location) just restore the DID
back into username part -> sip:DID@gw_address .
Basically the trick is to get a static mapping between the phony IPs you
put in DR (like 127.0.0.N) and the AORs used by the GW to register (like
gwN@opensips_domain), so you can link them.

Regards,

Bogdan-Andrei Iancu
   OpenSIPS Founder and Developer
   http://www.opensips-solutions.com

On 12/15/2017 02:39 AM, Jeffrey Zhao wrote:

> Dear all
> We are using drouting module for dialplan routing,  for NAT issues, we need to register outbound voice gateway to opensips, instead of fixed static IP.
> Is there any way to use registered gateway as routing destination?
>
> Thanks.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting module -- How to use registered gateway as outbound gateway

Ben Newlin

You could also put the AoR that the gateways will use to register as an attribute on the rule/carrier/gateway in DR. Then when you do the lookup you provide avps for the attributes to be provided back and you can do the lookup based on that.

 

Ben Newlin

 

From: Users <[hidden email]> on behalf of Bogdan-Andrei Iancu <[hidden email]>
Reply-To: OpenSIPS users mailling list <[hidden email]>
Date: Friday, December 15, 2017 at 11:35 AM
To: OpenSIPS users mailling list <[hidden email]>, Jeffrey Zhao <[hidden email]>
Subject: Re: [OpenSIPS-Users] drouting module -- How to use registered gateway as outbound gateway

 

Hi Jeffrey,

 

To do something like that, you need to have in DR  (as gateway) the AOR

used by the GW to register with. And after you do do_routing() you do

lookup(location).

 

Now the tricky part is to link them, as Drouting is IP/domain driven

while user location is AOR driven.

 

So, in DR use as GW 127.0.0.1 (.2 and so on) - even if there is

something phony, it has to be a valid IP. Now, after do_routing() you

will have in RURI sip:[hidden email] which needs to be pushed into user

location. Do transform it into a valid AOR (to be used as search key by

user location), save the username part of RURI into a variable (for

later restoring) and strip it -> ruri = sip:127.0.0.1 .Further use some

subst/string transformation to do a static transformation from 127.0.0.N

to gwN string and build AOR as sip:gwN@opensips_domain. So, in your case

you will get sip:gw1@opensips_domain as an AOR that can be used for

lookup location (of course, your GW must register under the AOR of

sip:gw1@opensips_domain). After lookup(location) just restore the DID

back into username part -> sip:DID@gw_address .

Basically the trick is to get a static mapping between the phony IPs you

put in DR (like 127.0.0.N) and the AORs used by the GW to register (like

gwN@opensips_domain), so you can link them.

 

Regards,

 

Bogdan-Andrei Iancu

   OpenSIPS Founder and Developer

 

On 12/15/2017 02:39 AM, Jeffrey Zhao wrote:

Dear all

We are using drouting module for dialplan routing,  for NAT issues, we need to register outbound voice gateway to opensips, instead of fixed static IP.

Is there any way to use registered gateway as routing destination?

 

Thanks.

 

_______________________________________________

Users mailing list

 

 

_______________________________________________

Users mailing list

 

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting module -- How to use registered gatewayas outbound gateway

Jeffrey Zhao
Dear Bogdan and Ben Newlin 
Thanks for the reply, really appreciated.



------------------ Original ------------------
From:  "Ben Newlin";<[hidden email]>;
Send time: Saturday, Dec 16, 2017 0:53 AM
To: "OpenSIPS users mailling list"<[hidden email]>; "Jeffrey Zhao"<[hidden email]>;
Subject:  Re: [OpenSIPS-Users] drouting module -- How to use registered gatewayas outbound gateway

You could also put the AoR that the gateways will use to register as an attribute on the rule/carrier/gateway in DR. Then when you do the lookup you provide avps for the attributes to be provided back and you can do the lookup based on that.

 

Ben Newlin

 

From: Users <[hidden email]> on behalf of Bogdan-Andrei Iancu <[hidden email]>
Reply-To: OpenSIPS users mailling list <[hidden email]>
Date: Friday, December 15, 2017 at 11:35 AM
To: OpenSIPS users mailling list <[hidden email]>, Jeffrey Zhao <[hidden email]>
Subject: Re: [OpenSIPS-Users] drouting module -- How to use registered gateway as outbound gateway

 

Hi Jeffrey,

 

To do something like that, you need to have in DR  (as gateway) the AOR

used by the GW to register with. And after you do do_routing() you do

lookup(location).

 

Now the tricky part is to link them, as Drouting is IP/domain driven

while user location is AOR driven.

 

So, in DR use as GW 127.0.0.1 (.2 and so on) - even if there is

something phony, it has to be a valid IP. Now, after do_routing() you

will have in RURI sip:[hidden email] which needs to be pushed into user

location. Do transform it into a valid AOR (to be used as search key by

user location), save the username part of RURI into a variable (for

later restoring) and strip it -> ruri = sip:127.0.0.1 .Further use some

subst/string transformation to do a static transformation from 127.0.0.N

to gwN string and build AOR as sip:gwN@opensips_domain. So, in your case

you will get sip:gw1@opensips_domain as an AOR that can be used for

lookup location (of course, your GW must register under the AOR of

sip:gw1@opensips_domain). After lookup(location) just restore the DID

back into username part -> sip:DID@gw_address .

Basically the trick is to get a static mapping between the phony IPs you

put in DR (like 127.0.0.N) and the AORs used by the GW to register (like

gwN@opensips_domain), so you can link them.

 

Regards,

 

Bogdan-Andrei Iancu

   OpenSIPS Founder and Developer

 

On 12/15/2017 02:39 AM, Jeffrey Zhao wrote:

Dear all

We are using drouting module for dialplan routing,  for NAT issues, we need to register outbound voice gateway to opensips, instead of fixed static IP.

Is there any way to use registered gateway as routing destination?

 

Thanks.

 

_______________________________________________

Users mailing list

 

 

_______________________________________________

Users mailing list

 

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users