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@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@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@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users