<HTML dir=ltr><HEAD><TITLE>Re: [OpenSIPS-Users] NAT and ACK (private IP/domain)</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6001.18148" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText34438 dir=ltr>
<DIV dir=ltr><FONT face=Verdana color=#000000 size=2>I understand a concept I was missing, once record_route() is called I have to do a </FONT></DIV>
<DIV dir=ltr><BR><FONT face=Verdana size=2>if(loose_route()){<BR> route(x);<BR>}</FONT></DIV>
<DIV dir=ltr><FONT face=Verdana size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Verdana size=2>I was trying to route it again using is_uri_host_local() and lookup("location") but is_uri_host_local() was failing because the domain name was replaced by an IP address.</FONT></DIV>
<DIV dir=ltr><FONT face=Verdana size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Verdana size=2>I will continue to read and practice to understand concepts I am still missunderstanding.</FONT></DIV>
<DIV dir=ltr><FONT face=Verdana size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Verdana size=2>thank you for your help</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> users-bounces@lists.opensips.org on behalf of Julien Chavanton<BR><B>Sent:</B> Thu 23/04/2009 6:48 PM<BR><B>To:</B> Bogdan-Andrei Iancu<BR><B>Cc:</B> users@lists.opensips.org<BR><B>Subject:</B> Re: [OpenSIPS-Users] NAT and ACK (private IP/domain)<BR></FONT><BR></DIV>
<DIV dir=ltr>
<P><FONT face=Verdana size=2>Right, in the "200 OK" request the Contact as the private IP address.</FONT></P>
<P><FONT face=Verdana size=2>I register with a domain name so I guess the same domain name as to be set in Contact so I was expecting :<BR>- > Contact: <sip:778@10.0.1.71:33802;rinstance=8572c408a8cc28e3>.<BR>should be replaced by :<BR>- > Contact: <sip:778@osip.dev.com:33802;rinstance=8572c408a8cc28e3>.</FONT></P><FONT face=Verdana size=2>
<P><BR>I have fix_nated_contact(); both in ROUTE and in REPLY_ROUTE the make sure it is always executed, I understand it correctly<BR>1.6.1. fix_nated_contact : "Rewrites Contact HF to contain request's source address:port" </P>
<P>In my case Opensips will need a domain name to find that the target is registered localy, how should I handle this, register with an IP ?</P>
<P><BR>#<BR>U 10.0.4.201:5060 -> 74.56.45.88:5060<BR>SIP/2.0 200 OK.<BR>Via: SIP/2.0/UDP 192.168.1.125:5060;received=74.56.45.88;rport=5060;branch=z9hG4bKPjSEGMUzJy5GjV8YCUETnWMdjV-gfyCn86.<BR>Record-Route: <sip:10.0.4.201;lr;nat=yes>.<BR>Contact: <sip:778@10.0.1.71:33802;rinstance=8572c408a8cc28e3>.<BR>To: <sip:778@osip.dev.com>;tag=f9353e15.<BR>From: <sip:julien@osip.dev.com>;tag=mpq.p-Mu98E8HBomB7Kh5SvmPzJisbwq.<BR>Call-ID: eaFGOPK1Ah4PL8s0dQd2aDotzsaJTuHg.<BR>CSeq: 2972 INVITE.<BR>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.<BR>Record-Route: <sip:10.0.4.201;lr=on;nat=yes>.<BR>Via: SIP/2.0/UDP 10.0.4.201;branch=z9hG4bK0135.5e99e0d.2.<BR>Via: SIP/2.0/UDP 192.168.1.125:5060;received=74.56.45.88;rport=5060;branch=z9hG4bKPj2eYMnj8kZr0p7CSrA5rIIXRPI.uVmAQp.<BR>Max-Forwards: 69.<BR>From: sip:julien@osip.dev.com;tag=mpq.p-Mu98E8HBomB7Kh5SvmPzJisbwq.<BR>To: sip:778@osip.dev.com;tag=f9353e15.<BR>Call-ID: eaFGOPK1Ah4PL8s0dQd2aDotzsaJTuHg.<BR>CSeq: 2972 ACK.<BR>Content-Length: 0.<BR>P-hint: Route[6]: mediaproxy .<BR>.<BR>#<BR>U 10.0.1.71:33802 -> 10.0.4.201:5060<BR>SIP/2.0 200 OK.<BR>Via: SIP/2.0/UDP 10.0.4.201;branch=z9hG4bK0135.5e99e0d.0.<BR>Via: SIP/2.0/UDP 192.168.1.125:5060;received=74.56.45.88;rport=5060;branch=z9hG4bKPjSEGMUzJy5GjV8YCUETnWMdjV-gfyCn86.<BR>Record-Route: <sip:10.0.4.201;lr;nat=yes>.<BR>Contact: <sip:778@10.0.1.71:33802;rinstance=8572c408a8cc28e3>.<BR>To: <sip:778@osip.dev.com>;tag=f9353e15.<BR>From: <sip:julien@osip.dev.com>;tag=mpq.p-Mu98E8HBomB7Kh5SvmPzJisbwq.<BR>Call-ID: eaFGOPK1Ah4PL8s0dQd2aDotzsaJTuHg.<BR>CSeq: 2972 INVITE.<BR>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.<BR>Content-Type: application/sdp.<BR>User-Agent: X-Lite release 1100l stamp 47546.<BR>Content-Length: 181.<BR>.<BR>v=0.<BR>o=- 4 2 IN IP4 10.0.1.71.<BR>s=CounterPath X-Lite 3.0.<BR>c=IN IP4 10.0.1.71.<BR>t=0 0.<BR>m=audio 48428 RTP/AVP 3 0 8 101.<BR>a=fmtp:101 0-15.<BR>a=rtpmap:101 telephone-event/8000.<BR>a=sendrecv.</FONT></P>
<DIV id=idOWAReplyText80344 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>
<DIV id=idOWAReplyText64372 dir=ltr>
<DIV dir=ltr><FONT face=Verdana color=#000000 size=2></FONT> </DIV></DIV></FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro]<BR><B>Sent:</B> Thu 23/04/2009 5:50 PM<BR><B>To:</B> Julien Chavanton<BR><B>Cc:</B> users@lists.opensips.org<BR><B>Subject:</B> Re: [OpenSIPS-Users] NAT and ACK (private IP/domain)<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>HI Julian,<BR><BR>The ACK will be routed based on Route + RURI info. Route hdr made the<BR>ACK to get to .201 and the RURI will continue to .71. The RURI from ACK<BR>is taken from the Contact hdr of the 200 OK reply.<BR><BR>AMybe posting the whole stuff (INVITE+200 OK + ACK) will make things easier.<BR><BR>Regards,<BR>Bogdan<BR><BR>Julien Chavanton wrote:<BR>><BR>> I have a signaling problem, after connection "200 OK" the "ACK" is not<BR>> sent correctly and the rest of the signaling as well.<BR>><BR>> Opensips is using the IP in the ACK line instead of the "To:", I am<BR>> wandering how I should handle this ?<BR>><BR>> I-phone (Siphone) : julien@osip.dev.com <<A href="mailto:julien@osip.dev.com">mailto:julien@osip.dev.com</A>><BR>> X-lite : 778@osip.dev.com <<A href="mailto:778@osip.dev.com">mailto:778@osip.dev.com</A>><BR>><BR>> Logging of ACK reception, where the problem start<BR>> Apr 23 13:51:09 osip /sbin/opensips[5446]:<BR>> *****************signaling*****************<BR>> Apr 23 13:51:09 osip /sbin/opensips[5446]: 5 route[ACK][0]<BR>> sip:julien@osip.dev.com -><BR>> sip:778@10.0.1.71:33802;rinstance=8572c408a8cc28e3 START PROCESSING<BR>> MESSAGE<BR>> Apr 23 13:51:09 osip /sbin/opensips[5446]: *** RECORD ROUTE ***<BR>> Apr 23 13:51:09 osip /sbin/opensips[5446]: *** HOST NOT LOCAL *** <BR>> is_uri_host_local() !<BR>><BR>> I think this is my problem where the IP apear in the ACK line ?<BR>><BR>> "ACK sip:778@10.0.1.71:33802;rinstance=8572c408a8cc28e3 SIP/2.0."<BR>><BR>> #<BR>> U 74.56.45.88:5060 -> 10.0.4.201:5060<BR>> ACK sip:778@10.0.1.71:33802;rinstance=8572c408a8cc28e3 SIP/2.0.<BR>> Via: SIP/2.0/UDP<BR>> 192.168.1.125:5060;rport;branch=z9hG4bKPjTSq-5uCDumvhdYNtigsDJwPrKvhqMM-C.<BR>> Max-Forwards: 70.<BR>> From: sip:julien@osip.dev.com;tag=3FDO5jkip5p8pkCLNr.3TSz2gNrWxCy..<BR>> To: sip:778@osip.dev.com;tag=207ac245.<BR>> Call-ID: lywQ33yIAPEOG77lN93EbyXiHxji.FK-.<BR>> CSeq: 31501 ACK.<BR>> Route: <sip:10.0.4.201;lr;nat=yes>.<BR>> Content-Length: 0.<BR>> .<BR>><BR>> ------------------------------------------------------------------------<BR>><BR>> _______________________________________________<BR>> Users mailing list<BR>> Users@lists.opensips.org<BR>> <A href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A><BR>> <BR><BR></FONT></P></DIV></DIV></BODY></HTML>