[OpenSIPS-Users] b2bua, fix_nated_contact() and EC2

Huw Selley huw.selley at netdev.co.uk
Thu Jul 5 11:19:36 CEST 2012


It turns out I was trying to do something silly (b2b and proxy in a single opensips instance).
I have now have the proxy instance on the edge forwarding all calls to my b2b instance that's doing load balancing and everything is great!

Thanks for the advice about onreply_route though!

H 

On Wednesday, 4 July 2012 at 16:06, Nick Altmann wrote:

> Try to place fix_nated_contact() in global onreply_route (without number).
> 
> I do it like this:
> onreply_route { # GLOBAL
> # NAT processing
> if (<condition of your hated call>) {
> # Fix NATed contact and SDP in client replies
> if (nat_uac_test("65")) fix_nated_contact();
> if ( (has_body("application/sdp")) && (nat_uac_test("8")) )
> fix_nated_sdp("10");
> }
> }
> 
> Also, you may watch at my patch:
> http://sourceforge.net/tracker/?func=detail&aid=3519778&group_id=232389&atid=1086412
> It's for you can apply changes of packets (fix_nated_contact, etc.) in
> b2b_request/b2b_reply routes.
> 
> --
> Nick
> 
> 
> 2012/7/4 Huw Selley <huw.selley at netdev.co.uk (mailto:huw.selley at netdev.co.uk)>:
> > Hi,
> > 
> > I have an opensips 1.8.0 instance on EC2 that is in front of a pair of
> > freeswitch instances. The opensips instance has an elastic IP address.
> > Amazon do a 1:1 NAT on the elastic IP to the instances internal ip.
> > 
> > When calls hit opensips I do b2b_init_request("refer"); on the initial
> > invite and then load balance between the freeswitch instances (the
> > freeswitches can REFER between each other so I need to b2b the call).
> > 
> > What I have noticed is that the Contact header being sent back to my client
> > is still incorrect after calling fix_nated_contact() from inside
> > onreply_route (and local_route - I wasn't sure which one was correct) - it's
> > still set to the internal IP of the opensips instance so I don't get ACKs
> > correctly routed and the call terminates after 30s or so.
> > I have set 'advertised_address' as the elastic IP address and have added an
> > 'alias' for the internal address.
> > 
> > Is there some other piece of configuration that I am missing? If it helps I
> > can post my config?
> > 
> > Thanks in advance.
> > Huw
> > 
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org (mailto:Users at lists.opensips.org)
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> > 
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org (mailto: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/20120705/e4e857c3/attachment.htm>


More information about the Users mailing list