[SR-Users] subnet match

Hugh Waite hughw273 at gmail.com
Wed Mar 14 07:22:12 CET 2018


Hi,
The log message doesn't quite match your code sample. The code puts the
subnet into the log, but your output does not have the /16 (in red below).
Could you repeat and print all the avp's before and after is-in-subnet()?

I can't remember if the subnet needs to have the lowest bits masked, but I
will check and get back. (I.e. 10.0.1.0/16)

Regards,
Hugh


On 13 Mar 2018 11:20 p.m., <volga629 at networklab.ca> wrote:

Hello Everyone,
Not sure what I am missing, but can't match ip address to subnet

Log says

 INFO: <script>: Subnets not match processing rtp...destination ip [
10.0.1.242] and sourceip [10.0.1.241]


       if(is_method("INVITE")) {
               $avp(destip)=$(du{s.select,1,:});
               $avp(subnet) = $avp(destip) + "/16";
               xlog("L_INFO", "Initial Request: [$rm] destination ip
[$avp(destip)] and sourceip [$si]\n");
               if(!is_in_subnet("$si", "$avp(subnet)")) {
                       xlog("L_INFO", "Subnets not match processing
rtp...destination ip [$avp(subnet)] and source ip [$si]\n");
                       route(RTP_MANAGE);
               }
       }



[root at prx00 ~]# rpm -qa | grep kamailio
kamailio-mysql-5.1.2-2.git4c840b7e9.fc27.x86_64
kamailio-5.1.2-2.git4c840b7e9.fc27.x86_64


Slava.


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180314/fe326b3f/attachment.html>


More information about the sr-users mailing list