Hi Josh.<br><br>An approach we used is execute an external script through function exec_msg; the script receives as argument the source ip address, and by external means, it checks whether it belongs to a particular subnet, defined on a table in database or a file; we used PHP and a table in MySQL with the reference subnets.<br>
<br>The script should return 0 or 1; when returns 0, exec_msg returns true, and when it returns 1; exec_msg returns false, so you can check it into an if statement.<br><br>Hope it helps.<br><br>Best regards.<br><br>Sergio Gutiérrez.<br>
<br><div class="gmail_quote">On Thu, Mar 20, 2008 at 4:34 PM, Josh Mahonin <<a href="mailto:jmahonin@cbnco.com">jmahonin@cbnco.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi folks,<br>
<br>
In my setup, I've got two disjoint subnets (call then A and B) that<br>
cannot communicate directly to each other, but devices on each can both<br>
communicate to my OpenSER server and Asterisk box (both on their own<br>
subnet, C). There is no NAT involved, so I only want to use rtpproxy<br>
when it's the case that device from subnet A attempts to call a device<br>
on subnet B, or vice-versa.<br>
<br>
I would ideally not like to use rtp proxy for communication between A-C<br>
and A-B (this will enable RTP media between both subnets, but that<br>
solution will not scale very well...)<br>
<br>
I'm attempting do something like this:<br>
<br>
if (src_ip == a.b.c.d/24 && dst_ip == w.x.y.z/24)<br>
use rtp proxy<br>
<br>
But unfortunately, on an INVITE, after a lookup, dst_ip is set to the<br>
OpenSER server. The pseudovariable $rd is set to the value I'd like to<br>
check against, but it complains loudly when I attempt to substitute<br>
dst_ip for $rd.<br>
<br>
Is there any way to use avp_check() or the like to verify that the value<br>
in $rd lies in a given subnet? I don't want to match just one IP, but a<br>
whole range. I found a similar question on the SER mailing list asked<br>
several years ago, with no response.<br>
<br>
Thanks,<br>
<br>
Josh<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.openser.org">Users@lists.openser.org</a><br>
<a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br>