[Users] nathelper/rtpproxy when both SIP UA are behind same NAT

Tavis P tavis.lists at galaxytelecom.net
Sun Dec 4 21:19:51 CET 2005


Rafael R. GV wrote:

> Hi
> I am still trying to solve this issue: ...using avpops to enable SER
> to see if the UAs are located behind the same address and then trying
> to let the UAs speak directly to each other (without force rtpproxy),
> please see  my config. below and send some advice for what do I have
> to do in route 3?
>
> ...
>                 if (!lookup("location")) {
>                         log(1,"unable to locate user X ... sending to
> route(4)! \n");
>                         # handle user which was not found
>                         route(4);
>                         break;
>                 };
>
>                 ### Test if UAS are in the same NAT:
>                 # get the host part of the final uri (IP part) and
> store it in AVP ID 13
>
>                 avp_write("$ruri/domain", "i:13");
>                 if (avp_check("i:13","eq/$src_ip/i")) {
>                         log(1, "source IP is the same as destination
> IP\n");
>                         route(3)
>                         ;t_on_reply("3");
>                         break;
>                 };
>                 avp_delete("i:13/g");
> ...
> # -------------- Same NAT Call Routing (no force rtpproxy) ----
>        
> route[3]{
>         log(1," route[3]: UAs are in the same nat, NO force_rtp_proxy ");
>         fix_nated_contact();   
>         if(!t_relay()){
>                 sl_reply_error();
>         };
>         log(1, "Route[3]: Send it out now!!!\n");
> }      
>
> thanks
> rafael
>
>  
>
Just want to mention that if your clients use STUN than this fix will
not work (as the client acts like it is on a routable IP), however i
have encountered many issues with NATs that do not hairpin RTP data from
clients behind the same NAT to each other.

My solution was to detect (using similar logic to that above) if both
clients are coming from the same IP address and force RTP/Media proxy
otherwise the call would have no audio

Its a little OT but i thought i would mention it

>------------------------------------------------------------------------
>
>_______________________________________________
>Users mailing list
>Users at openser.org
>http://openser.org/cgi-bin/mailman/listinfo/users
>  
>





More information about the sr-users mailing list