Module: kamailio
Branch: master
Commit: 02c60ed584e486f276ff97b915b127b99432cca1
URL: 
https://github.com/kamailio/kamailio/commit/02c60ed584e486f276ff97b915b127b99432cca1

Author: pepelux <pepel...@gmail.com>
Committer: pepelux <pepel...@gmail.com>
Date: 2025-08-26T21:21:18+02:00

secfilter: Documentation updated regarding country filtering [skip ci]

---

Modified: src/modules/secfilter/doc/secfilter_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/02c60ed584e486f276ff97b915b127b99432cca1.diff
Patch: 
https://github.com/kamailio/kamailio/commit/02c60ed584e486f276ff97b915b127b99432cca1.patch

---

diff --git a/src/modules/secfilter/doc/secfilter_admin.xml 
b/src/modules/secfilter/doc/secfilter_admin.xml
index 8f2493f1711..85782bb9330 100644
--- a/src/modules/secfilter/doc/secfilter_admin.xml
+++ b/src/modules/secfilter/doc/secfilter_admin.xml
@@ -350,16 +350,29 @@
                <listitem>-2 = the value is blacklisted</listitem>
                </itemizedlist>
                </para>
+               <para>
+               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.
+               </para>
 
        <example>
          <title><function>secf_check_country</function> usage</title>
 
          <programlisting format="linespecific">
                ...
+       if (geoip2_match("$si", "src")) {
+                secf_check_country($gip2(src=>cc));
+                if ($? == -2) {
+                        xdbg("$rm from $si blocked because Country 
'$gip2(src=>cc)' is blacklisted");
+                        exit;
+                }
+        }
+
+               ...
+
         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 ($avp(secfilter) != 2) {
+                        xlog("L_ALERT", "$rm from $si blocked because Country 
'$gip2(src=>cc)' is not whitelisted");
                         exit;
                 }
         }

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to