<div dir="ltr">While I could to this as you said,  my DB Server does not have inet_aton ...<div style>( Im using db_cassandra )</div><div style><br></div><div style>My DB simply returns a single string with a list of comma separated values.</div>

<div style>I then used s.select and while to achieve what I wanted.<br></div><div style><br></div><div style><div>        $var(i) = 0;</div><div>        while ( $(avp(i:2){s.select,$var(i),,}) != '' ) {</div><div>

          if (is_in_subnet( $si , $(avp(i:2){s.select,$var(i),,}) )) {<br></div><div style>            << DO SOMETHING >><br></div><div>            break;</div><div>          };</div><div>          $var(i) = $var(i) + 1;</div>

<div>        }<br></div><div><br></div><div style>sorry for any confusion.... </div><div style>avp(i:2) looks like <a href="http://192.168.1.0/24,172.16.1.0/24">192.168.1.0/24,172.16.1.0/24</a><br></div><div><br></div><div style>

this should be fine for now, but how good would it be if ipops module could handle this in a single function call ?</div><div><br></div></div><div style><br></div><div style><br></div><div style><br></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On 14 January 2014 20:17, Daniel Tryba <span dir="ltr"><<a href="mailto:daniel@pocos.nl" target="_blank">daniel@pocos.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Monday 13 January 2014 13:06:56 jay binks wrote:<br>
> So Im looking at a way of implementing IP Network ACL's in kamailio..<br>
><br>
> block all except specific subnets etc..<br>
><br>
</div>[multiple cidrs]<br>
<div class="im">><br>
> is there a benevolent kamailio developer on the list who is able to add<br>
> this simple feature for me ?<br>
<br>
</div>I'm using mysql to do this, but a little math makes it work from any source.<br>
usr_preference contains stuff like <a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a> or something stricter, implicit<br>
denies for users without acl records.<br>
<br>
route[ACL]<br>
{<br>
        if(!avp_db_query("select value from usr_preferences where<br>
username='$au' and attribute='acl' and<br>
inet_aton(substring_index(value,'/',1))&(1 << 32) - 1 & ~((1 << (32 -<br>
substring_index(value,'/',-1))) - 1)=inet_aton('$si')&(1 << 32) - 1 & ~((1 <<<br>
(32 - substring_index(value,'/',-1))) - 1)"))<br>
        {<br>
                sl_send_reply("403", "Not Allowed by ACL");<br>
                exit;<br>
        }<br>
<br>
        return;<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
<br>
POCOS B.V. - Croy 9c - 5653 LC Eindhoven<br>
Telefoon: <a href="tel:040%20293%208661" value="+61402938661">040 293 8661</a> - Fax: <a href="tel:040%20293%208658" value="+61402938658">040 293 8658</a><br>
<a href="http://www.pocos.nl/" target="_blank">http://www.pocos.nl/</a>   - <a href="http://www.sipo.nl/" target="_blank">http://www.sipo.nl/</a><br>
K.v.K. Eindhoven 17097024<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Sincerely<br><br>Jay
</div>