[OpenSBC] OpenSBC behind NAT - Take 2
Brought to you by:
joegenbaclor
|
From: Roland A. <ope...@op...> - 2007-10-01 18:28:23
|
Hi All, Over the last days i was investigating the problem of having OpenSBC behid my NAT router and after a couple of hacks in the code i got it to work with UAs that are in private networks. Now here is my scenario SIP Service <----> OpenSBC <------------> Office NAT Router<--------- Public Internet ------------> Private NAT router <---------------------> SIP UA 10.17.20.2 10.17.20.4 10.17.20.1 <-> 217.10.34.12 84.12.32.23 <-> 192.168.0.1 192.168.0.5 The SIP UA can now call my service over the public internet and the two NAT routers. On the Office router i added some portforwarding for the SIP port and the RTP to point to the OpenSBC server. On the OpenSBC source code i needed to do some minor changes: a) In B2BUACall.cxx in SendB2BConnect I needed to fix the contact address to be the public address of the Office NAT router b) In B2BMediaInterface in TranslateSDPAnswer i also needed to fix the media IP address to the public address of the Office NAT router Once these two changes are done i can make a call from the SIP UA to the service. I initially tried to set the StaticMedia Address but this doesnt work as it'll also modify the RTP leg on the office network side. These changes are jsut a hack to get it to work and i believe it needs a bit more thinking to make it work on various SIP signalling use cases (i.e. SDP Offer in 200 OK, etc..) Now thinking about this a bit more, what would be nice to have is some more configuration control over individial SIP legs (i.n ingress, egress). for this NAT scenario it would be desirable to define the NAT address on the one side but leave the interface address as is on the other. Also i would assume that such a setup scenario is really useful for smaller companies that want to hook up their internal SIP phone system with external devices. |