|
@@ -35,7 +35,7 @@ Henning Westerholt
|
|
|
4. Functions
|
|
|
|
|
|
4.1. geoip2_match(ipaddr, pvc)
|
|
|
- 4.2. distance(ip_addr, latitude, longitude)
|
|
|
+ 4.2. geoip2_distance(ip_addr, latitude, longitude)
|
|
|
|
|
|
5. RPC Commands
|
|
|
|
|
@@ -48,7 +48,7 @@ Henning Westerholt
|
|
|
1.1. Set path parameter
|
|
|
1.2. Set resid parameter
|
|
|
1.3. geoip2_match usage
|
|
|
- 1.4. distance usage
|
|
|
+ 1.4. geoip2_distance usage
|
|
|
1.5. geoip2.reload usage
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
@@ -69,7 +69,7 @@ Chapter 1. Admin Guide
|
|
|
4. Functions
|
|
|
|
|
|
4.1. geoip2_match(ipaddr, pvc)
|
|
|
- 4.2. distance(ip_addr, latitude, longitude)
|
|
|
+ 4.2. geoip2_distance(ip_addr, latitude, longitude)
|
|
|
|
|
|
5. RPC Commands
|
|
|
|
|
@@ -154,7 +154,7 @@ if(geoip2_match("$si", "src")) {
|
|
|
4. Functions
|
|
|
|
|
|
4.1. geoip2_match(ipaddr, pvc)
|
|
|
- 4.2. distance(ip_addr, latitude, longitude)
|
|
|
+ 4.2. geoip2_distance(ip_addr, latitude, longitude)
|
|
|
|
|
|
4.1. geoip2_match(ipaddr, pvc)
|
|
|
|
|
@@ -169,19 +169,20 @@ if(geoip2_match("$si", "src"))
|
|
|
xlog("SIP message from: $gip2(src=>cc)\n");
|
|
|
...
|
|
|
|
|
|
-4.2. distance(ip_addr, latitude, longitude)
|
|
|
+4.2. geoip2_distance(ip_addr, latitude, longitude)
|
|
|
|
|
|
The function calculates the distance in miles between the
|
|
|
geocoordinates of the IP address passed as parameter (the coordinates
|
|
|
are calculated inside the function) and the geocoordinates latitude and
|
|
|
longitude
|
|
|
|
|
|
- Example 1.4. distance usage
|
|
|
+ Example 1.4. geoip2_distance usage
|
|
|
...
|
|
|
$var(client_ip) = "109.184.18.64";
|
|
|
$var(lat_pos) = "53.200660";
|
|
|
$var(lon_pos) = "45.004640";
|
|
|
- $var(dist) = distance($var(client_ip), $var(lat_pos), $var(lon_pos));
|
|
|
+ $var(dist) = geoip2_distance($var(client_ip), $var(lat_pos), $var(lon_po
|
|
|
+s));
|
|
|
|
|
|
xlog("distance is $var(dist)\n");
|
|
|
...
|