[OpenSIPS-Users] Fix_nated_sdp

Lawrence Na (MY-RND@Vyke) lawrence at vyke.com
Fri Dec 4 05:03:02 CET 2009


Hi Bogdan,

Thx for the reply and appreciate your help. I've turn on the debug to level
9. Below are the log:

Nov 20 10:19:31 OpenSIPS2 /usr/local/sbin/opensips[1912]: DBG:
==============START==============, si=y.y.y.y
Nov 20 10:19:31 OpenSIPS2 /usr/local/sbin/opensips[1912]:
DBG:core:parse_headers: flags=ffffffffffffffff
Nov 20 10:19:31 OpenSIPS2 /usr/local/sbin/opensips[1912]:
DBG:nathelper:check_content_type: type <application/sdp> found valid
Nov 20 10:19:31 OpenSIPS2 /usr/local/sbin/opensips[1912]: DBG:
==============END==============, si=y.y.y.y

I've printed out the $si variable before and after the fix_nated_sdp. Both
IP are the same which depicts A party external IP.

A -> Proxy -> B, is the INVITE packet flow from A party to B party in a P2P
scenario. I've attach the screenshot of the diagram which I'm trying to
explain in my previous email. I guess the plain text email screw all the
text position.

BTW, I'm still using Opensips 1.4.5 for our lab.

-------------------------------------------------------------------
Regards,
Lawrence Na Chong Guan
-------------------------------------------------------------------


> From: Bogdan-Andrei Iancu <bogdan at voice-system.ro>
> Reply-To: OpenSIPS users mailling list <users at lists.opensips.org>
> Date: Thu, 19 Nov 2009 19:38:51 +0200
> To: OpenSIPS users mailling list <users at lists.opensips.org>
> Subject: Re: [OpenSIPS-Users] Fix_nated_sdp
> 
> 
> Hi Lawrence,
> 
> Are you sure you SIP request is not spiralling on the proxy: A - > Proxy
> -> Proxy -> B ?? simply print the $si variable from script (via xlog)
> just before the fix_nated_sdp().
> 
> Regards,
> Bogdan
> 
> Lawrence Na (MY-RND at Vyke) wrote:
>> Hi All,
>> 
>> I¹ve got a problem with fix_nated_sdp, whenever I call the method in
>> the request route it doesn¹t seems to take effect. My INVITE c= & o=
>> list the proxy IP instead of the IP which I¹ve set in the method 2nd
>> argument. The weird thing, fix_nated_sdp in my reply route seems to
>> work just fine. Below are part of my scripts:
>> 
>> Route[4] {
>> if(to_uri=~"^sip:([A-Z][a-z])([A-Z][a-z]).+@*")
>> {
>> xlog("L_INFO", "DBG: P2P Call [$fu] -> [$tu]");
>> 
>> if(!lookup("location"))
>> {
>> xlog("L_INFO", "DBG: P2P Peer not found [$tu] from [$fu]($si)");
>> sl_send_reply("404", "User Offline");
>> exit;
>> }
>> 
>> if(isbflagset(6))
>> {
>> xlog("L_INFO", "DBG: NATed P2P Call [$fu] -> [$tu], force RTP");
>> fix_nated_sdp(³10², ³$si²);
>> }
>> }
>> }
>> 
>> onreply_route[1]
>> {
>> if(client_nat_test("7"))
>> {
>> fix_contact();
>> setbflag(6);
>> }
>> 
>> if(status=~"(180)|(183)|2[0-9][0-9]")
>> {
>> if(search("^Content-Type:[ ]*application/sdp"))
>> {
>> if(isbflagset(6) && (!to_uri=~"sip:[+][0-9][0-9][0-9].+@*"))
>> {
>> xlog("L_INFO", "DBG: Reply - S=$rs D=$rr F=$fu T=$tu [$rm], force RTP");
>> fix_nated_sdp(³10², ³$si²);
>> exit;
>> }
>> }
>> }
>> 
>> xlog("L_INFO", "DBG: Reply - S=$rs D=$rr F=$fu T=$tu [$rm]");
>> }
>> 
>> E.g:
>> INVITE
>> y.y.y.y 202.202.202.202 x.x.x.x(external IP)
>> A ------------------> Proxy ------------------> B
>> c=192.168.1.2 c=202.202.202.202
>> o=192.168.1.2 o=202.202.202.202
>> 
>> 200 response
>> x.x.x.x 202.202.202.202 y.y.y.y (external IP)
>> B ------------------> Proxy ------------------> A
>> c=192.168.0.2 c=x.x.x.x
>> o=192.168.0.2 o=x.x.x.x
>> 
>> Hope there is some gurus out there able to shade some lights.
>> 
>> -------------------------------------------------------------------
>> Regards,
>> *Lawrence Na Chong Guan
>> *-------------------------------------------------------------------
>> ------------------------------------------------------------------------
>> 
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>   
> 
> 
> -- 
> Bogdan-Andrei Iancu
> www.voice-system.ro
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture 1.jpg
Type: video/x-flv
Size: 12812 bytes
Desc: not available
Url : http://lists.opensips.org/pipermail/users/attachments/20091204/8a9d9a74/attachment.bin 


More information about the Users mailing list