<br><div class="gmail_quote">On Sun, Jan 25, 2009 at 3:06 AM, Iņaki Baz Castillo <span dir="ltr">&lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/1/24 mayamatakeshi &lt;<a href="mailto:mayamatakeshi@gmail.com">mayamatakeshi@gmail.com</a>&gt;:<br>
<div class="Ih2E3d">&gt; Hello,<br>
&gt; I&#39;m trying to understand this sample cfg:<br>
&gt; <a href="http://voip-info.org/wiki/view/OpenSER+And+RTPProxy" target="_blank">http://voip-info.org/wiki/view/OpenSER+And+RTPProxy</a><br>
&gt;<br>
&gt; This cfg is used as foundation for some of our cfg files here but nobody is<br>
&gt; sure about exactly how some things work. So I&#39;m trying to clear things up.<br>
&gt; In particular, I am clueless about why there is code removing &quot;nat=yes&quot; from<br>
&gt; the URI and adding it to the Contact header (actually I don&#39;t know what is<br>
&gt; its meaning. I suppose this is a way of a client advertising that it is<br>
&gt; behind NAT, but I couldn&#39;t find which RFC defines this):<br>
&gt;<br>
&gt; subst_uri(&#39;/(sip:.*);nat=yes/\1/&#39;)<br>
&gt;<br>
&gt; search_append(&#39;Contact:.*sip:[^&gt;[:cntrl:]]*&#39;, &#39;;nat=yes&#39;);<br>
&gt;<br>
&gt; Is this something that always must be done when dealing with nat or it was a<br>
&gt; particular situation that the writer of the cfg had to workaround?<br>
&gt; I&#39;m rewriting our cfg file (to be used with m4) and I&#39;m trying to remove<br>
&gt; unnecessary things.<br>
<br>
</div>The Contact header of the caller (in the initial INVITE) and the<br>
Contact header of the callee (in the 200 OK) remain &nbsp;during a dialog.<br>
This is, if the caller Contact contains<br>
&quot;sip:alice@domain;param=qwerty&quot; then when the callee creates an<br>
in-dialog request in that dialog (BYE, re-INVITE, INFO...) the RURI<br>
will be &quot;sip:alice@domain;param=qwerty&quot;.<br>
<br>
In this way, the trick is done by the proxy who adds that parameter<br>
&quot;nat=yes&quot; to the Contact of both (caller and callee) when the call is<br>
detected to be behind NAT. In this way, for in-dialog requests the<br>
proxy just must examine the RURI to know if the related dialog has NAT<br>
or not, and just in that case reuse RtpProxy and so.<br>
<br>
Another way is the proxy adding &quot;nat=yes&quot; parameter to the<br>
Record-Route header in the initial INVITE, since RR header will become<br>
a Route header in every in-dialog message for that dialog.</blockquote><div><br>
Iņaki, thanks, I got it now.&nbsp; <br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>


&gt; Another thing in the cfg: in case a reinvite is issued, should not<br>
&gt; unforce_rtp_proxy be called before force_rtp_proxy is called again? Could<br>
&gt; this lead to having rtpproxy leaking resources?<br>
<br>
</div>No, you should call RtpProxy with &quot;l&quot; parameter so it just will take<br>
an action is there is *already* a RTP session for that dialog.</blockquote><div>&nbsp;</div><div>OK. According to docs, &quot;I&quot; is on by default.<br>Regards,<br>mayama<br><br></div></div>