diff --git a/README.md b/README.md index 8af0449..103527e 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,27 @@ cat > /etc/logrotate.d/iptables-api << EOF EOF ``` +## Kamailio Example + +```bash +loadmodule "http_client.so" +loadmodule "htable.so" +... +modparam("htable", "htable", "ipban=>size=8;autoexpire=600;") +... +if (!pike_check_req()) { + xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n"); + $sht(ipban=>$si) = 1; + http_client_query("http://localhost:8082/addip/$si", "$var(apinfo)"); + exit; +} +... +event_route[htable:expired:ipban] { + xlog("mytable record expired $shtrecord(key) => $shtrecord(value)\n"); + http_client_query("http://localhost:8082/removeip/$shtrecord(key)", "$var(apinfo)"); +} +``` + ## License / Warranty iptables-api is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version diff --git a/iptables-api-arm b/iptables-api-arm new file mode 100755 index 0000000..bdf28f6 Binary files /dev/null and b/iptables-api-arm differ