[OpenSIPS-Users] Fix_nated_sdp

Bogdan-Andrei Iancu bogdan at voice-system.ro
Thu Nov 19 18:38:51 CET 2009


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




More information about the Users mailing list