[OpenSIPS-Users] openSIPs behind NAT

Andrijana Popovska andrijana_222 at yahoo.com
Fri Sep 12 13:39:27 CEST 2008

Hi Andrew,

Sorry for not explaining correctly.
The server doesn't have a public IP, it is the public mapping that is configured on the NAT.

Both the 200OK and the ACK are captured on the PC, where the clients are. 

If I use record_route(), then the "200OK" sent from the client is sent to the internal address (10.133.305.200).

If I use record_route_preset("")  instead, then the 200 OK sent from the client is proxied through the server to the other client. On the other hand, the responding ACK has route= so the server actually sends it to it self. I've used Ethereal on the server to confirm this.

Is there a solution to this, and can the solution also include calls from the internal network?



Hi Andrijana,

Do you mean the server does not have a public IP and is just a public IP mapping configured on the NAT/router? That explains why
advertised_address setting did not have effect on the Record-Route (it
must be an address OpenSIPS listens on). Or the server has two real network interfaces (public and private) and OpenSIPS is listening on both?

It's quite important to know whether 200 OK sent by Zoiper and ACK sent by X-Lite are shown as caught on the server's outgoing interface or on the your PC. I think that both have been captured on the PC since I'm not seeing the server's address anywhere in the Via headers. But that leads to a difficult question.

It's indeed strange that 200 OK doesn't go through the proxy server. ACKs for 2xx responses use the Route values learned from the Record-Route of the 2xx responses, so X-Lite must send ACK through the proxy. You say currently it sends it directly to the peer, right? The next step depends on the configuration, e.g. if your OpenSIPS is listening on private and public interfaces you should set the enable_double_rr param of the rr module to 1.

Andrijana Popovska wrote:

Hi Andrew,

Thank you for your replay and help.
In general I would like to set up a server such that it can also proxy calls from and to the external network.

I set the advertised_address to the public IP address, but the Record-Route remained the same. So in order to change the Record-Route to the public IP address I changed the following:

 if (!is_method("REGISTER|MESSAGE"))
if (!is_method("REGISTER|MESSAGE"))
         record_route_preset(""); // the external IP address

but that did not help because now the "ACK" that is sent for "200 OK" does not go through the proxy server. 
Here is the received "200 OK" and the sent "ACK":

SIP/2.0 200 OK
Via: SIP/2.0/UDP;received=;branch=z9hG4bK-d87543-1b618563fb1f2a08-1--d87543-;rport=25046
Record-Route: <sip:;lr>
Contact: <sip:3000 at;rinstance=4a3c8bfd9d545940>
To: "3000"<sip:3000 at andrijana.com>;tag=ec34ae21
From: "2000"<sip:2000 at andrijana.com>;tag=4663a44b
Content-Type: application/sdp
User-Agent: Zoiper for Windows rev.1105
Content-Length: 321 v=0
o=Zoiper_user 0 0 IN IP4
c=IN IP4
t=0 0
m=audio 8000 RTP/AVP 0 3 8 110 98 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:110 speex/8000
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=30
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
 ACK sip:3000 at;rinstance=4a3c8bfd9d545940 SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK-d87543-46028b777a7ec148-1--d87543-;rport
Max-Forwards: 70
Route: <sip:;lr>
Contact: <sip:2000 at>
To: "3000"<sip:3000 at andrijana.com>;tag=ec34ae21
From: "2000"<sip:2000 at andrijana.com>;tag=4663a44b
CSeq: 1 ACK
User-Agent: X-Lite release 1011s stamp 41150
Content-Length: 0


In my test set I have the two different clients (X-lite and Zoiper) on the same IP address:

Best Regards,

Andrew Pogrebennyk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20080912/807e86e4/attachment-0001.htm 

More information about the Users mailing list