<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Daniel</div><div><br></div>Thank you for the info and answering my question.<div><br></div><div>I am just trying to take as much load of the proxy and save on bandwidth and improve/"guarantee" call quality as much as possible by not having to proxy RTP for these type of scenarios.</div><div>Even if the the UAs are on different subnets they should have communication between them, because of the "default gateway" knowing where to reach each of the respective private networks. I know that the gateway could be a firewall or there could be a firewall in between the subnets somewhere, but that issue can be easily resolved internally by allowing RTP traffic between the UAs.<br><div><br></div><div><br></div><div>Would I be correct, if I want to have RTP traffic flowing between the 2 UAs, in doing the following in the default /etc/kamailio/proxy.cfg?</div><div><br></div><div><br></div><div>>>>>>>>>>> LOCATION >>>>>>>>>>>>>></div><div><div>        if(!lookup("location"))</div><div>        {</div><div>                if($avp(s:callee_base_user) != $null)</div><div>                {</div><div>                        $rU = $var(orig_ruri_user);</div><div>                }</div><div><br></div><div>                xlog("L_INFO", "Local user offline - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n");</div><div>                if($avp(s:callee_cfna) != $null)</div><div>                {</div><div>                        xlog("L_INFO", "CFNA to '$avp(s:callee_cfna)' found - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n");</div><div>                        route(ROUTE_ACC_CFU);</div><div>                        avp_delete("$avp(s:caller_uuid)/g");</div><div>                        avp_copy("$avp(s:callee_uuid)", "$avp(s:caller_uuid)/d");</div><div>                        avp_pushto("$ru", "$avp(s:callee_cfna)");</div><div><br></div><div>                        $var(forward) = 1;</div><div>                        $(avp(s:cf_depth)[*]) = $avp(s:cf_depth) + 1;</div><div>                        route(ROUTE_LOAD_CALLER_PREF);</div><div>                        route(ROUTE_FIND_CALLEE);</div><div>                        exit;</div><div>                }</div><div><br></div><div>                $avp(s:acc_callee_user) = $avp(s:callee_user);</div><div>                $avp(s:acc_callee_domain) = $avp(s:callee_domain);</div><div><br></div><div>                route(ROUTE_ACC_FAILURE);</div><div>                sl_send_reply("404", "User Offline");</div><div>        }</div></div><div><div>        else</div><div>        {</div><div>                if($avp(s:has_extension) != $null && $avp(s:has_extension) == 1)</div><div>                {</div><div>                        # if there's an extension, first send dialed number; on 404, send</div><div>                        # real user</div><div>                        $rU = $avp(s:acc_callee_user_in);</div><div>                        xlog("L_INFO", "Local user online, using extension as user - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n");</div><div>                }</div><div>                else</div><div>                {</div><div>                        if($avp(s:callee_base_user) != $null)</div><div>                        {</div><div>                                if($avp(s:callee_base_cli) != $null && $avp(s:callee_extension) != $null)</div><div>                                {</div><div>                                        $rU = $avp(s:callee_base_cli) + $avp(s:callee_extension);</div><div>                                }</div><div>                                else</div><div>                                {</div><div>                                        $rU = $var(orig_ruri_user);</div><div>                                }</div><div>                        }</div><div>                        xlog("L_INFO", "Local user online, using base as user - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n");</div><div><font class="Apple-style-span" color="#3100FF">                }</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#3100FF">                </font></span><font class="Apple-style-span" color="#3100FF">else</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#3100FF">             </font></span><font class="Apple-style-span" color="#3100FF">{</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#3100FF">                        </font></span><font class="Apple-style-span" color="#3100FF">if ( $si==$dd || $si==rd) {</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#3100FF">                                xlog("L_INFO", "Detected Two Clients Behind the Same NAT - Disabling RTPproxy");</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#3100FF">           </font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#3100FF">                                # Do not use rtpproxy as the clients seem to be behind the same NAT</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#3100FF">                                 resetflag(6);</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#3100FF">               </font></span><font class="Apple-style-span" color="#3100FF">                 route(ROUTE_STOP_RTPPROXY); </font><font class="Apple-style-span" color="#FF0000"><b> ./ I could leave this out, but I think just to make 100% sure RTPProxy is disabled */</b></font></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#3100FF">                          }</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#3100FF">                }</font></div><div><br></div><div>                t_on_failure("FAILURE_ROUTE_LOCAL");</div><div>                route(ROUTE_OUTBOUND);</div><div>        }</div><div>        exit;</div><div><br></div><div>}</div></div><div>>>>>>>>>>> SNIP >>>>>>>>>>>>>></div><div><br></div><div><br></div><div><br><div>Thank you again</div><div><br></div><div>Regards</div><div>Deon</div><div><br></div><div><br></div><div><br><div><div>On Jan 6, 2011, at 8:10 PM, Daniel Tiefnig wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 01/06/2011 01:59 PM, Deon Vermeulen wrote:<br><blockquote type="cite">The kamailio scripts are a bit over my head, so I'm trying to <br></blockquote><blockquote type="cite">understand how the scripts handle NAT, especially when 2 UAs are <br></blockquote><blockquote type="cite">behind the same NAT Device.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Will mediaproxy be used or will the RTP stream go from UA to UA?<br></blockquote><br>The media stream will be routed via the media proxy, 'cause we can't<br>know whether the devices are in the same subnet. Even if they are behind<br>the same NAT gateway, there can be several subnets behind it and we<br>don't know how big these are and whether traffic is routed/allowed<br>between them.<br><br>br,<br>daniel<br><br>_______________________________________________<br>Spce-user mailing list<br><a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a><br>http://lists.sipwise.com/listinfo/spce-user<br></div></blockquote></div><br></div></div></div></body></html>