<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:10pt"><div><span>HI Saul,</span></div><div><br><span></span></div><div><span>Thanks for confirming. :)<br></span></div><div><br><span></span></div><div><span>So Shall I use </span>  fix_nated_sdp("1"); or comment out use of   fix_nated_sdp("3"); to fix the problem.</div><div><br></div><div>This wont affect anything I guess since it's a incorrect configuration .</div><div><br></div><div>Thanks<br></div><div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 10pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Saúl Ibarra Corretgé &lt;saul@ag-projects.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> Pasan Meemaduma &lt;pasandev@ymail.com&gt;<br><b><span
 style="font-weight: bold;">Cc:</span></b> OpenSIPS users mailling list &lt;users@lists.opensips.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, July 21, 2011 12:29 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [OpenSIPS-Users] media-proxy invalid IP in sdp<br></font><br>Hi,<br><br>On Jul 21, 2011, at 8:50 AM, Pasan Meemaduma wrote:<br><br>&gt; HI Saul,<br>&gt; <br>&gt; Further I have below in my config , Is this cause the problem ?<br>&gt; <br>&gt; <br>&gt;&nbsp; &nbsp; if (loose_route()) {<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  if(!has_totag()) {<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  sl_send_reply("403", "Initial loose-routing rejected");<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  exit;<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  }<br>&gt; <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  if(nat_uac_test("19") || search("^Route:.*;nat=yes")) {<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
 if(!search("^Content-Length:[ ]*0")) {<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  fix_nated_sdp("3");<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  setbflag(2);<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  }<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  append_hf("P-hint: rr-enforced\r\n");<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  route(1);<br>&gt;&nbsp; &nbsp;  }<br>&gt; <br>&gt; Is fix_nated_sdp() cause source address being append to sdp and media proxy ip 58.96.1.2 is append by use_media_proxy() ?<br>&gt; <br><br>Yes, indeed. Using both fix_nated_sdp and use_media_proxy will modify the same SDP field and because of how modifications are applied to messages by OpenSIPS, you'll end up with a mess.<br><br>When a function modifies a message it doesn't really apply the modification right away, it appends a 'lump', imagine its a modification marker, and later, when the message is about to
 be sent out, all modifications are applied. Because you are calling fix_nated_sdp *and* use_media_proxy, two lumps will be added and both modify the c line in the SDP -&gt; bad thing.<br><br>&gt; If this is the case how can I fix the config. Will commenting out&nbsp; fix_nated_sdp("3"); fix the problem.<br>&gt; <br><br>If you use MediaProxy stick to the functions provided by the MediaProxy module, when it comes to modifying the SDP. You may also use the engage_mediaproxy function, which uses the dialog module to internally call use_media_proxy and end_media_session so you don't need to call them manually.<br><br><br>Regards,<br><br>--<br>Saúl Ibarra Corretgé<br>AG Projects<br><br><br><br><br><br></div></div></div></body></html>