[OpenSIPS-Users] openSIPs behind NAT

Andrijana Popovska andrijana_222 at yahoo.com
Thu Sep 11 10:48:24 CEST 2008



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"))
         record_route();
to 

if (!is_method("REGISTER|MESSAGE"))
          record_route_preset("145.18.29.67"); // 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 145.18.3.32:25046;received=145.18.3.32;branch=z9hG4bK-d87543-1b618563fb1f2a08-1--d87543-;rport=25046
Record-Route: <sip:145.18.29.67;lr>
Contact: <sip:3000 at 145.18.3.32:5060;rinstance=4a3c8bfd9d545940>
To: "3000"<sip:3000 at andrijana.com>;tag=ec34ae21
From: "2000"<sip:2000 at andrijana.com>;tag=4663a44b
Call-ID: ZGEzNGU2NTdkZTkxMjJjMjJmMDI2MWY1MmRlOGRlNDQ.
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO
Content-Type: application/sdp
User-Agent: Zoiper for Windows rev.1105
Content-Length: 321 
v=0
o=Zoiper_user 0 0 IN IP4 127.0.0.1
s=Zoiper_session
c=IN IP4 127.0.0.1
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
a=sendrecv
~~~~~~~~~~~~~~~~~~~~~
 
ACK sip:3000 at 145.18.3.32:5060;rinstance=4a3c8bfd9d545940 SIP/2.0
Via: SIP/2.0/UDP 145.18.3.32:25046;branch=z9hG4bK-d87543-46028b777a7ec148-1--d87543-;rport
Max-Forwards: 70
Route: <sip:145.18.29.67;lr>
Contact: <sip:2000 at 145.18.3.32:25046>
To: "3000"<sip:3000 at andrijana.com>;tag=ec34ae21
From: "2000"<sip:2000 at andrijana.com>;tag=4663a44b
Call-ID: ZGEzNGU2NTdkZTkxMjJjMjJmMDI2MWY1MmRlOGRlNDQ.
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: 145.18.3.32.

Best Regards,
Andrijana


Hi Andrijana,
Check the advertised_address setting at
http://opensips.org/index.php?n=Resources.DocsCoreFcn
I didn't understand well what you are trying to accomplish, but it sounds like setting advertised_address to the public IP should help you. You may also want to check the force_send_socket function. If you continue to have problems, please send the verbal description of what you are trying to do (e.g. "to setup a server proxying calls from internal VPN network to the external network, with rtpproxy in bridged mode") and accompany it with the traffic dump made on the server (e.g. "tcpdump -s0 -v host .. and port .." or "ngrep -Wbyline -s0 -t SIP"). Hope it helps.

Andrijana Popovska wrote:

Hi all,

I have just installed OpenSIP Server, and I am quite new to this. 
I have configured two SIP clients that successfulli regiser to the OpenSIP proxy.

The OpenSIPs is behind NAT so when I try to establish a call, I can see that the "via" header of the INVITE message sent from the OpenSIP proxy contains the internal address. This make the client to send their responses to the internal address of the openSIP server, so the call can not be established.

Is there any way that I can force the OpenSIPs to use his external address inteh via header and record-route?

Thanks for helping me :)

-- 
Sincerely,
Andrew Pogrebennyk


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20080911/7eac42d0/attachment.htm 


More information about the Users mailing list