[OpenSIPS-Users] NAT and ACK (private IP/domain)

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Apr 24 14:14:14 CEST 2009


Hi Julian,

If you take a look at the default cfg file that comes with opensips, you 
will find it a good frame/example to understand the basics of routing in 
SIP / OpenSIPS.

Regards,
Bogdan

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




More information about the Users mailing list