[Users] No rtpproxy when clients are behind the same nat

Jeremy McNamara jj at nufone.net
Mon Mar 5 23:15:34 CET 2007


Rafael J. Risco G.V. wrote:
> Hi
> does anyone has a working example for this escenario?


I am working on this same situation.

I can make it work if I define a specific URI length/prefix to always be 
treated as 'local' - meaning we don't want to 'fix' the SDP for say all 
3 digit 'extensions'

I call resetflag(6) (i am using 6 for my NAT detection flag) for those 
URIs i don't want to use the mediaproxy (i use mediaproxy)

This situation will only work if there is a SINGLE layer of NAT at the 
'customer' premise.  If there is more than one NAT behind the same 
public IP this may (will not) work.




In my route block I do

	...

	if (uri =~ "^sip:[0-9]{3}@.*") {
		resetflag(6);
                 resetflag(7);
         }

	...

	lookup('location');

	...	

        # If NAT is previously detected, proxy
       	if (isflagset(6) || isflagset(7)) {
                 use_media_proxy();
         };
         route(1);

} // End route



Then:

onreply_route[1] {
         if ((isflagset(6) || isflagset(7)) && 
(status=~"(180)|(183)|2[0-9][0-9]")) {
                 if (!search("^Content-Length:\ +0")) {
                         use_media_proxy();
                 };
         };
         if (client_nat_test("1")) {
                 fix_nated_contact();
         };
}








Jeremy McNamara






More information about the Users mailing list