Hi Andrew,<br>Yes, I've tried that, and it seems to be working, but the problem is following. I have clients who connect both from LAN and from WAN. So, on incoming INVITE request I can do nat_uac_test("4") to check if request's latest VIA is from Internet. Then I do a lookup on clients to find out where is that client connected from. But how do I check if that's an Internet IP address or not? I will have something like "<a href="http://sip:9999999@10.65.1.1:5060">sip:9999999@10.65.1.1:5060</a>" in there in case of LAN, but it can be ANY private or Internet IP address. Right now on my test server I'm doing ugly thing like this:<br>
<br> if (is_method("INVITE"))<br> {<br> if (has_body("application/sdp"))<br> {<br> if (nat_uac_test("4"))<br> {<br> xlog("Call from LAN");<br>
if (!$ru=~"10.65.\d{1,3}\.\d{1,3}")<br> {<br> xlog("PROXY: $fU->$tU, LAN to WAN, $ci\n");<br> if (!rtpproxy_offer("fieoc"))<br>
{<br> xlog("ERROR: Unable to offer RTP Proxy, $ci\n");<br> sl_send_reply("500","Internal Server Error RTP");<br> exit;<br>
}<br> }<br> else<br> {<br> xlog("PROXY: $fU->$tU, LAN to LAN, $ci\n");<br> if (!rtpproxy_offer("fiioc"))<br>
{<br> xlog("ERROR: Unable to offer RTP Proxy, $ci\n");<br> sl_send_reply("500","Internal Server Error RTP");<br> exit;<br>
}<br> }<br> }<br> else<br> {<br> xlog("Call from Internet");<br> if (!$ru=~"10.65.\d{1,3}\.\d{1,3}")<br>
{<br> xlog("PROXY: $fU->$tU, WAN to WAN, $ci\n");<br> if (!rtpproxy_offer("feeoc"))<br> {<br> xlog("ERROR: Unable to offer RTP Proxy, $ci\n");<br>
sl_send_reply("500","Internal Server Error RTP");<br> exit;<br> }<br> }<br> else<br> {<br>
xlog("PROXY: $fU->$tU, WAN to LAN, $ci\n");<br> if (!rtpproxy_offer("feioc"))<br> {<br> xlog("ERROR: Unable to offer RTP Proxy, $ci\n");<br>
sl_send_reply("500","Internal Server Error RTP");<br> exit;<br> }<br> }<br> }<br> }<br>
<br><br>Which seems to be working, but that's really ugly and not efficient. If only I could do nat_uac_test on outgoing client's R-URI - that would simplify things a lot! Do you have any ideas how to implement something like that? Because right now I'm analyzing against one network, of course, I can add regex to check for private LAN IP in there, but I really don't like such solution...<br>
<br>Thanks for answering!<br><br><div class="gmail_quote">2011/8/17 Andrew Pogrebennyk <span dir="ltr"><<a href="mailto:andrew.pogrebennyk@portaone.com">andrew.pogrebennyk@portaone.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Yuri,<div class="im"><br>
<br>
On 17.08.2011 07:27, Yuri Kirsanov wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Do you have any idea why is it behaving this way? I'm using OpenSIPS 1.6.4 and RTP Proxy 1.2.1 without any patches. I'm not using "mhomed=1" option, I'm using "force_send_socket()" on outgoing calls from Internet client to LAN and it works fine. Should I also use that command for outgoing calls from LAN to Internet client? But that shouldn't affect RTP Proxy behavior, shouldn't it? Also, I've tried to use "r" and "w" options when invoking RTP Proxy, but that doesn't help.<br>
</blockquote>
<br></div>
Have you tried using options "ie" for calls from lan to internet, "ei" vice versa and "ee" for calls from one client on the internet to another? This used to work for me.. one flag i|e may be not enough.<br>
<font color="#888888">
<br>
-- <br>
Sincerely,<br>
Andrew Pogrebennyk<br>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
</font></blockquote></div><br>