[OpenSIPS-Users] How to avoid rewriting NAT RURI

opensipslist at encambio.com opensipslist at encambio.com
Tue Feb 1 16:26:43 CET 2011


Hello list,

I'm using:

  Solaris 11 x86 (nv-b91)
  OpenSIPS 1.6.4 with TLS

In order to allow two UAs behind the same NAT router to communicated
with each other directly, I'm trying to do something like this in the
main request route block:

  if (ruri.received_addr == registered(To-URI).received_hdr)
      noop;  # Do nothing
  else {  # UAs are behind different routers
      rewrite-request-URI-contact-with-ruri.recieved_addr;
      lookup(To-URI);  # Lookup will rewrite ruri with recv header
  }

Similar logic probably must go in the onreply_route block as well.

I don't need any help with the 'else' block, because that's the normal
case which is working very well for us now.

The problem with the example configurations distributed with the source
code is that they assume that any UA which is behind a NAT router will
always call other UAs behind another (different) router. That's not
always the case, though.

Does anybody have an example of how to do this? How have others solved
this problem?

Regards,
Brian



More information about the Users mailing list