diff --git a/src/modules/geoip2/README b/src/modules/geoip2/README index 80691c55168..a8ebc98adfb 100644 --- a/src/modules/geoip2/README +++ b/src/modules/geoip2/README @@ -30,6 +30,7 @@ Henning Westerholt 3. Parameters 3.1. path (string) + 3.2. resid (str) 4. Functions @@ -44,8 +45,9 @@ Henning Westerholt List of Examples 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 @@ -60,6 +62,7 @@ Chapter 1. Admin Guide 3. Parameters 3.1. path (string) + 3.2. resid (str) 4. Functions @@ -115,6 +118,7 @@ Chapter 1. Admin Guide 3. Parameters 3.1. path (string) + 3.2. resid (str) 3.1. path (string) @@ -127,6 +131,23 @@ Chapter 1. Admin Guide 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.1. geoip2_match(ipaddr, pvc) @@ -135,8 +156,10 @@ modparam("geoip2", "path", "/usr/local/share/GeoIP/GeoLite2-City.mmdb") Match ipaddr against the GeoIP database and set the pvc container. The function has to be called before accessing a key via: $gip2(pvc=>key). + At least one function needs to be present that access the pvc + container, otherwise this function will not work. - Example 1.2. geoip2_match usage + Example 1.3. geoip2_match usage ... if(geoip2_match("$si", "src")) xlog("SIP message from: $gip2(src=>cc)\n"); @@ -151,7 +174,7 @@ if(geoip2_match("$si", "src")) Reload the internal GeoIP database. This is necessary after the database file has been changed on the disk. - Example 1.3. geoip2.reload usage + Example 1.4. geoip2.reload usage ... kamcmd geoip2.reload ...