Hi there
It must work fine. I've just tested it:
kamailio.cfg
xinfo("Checking source IP $si");
secf_check_ip();
xinfo("Result of sec_check_ip: $?");
kamailio.log
Aug 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.54
Are 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:
Regards