[OpenSIPS-Users] drouting module -- How to use registered gatewayas outbound gateway

Jeffrey Zhao chunyong.zhao at qq.com
Sat Dec 16 23:21:42 EST 2017


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






------------------ Original ------------------
From:  "Ben Newlin";<Ben.Newlin at genesys.com>;
Send time: Saturday, Dec 16, 2017 0:53 AM
To: "OpenSIPS users mailling list"<users at lists.opensips.org>; "Jeffrey Zhao"<chunyong.zhao at qq.com>; 

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 <users-bounces at lists.opensips.org> on behalf of Bogdan-Andrei Iancu <bogdan at opensips.org>
 Reply-To: OpenSIPS users mailling list <users at lists.opensips.org>
 Date: Friday, December 15, 2017 at 11:35 AM
 To: OpenSIPS users mailling list <users at lists.opensips.org>, Jeffrey Zhao <chunyong.zhao at qq.com>
 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:DID at 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 at opensips_domain. So, in your case 
 
  
you will get sip:gw1 at opensips_domain as an AOR that can be used for 
 
  
lookup location (of course, your GW must register under the AOR of 
 
  
sip:gw1 at opensips_domain). After lookup(location) just restore the DID 
 
  
back into username part -> sip:DID at 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 at opensips_domain), so you can link them.
 
  
 
 
  
Regards,
 
  
 
 
  
Bogdan-Andrei Iancu
 
  
   OpenSIPS Founder and Developer
 
  
    https://protect-us.mimecast.com/s/kKHOCER6PLSgL0EzhN-bAd?domain=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
 
  
Users at lists.opensips.org
 
  
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
 
   
 
 
  
 
 
  
_______________________________________________
 
  
Users mailing list
 
  
Users at lists.opensips.org
 
  
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20171217/1a987ea5/attachment.html>


More information about the Users mailing list