|
@@ -30,6 +30,7 @@ Henning Westerholt
|
|
3. Parameters
|
|
3. Parameters
|
|
|
|
|
|
3.1. path (string)
|
|
3.1. path (string)
|
|
|
|
+ 3.2. resid (str)
|
|
|
|
|
|
4. Functions
|
|
4. Functions
|
|
|
|
|
|
@@ -44,8 +45,9 @@ Henning Westerholt
|
|
List of Examples
|
|
List of Examples
|
|
|
|
|
|
1.1. Set path parameter
|
|
1.1. Set path parameter
|
|
- 1.2. geoip2_match usage
|
|
|
|
- 1.3. geoip2.reload usage
|
|
|
|
|
|
+ 1.2. Set resid parameter
|
|
|
|
+ 1.3. geoip2_match usage
|
|
|
|
+ 1.4. geoip2.reload usage
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
Chapter 1. Admin Guide
|
|
|
|
|
|
@@ -60,6 +62,7 @@ Chapter 1. Admin Guide
|
|
3. Parameters
|
|
3. Parameters
|
|
|
|
|
|
3.1. path (string)
|
|
3.1. path (string)
|
|
|
|
+ 3.2. resid (str)
|
|
|
|
|
|
4. Functions
|
|
4. Functions
|
|
|
|
|
|
@@ -115,6 +118,7 @@ Chapter 1. Admin Guide
|
|
3. Parameters
|
|
3. Parameters
|
|
|
|
|
|
3.1. path (string)
|
|
3.1. path (string)
|
|
|
|
+ 3.2. resid (str)
|
|
|
|
|
|
3.1. path (string)
|
|
3.1. path (string)
|
|
|
|
|
|
@@ -127,6 +131,23 @@ Chapter 1. Admin Guide
|
|
modparam("geoip2", "path", "/usr/local/share/GeoIP/GeoLite2-City.mmdb")
|
|
modparam("geoip2", "path", "/usr/local/share/GeoIP/GeoLite2-City.mmdb")
|
|
...
|
|
...
|
|
|
|
|
|
|
|
+3.2. resid (str)
|
|
|
|
+
|
|
|
|
+ Preregister result container id during initialization, enabling the use
|
|
|
|
+ of the module in KEMI scripts. In native Kamailio.cfg file,
|
|
|
|
+ registration is done when parsing config and finding variables.
|
|
|
|
+
|
|
|
|
+ Default value is “” (empty).
|
|
|
|
+
|
|
|
|
+ Example 1.2. Set resid parameter
|
|
|
|
+...
|
|
|
|
+modparam("geoip2", "resid", "src")
|
|
|
|
+...
|
|
|
|
+if(geoip2_match("$si", "src")) {
|
|
|
|
+ ...
|
|
|
|
+}
|
|
|
|
+...
|
|
|
|
+
|
|
4. Functions
|
|
4. Functions
|
|
|
|
|
|
4.1. geoip2_match(ipaddr, pvc)
|
|
4.1. geoip2_match(ipaddr, pvc)
|
|
@@ -138,7 +159,7 @@ modparam("geoip2", "path", "/usr/local/share/GeoIP/GeoLite2-City.mmdb")
|
|
At least one function needs to be present that access the pvc
|
|
At least one function needs to be present that access the pvc
|
|
container, otherwise this function will not work.
|
|
container, otherwise this function will not work.
|
|
|
|
|
|
- Example 1.2. geoip2_match usage
|
|
|
|
|
|
+ Example 1.3. geoip2_match usage
|
|
...
|
|
...
|
|
if(geoip2_match("$si", "src"))
|
|
if(geoip2_match("$si", "src"))
|
|
xlog("SIP message from: $gip2(src=>cc)\n");
|
|
xlog("SIP message from: $gip2(src=>cc)\n");
|
|
@@ -153,7 +174,7 @@ if(geoip2_match("$si", "src"))
|
|
Reload the internal GeoIP database. This is necessary after the
|
|
Reload the internal GeoIP database. This is necessary after the
|
|
database file has been changed on the disk.
|
|
database file has been changed on the disk.
|
|
|
|
|
|
- Example 1.3. geoip2.reload usage
|
|
|
|
|
|
+ Example 1.4. geoip2.reload usage
|
|
...
|
|
...
|
|
kamcmd geoip2.reload
|
|
kamcmd geoip2.reload
|
|
...
|
|
...
|