Ver Fonte

modules: readme files regenerated - secfilter ... [skip ci]

Kamailio Dev há 3 semanas atrás
pai
commit
5e3a9b3ead
1 ficheiros alterados com 18 adições e 3 exclusões
  1. 18 3
      src/modules/secfilter/README

+ 18 - 3
src/modules/secfilter/README

@@ -381,13 +381,28 @@ klisted");
      * -1 = error
      * -2 = the value is blacklisted
 
+   You can filter by blocking the IPs of messages coming from countries
+   that are on the blacklist. Alternatively, you can block everything that
+   is not explicitly on the whitelist.
+
    Example 1.11. secf_check_country usage
                 ...
         if (geoip2_match("$si", "src")) {
                 secf_check_country($gip2(src=>cc));
-                if ($avp(secfilter) == -2) {
-                        xlog("L_ALERT", "$rm from $si blocked because Country '$
-gip2(src=>cc)' is blacklisted");
+                if ($? == -2) {
+                        xdbg("$rm from $si blocked because Country '$gip2(src=>c
+c)' is blacklisted");
+                        exit;
+                }
+        }
+
+                ...
+
+        if (geoip2_match("$si", "src")) {
+                secf_check_country($gip2(src=>cc));
+                if ($? != 2) {
+                        xdbg("$rm from $si blocked because Country '$gip2(src=>c
+c)' is not whitelisted");
                         exit;
                 }
         }