<p dir="ltr">Let me know how do you test it?<br>
You should write it in Request-route block</p>
<div class="gmail_quote">On 30 Jun 2017 13:04, "vuleetu" <<a href="mailto:vuleetu@gmail.com">vuleetu@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I tried, but no luck. Could you tell which route block i should place these code to?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 29, 2017 at 10:57 PM, Mojtaba <span dir="ltr"><<a href="mailto:mespio@gmail.com" target="_blank">mespio@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
I wrote this code, I check do the both peers are in the same network<br>
or not. It works correctly.<br>
# Check if both peers are in the same network(nat).<br>
if (is_method("INVITE")){<br>
lookup("location","m");<br>
$var(x) = $(ru{s.select,1,@});<br>
$var(y) = $(var(x){s.select,0,:});<br>
if ($var(y) == $si)<br>
$var(nat) = "yes";<br>
else<br>
$var(nat) = "no";<br>
<br>
}<br>
With Regagrds.<br>
Mojtaba Esfandiari.S<br>
<div class="m_6750778964013150648HOEnZb"><div class="m_6750778964013150648h5"><br>
On Thu, Jun 29, 2017 at 6:57 PM, vuleetu <<a href="mailto:vuleetu@gmail.com" target="_blank">vuleetu@gmail.com</a>> wrote:<br>
> Hi, all<br>
><br>
> Is there any way to get remote ip address of both sender($si) and<br>
> receiver(?)? I am configuring kamailio with multiple rtpproxy sets.<br>
> Basically, rtpproxy set will be choosed based on the country those ip<br>
> addresses of caller and callee belong to. Lets say if caller and callee are<br>
> both in US, set 1 will selected. If they are not in the same country, set 2<br>
> will be selected. I dont know if there is any way to do that.<br>
><br>
><br>
> Best regards<br>
><br>
> Fisher<br>
><br>
</div></div><span class="m_6750778964013150648im m_6750778964013150648HOEnZb">> ______________________________<wbr>_________________<br>
> Kamailio (SER) - Users Mailing List<br>
> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi<wbr>-bin/mailman/listinfo/sr-users</a><br>
><br>
<br>
<br>
<br>
</span><span class="m_6750778964013150648HOEnZb"><font color="#888888">--<br>
--Mojtaba Esfandiari.S<br>
</font></span><div class="m_6750778964013150648HOEnZb"><div class="m_6750778964013150648h5"><br>
______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi<wbr>-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div>