Hi thereIt must work fine. I've just tested it:
_______________________________________________kamailio.cfgxinfo("Checking source IP $si");
secf_check_ip();
xinfo("Result of sec_check_ip: $?");kamailio.logAug 12 16:17:38 pepelux /usr/local/sbin/kamailio[23304]: INFO: <script>: Checking source IP 85.XXX.YYY.54
Aug 12 16:17:38 pepelux /usr/local/sbin/kamailio[23304]: INFO: <script>: Result of sec_check_ip: 2# kamcmd secfilter.print ip
IP Address
==========
[+] Blacklisted
-----------[+] Whitelisted
-----------
0001 -> 85.XXX.YYY.54Are you sure that the secf_check_ip() function is executed? Could you put a log before or after to verify it?On the other hand, 0 is not a possible return value. If the IP address is not found, the return value will be 1:RegardsOn Tue, 11 Aug 2020 at 21:47, PICCORO McKAY Lenz <mckaygerhard@gmail.com> wrote:_______________________________________________I implemented secfilter in a simple way, in first step routing put that conditional for black list check that already works:
BUT NOW i want to change to whitelick checks, so i reviewed the docs and "2" is resulting for whitelist, so then i said "if not whitelisted so block" using "!= 2" as on https://www.kamailio.org/wiki/cookbooks/5.3.x/core#operators BUT SEEMS DOES NOT WORK: that is the code:when i tested all the calls passed not matter if are in the table or not as whitelist!I want able to call only if are present and whitelisted the ip address.. so i also tested with:to check if the ip address are presented in the table but call also passed and must not cos i not put never a entry in the table!Lenz McKAY Gerardo (PICCORO)
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users