<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>&nbsp;</DIV>
<DIV>Hi Andrew,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank you for your replay and help.</DIV>
<DIV>In general I would like to set up a&nbsp;server such that it can also proxy calls from and to the external network.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I set the advertised_address to the public IP address, but the Record-Route remained the same. </DIV>
<DIV>So in order to change the Record-Route to the public IP address I changed the following:</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="Courier New, courier, monaco, monospace, sans-serif">&nbsp;<FONT size=2>if (!is_method("REGISTER|MESSAGE"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; record_route();</FONT></FONT></DIV>
<DIV>to  </DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="Courier New, courier, monaco, monospace, sans-serif" size=2>if (!is_method("REGISTER|MESSAGE"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; record_route_preset("145.18.29.67"); // the&nbsp;external IP address</FONT></DIV>
<DIV><BR>but that did not help because now the "ACK" that is sent for "200 OK" does not go through the proxy server. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is the received "200 OK" and the sent "ACK":</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<P>SIP/2.0 200 OK<BR>Via: SIP/2.0/UDP 145.18.3.32:25046;received=145.18.3.32;branch=z9hG4bK-d87543-1b618563fb1f2a08-1--d87543-;rport=25046<BR>Record-Route: &lt;sip:145.18.29.67;lr&gt;<BR>Contact: &lt;sip:3000@145.18.3.32:5060;rinstance=4a3c8bfd9d545940&gt;<BR>To: "3000"&lt;sip:3000@andrijana.com&gt;;tag=ec34ae21<BR>From: "2000"&lt;sip:2000@andrijana.com&gt;;tag=4663a44b<BR>Call-ID: ZGEzNGU2NTdkZTkxMjJjMjJmMDI2MWY1MmRlOGRlNDQ.<BR>CSeq: 1 INVITE<BR>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO<BR>Content-Type: application/sdp<BR>User-Agent: Zoiper for Windows rev.1105<BR>Content-Length: 321 </P>
<P>v=0<BR>o=Zoiper_user 0 0 IN IP4 127.0.0.1<BR>s=Zoiper_session<BR>c=IN IP4 127.0.0.1<BR>t=0 0<BR>m=audio 8000 RTP/AVP 0 3 8 110 98 101<BR>a=rtpmap:0 PCMU/8000<BR>a=rtpmap:3 GSM/8000<BR>a=rtpmap:8 PCMA/8000<BR>a=rtpmap:110 speex/8000<BR>a=rtpmap:98 iLBC/8000<BR>a=fmtp:98 mode=30<BR>a=rtpmap:101 telephone-event/8000<BR>a=fmtp:101 0-15<BR>a=sendrecv</P>
<P>~~~~~~~~~~~~~~~~~~~~~</P>
<P>&nbsp;</P>
<P>ACK sip:3000@145.18.3.32:5060;rinstance=4a3c8bfd9d545940 SIP/2.0<BR>Via: SIP/2.0/UDP 145.18.3.32:25046;branch=z9hG4bK-d87543-46028b777a7ec148-1--d87543-;rport<BR>Max-Forwards: 70<BR>Route: &lt;sip:145.18.29.67;lr&gt;<BR>Contact: &lt;sip:2000@145.18.3.32:25046&gt;<BR>To: "3000"&lt;sip:3000@andrijana.com&gt;;tag=ec34ae21<BR>From: "2000"&lt;sip:2000@andrijana.com&gt;;tag=4663a44b<BR>Call-ID: ZGEzNGU2NTdkZTkxMjJjMjJmMDI2MWY1MmRlOGRlNDQ.<BR>CSeq: 1 ACK<BR>User-Agent: X-Lite release 1011s stamp 41150<BR>Content-Length: 0</P><FONT face=Arial size=2></FONT></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">~~~~~~~~~~~~~~~~~~~~~</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">In my test set I have the two different clients (X-lite and Zoiper) on&nbsp;the same IP address: 145.18.3.32.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Best Regards,</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Andrijana</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV dir=ltr>
<DIV class=gmail_quote>Hi Andrijana,<BR>Check the advertised_address setting at<BR><A href="http://opensips.org/index.php?n=Resources.DocsCoreFcn" target=_blank rel=nofollow>http://opensips.org/index.php?n=Resources.DocsCoreFcn</A><BR>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.<BR><BR>Andrijana Popovska wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi all,<BR><BR>I have just installed OpenSIP Server, and I am quite new to this. <BR>I have configured two SIP clients that successfulli regiser to the OpenSIP proxy.<BR><BR>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.<BR><BR>Is there any way that I can force the OpenSIPs to use his external address inteh via header and record-route?<BR><BR>Thanks for helping me :)<BR></BLOCKQUOTE><BR>-- <BR>Sincerely,<BR><FONT color=#888888>Andrew Pogrebennyk<BR></FONT></DIV><BR></DIV></DIV></DIV></div><br>



      </body></html>