Hi Alex,<br><br>Actually what I&#39;m trying to do is check the IPs on a request on a Kamailio+RTPProxy acting as border of our network.<br><br>So I have the ingress IP and egress IP and need to check if I have to bridge ii, ei, ie or ee.<br>
I managed to obtain all IPs in AVPs, but now I have to check if they are public or private.<br><br>So far our network uses only 192.168.x.x class for private servers.<br><br>Thanks for the quick reply<br>Uriel<br><br><div class="gmail_quote">
On Fri, Mar 26, 2010 at 10:56 AM, Alex Balashov <span dir="ltr">&lt;<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<a href="http://172.16.0.0/12" target="_blank">172.16.0.0/12</a> does not line up on octet boundaries.  You will need to do something other than a regular expression.  Fortunately, &#39;src_ip&#39; is a composite that supports comparisons against subnets in shorthand CIDR notation.<br>

<br>
It might also be that whatever you are trying to accomplish can be done better some other way, but since you did not pose the question in terms of the objective, I cannot speak to that.<br>
<br>
--<br>
Sent from mobile device<div><div></div><div class="h5"><br>
<br>
On Mar 26, 2010, at 9:46 AM, Uriel Rozenbaum &lt;<a href="mailto:uriel.rozenbaum@gmail.com" target="_blank">uriel.rozenbaum@gmail.com</a>&gt; wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
Hi guys,<br>
<br>
Does anyone have a REGEX syntax to match a private IP on the 192.168.x.x range?<br>
<br>
I&#39;m trying with:<br>
if($avp(s:ip_origen)=~&quot;192.168(\.([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})){2}&quot; )<br>
<br>
But all IPs pass as private, even public ones.<br>
<br>
Thanks!<br>
Uriel<br></div></div>
_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote>
</blockquote></div><br>