<html><body>
<p>Hi Doug,<br>
<br>
I had similar problem. My solution is to use record-route variable: add_rr_param(&quot;mr=1&quot;) on initial INVITE at same time as first call to use_media_relay(). The later within loose_route block, I use check_route_param(&quot;mr=1&quot;) for re-INVITES and then re-invoke media relay if found. In that case I also install a reply handler for the reinvite and set the bflag. The reinvite reply handler then checks the bflag and invokes use_media_proxy on the reply.  That solves the media problem for me.<br>
<br>
How are you handling the private IP in the Contact address in B's 200 response to A's re-INVITE? This contact address will become the R-URI of all subsequent in-dialog messages from A (e.g., INFO, MESSAGE, BYE).<br>
<br>
Regards,<br>
Kennard<br>
<br>
<img width="16" height="16" src="cid:1__=07BBFD29DFF1AC9F8f9e8a93df9@logitech.com" border="0" alt="Inactive hide details for Doug ---10/12/2010 08:47:39 AM---  Hi All, I've got a problem I'm not 100% sure how to resolve."><font color="#424282">Doug ---10/12/2010 08:47:39 AM---  Hi All, I've got a problem I'm not 100% sure how to resolve.</font><br>
<br>
<font size="2" color="#5F5F5F">From:        </font><font size="2">Doug &lt;doug@wd.co.za&gt;</font><br>
<font size="2" color="#5F5F5F">To:        </font><font size="2">OpenSIPS users mailling list &lt;users@lists.opensips.org&gt;</font><br>
<font size="2" color="#5F5F5F">Date:        </font><font size="2">10/12/2010 08:47 AM</font><br>
<font size="2" color="#5F5F5F">Subject:        </font><font size="2">[OpenSIPS-Users] NAT and Re-INVITE</font><br>
<font size="2" color="#5F5F5F">Sent by:        </font><font size="2">users-bounces@lists.opensips.org</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt>&nbsp; Hi All,<br>
<br>
I've got a problem I'm not 100% sure how to resolve.<br>
<br>
Ok the scenario is, client A is on a public interface, Client B is on a <br>
private IP address and has cflag 6 set in the location table.<br>
<br>
Client A calls Client B via Opensips.<br>
<br>
Now during the initial INVITE, opensips locates Client B, loads the <br>
information, and naturally bflag is set to 6 (my NAT flag). This then <br>
triggers mediaproxy to get involved, and the call is established <br>
correctly, media passes from Client A ----&gt; Mediaproxy ----&gt; Client B.<br>
<br>
Now the problem is, the Client A device (Audiocodes ATA) sends a <br>
Re-INVITE to switchover to T.38. The process works pretty much the same, <br>
but follows the loose_route path due the call already being in a dialog <br>
(i think thats the right terminology).<br>
<br>
Client B receives the Re-INVITE, however, because loose_route doesn't <br>
know about the bflag (I've check with xlog and its not set during this <br>
phase), mediaproxy is not engaged (as the INVITE is coming form Client A <br>
who is not behind NAT). So when Client B responds, the SDP is a private <br>
IP address, and the call falls apart.<br>
<br>
Now I suppose what I could do is call &quot;use_media_proxy()&quot; from the <br>
onreply_route if the SDP is RFC1918 (nat_uac_test(&quot;8&quot;)), however, this <br>
would engage mediaproxy for only one leg of the call and not the Client <br>
A leg.<br>
<br>
The other option is I can force mediaproxy on all calls, which works, <br>
but now I have to have RTP flowing through my links for devices that <br>
could be speaking directly to each other.<br>
<br>
Has anyone had experience with this, or an idea of how to check during <br>
the loose_route phase if the Client B sisde is behind nat, or set a flag <br>
that remains consistent throughout the entire call flow (INVITE, 200Ok, <br>
Re-INVITE, 200OK, BYE).<br>
<br>
I look forward to your assistance.<br>
<br>
Many thanks<br>
Doug<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
Users@lists.opensips.org<br>
</tt><tt><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></tt><tt><br>
</tt><br>
</body></html>