Order of GeoIP processing: Difference between revisions

From VoIPmonitor.org
(Add information about how to correct incorrect GeoIP data)
(Rewrite: add GeoIP use cases intro, consolidate manual import, improve tables)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
== This doc describes order of GeoIP location services used with voipmonitor GUI ==
{{DISPLAYTITLE:Order of GeoIP Processing}}
[[Category:Configuration]]


'''In the GUI settings''' -> system config -> '''GeoIP''' (You can define your keys for maxmind or ipinfodb.)
= GeoIP Processing =
* If you define keys for both providers the 'maxmind' have precedence.
* In case you don't define a key, the local db will be used instead (this local db is updated with each GUI release, its stored into local db.)
* In case you have no GeoIP data downloaded in local db (voipmonitor.org unacessible from GUI server), it will use following free(demo) portals in following order:
** ipinfodb
** freegeoip
** maxmind


== Correcting Incorrect GeoIP Data ==
VoIPmonitor uses GeoIP services to determine geographic location of IP addresses for:
* '''Anti-fraud alerts''' - Detecting calls to/from unexpected countries (see [[Anti-fraud]])
* '''CDR enrichment''' - Adding country information to call records
* '''Reporting''' - Country-based statistics and filtering


The GeoIP location data is sourced from MaxMind. If you encounter incorrect IP location information, you can help improve the database accuracy by submitting a correction request to MaxMind directly.
== Processing Priority ==


'''Procedure to submit a correction:'''
The system uses a fallback mechanism, trying each method in order until successful:
# Go to the MaxMind GeoIP Update Form: [https://www.maxmind.com/en/geoip-correction Submit a Correction Request]
# Fill out the form with the IP address, country, and other location details that need to be corrected
# Submit the correction request to MaxMind


After MaxMind updates their database:
<kroki lang="mermaid">
# Notify the VoIPmonitor support team about the correction you submitted
%%{init: {'flowchart': {'nodeSpacing': 15, 'rankSpacing': 40}}}%%
# The support team will release a new version of the GUI that includes the updated MaxMind database
flowchart TB
# Upgrade to the latest GUI version to get the corrected GeoIP data
    A[IP Address] --> B{MaxMind API}
    B -->|Success| Z[Return Country]
    B -->|Fail| C{IPInfoDB API}
    C -->|Success| Z
    C -->|Fail| D{Local Database}
    D -->|Success| Z
    D -->|Fail| E{Free Portals}
    E -->|Success| Z
    E -->|Fail| F[Unknown]
</kroki>


=== AI Summary for RAG ===
{| class="wikitable"
'''Summary:''' Describes the priority order for GeoIP services in VoIPmonitor (MaxMind API keys, local database, or free demo portals) and how to correct incorrect GeoIP data.
! Priority !! Method !! Notes
|-
| 1 || '''MaxMind API''' || Commercial service, highest accuracy. Requires API key.
|-
| 2 || '''IPInfoDB API''' || Alternative commercial API
|-
| 3 || '''Local Database''' || File-based (<code>GeoIPCity.dat</code>) OR MySQL tables
|-
| 4 || '''Free Portals''' || Online fallback services
|}


'''Keywords:''' GeoIP, MaxMind, IPInfoDB, geolocation, IP location, map, CDR, correction, update database
{{Tip|For best accuracy, configure MaxMind API with a valid license key.}}
 
== Configuration ==
 
'''GUI Path:''' Settings → System Configuration → GeoIP
 
=== Local Database Options ===
 
{| class="wikitable"
! Type !! Location/Table !! Description
|-
| File-based || <code>GeoIPCity.dat</code> || Legacy MaxMind format
|-
| MySQL IPv4 || <code>geoip_country</code> || Database table for IPv4
|-
| MySQL IPv6 || <code>geoipv6_country</code> || Database table for IPv6
|}
 
Version tracking is stored in the <code>system</code> table:
* <code>type='geoip_country_version'</code>
* <code>type='geoipv6_country_version'</code>
 
== Manual GeoIP Import ==
 
Use this when GUI "Update GeoIP" fails or completes partially (version shows correct but lookups fail).
 
'''Export from working server:'''
<syntaxhighlight lang="bash">
mysqldump -c voipmonitor geoip_country > gc.sql
mysqldump -c voipmonitor geoipv6_country > gc6.sql
</syntaxhighlight>
 
'''Import to affected server:'''
<syntaxhighlight lang="bash">
mysql voipmonitor < gc.sql
mysql voipmonitor < gc6.sql
</syntaxhighlight>
 
'''Update version tracking:'''
<syntaxhighlight lang="sql">
-- Replace '12' with actual version number from source
INSERT INTO system SET content='12\n', type='geoip_country_version';
INSERT INTO system SET content='12\n', type='geoipv6_country_version';
</syntaxhighlight>
 
{{Warning|1=Ensure database name matches your installation (default: <code>voipmonitor</code>).}}
 
== See Also ==
 
* [[Anti-fraud]] - Country-based fraud detection using GeoIP
* [[Groups#IP_Groups|IP Groups]] - Creating IP address groups for filtering
 
== AI Summary for RAG ==
 
'''Summary:''' Documents GeoIP processing priority in VoIPmonitor. Uses fallback mechanism: (1) MaxMind API (commercial, highest accuracy), (2) IPInfoDB API, (3) Local Database (file-based GeoIPCity.dat OR MySQL tables geoip_country/geoipv6_country), (4) Free Portals. GeoIP is used for anti-fraud alerts, CDR country enrichment, and reporting. Configuration via GUI Settings → System Configuration → GeoIP. Version tracking in system table (geoip_country_version, geoipv6_country_version). Manual import procedure: mysqldump from working installation, import to affected server, update version in system table.
 
'''Keywords:''' GeoIP, MaxMind, IPInfoDB, country lookup, IP geolocation, processing order, priority, fallback, local database, GeoIPCity.dat, MySQL tables, geoip_country, geoipv6_country, manual import, system table, geoip_country_version, anti-fraud, country detection


'''Key Questions:'''
'''Key Questions:'''
* What is the order of GeoIP services used by VoIPmonitor?
* What is the order of GeoIP processing in VoIPmonitor?
* How do I correct incorrect GeoIP location data?
* Which GeoIP service has highest priority?
* How does VoIPmonitor get GeoIP data for the map view?
* Where do I configure GeoIP services in VoIPmonitor?
* How to manually import GeoIP data when GUI update fails?
* What MySQL tables store GeoIP data?
* What is GeoIP used for in VoIPmonitor?

Latest revision as of 16:47, 8 January 2026


GeoIP Processing

VoIPmonitor uses GeoIP services to determine geographic location of IP addresses for:

  • Anti-fraud alerts - Detecting calls to/from unexpected countries (see Anti-fraud)
  • CDR enrichment - Adding country information to call records
  • Reporting - Country-based statistics and filtering

Processing Priority

The system uses a fallback mechanism, trying each method in order until successful:

Priority Method Notes
1 MaxMind API Commercial service, highest accuracy. Requires API key.
2 IPInfoDB API Alternative commercial API
3 Local Database File-based (GeoIPCity.dat) OR MySQL tables
4 Free Portals Online fallback services

💡 Tip: For best accuracy, configure MaxMind API with a valid license key.

Configuration

GUI Path: Settings → System Configuration → GeoIP

Local Database Options

Type Location/Table Description
File-based GeoIPCity.dat Legacy MaxMind format
MySQL IPv4 geoip_country Database table for IPv4
MySQL IPv6 geoipv6_country Database table for IPv6

Version tracking is stored in the system table:

  • type='geoip_country_version'
  • type='geoipv6_country_version'

Manual GeoIP Import

Use this when GUI "Update GeoIP" fails or completes partially (version shows correct but lookups fail).

Export from working server:

mysqldump -c voipmonitor geoip_country > gc.sql
mysqldump -c voipmonitor geoipv6_country > gc6.sql

Import to affected server:

mysql voipmonitor < gc.sql
mysql voipmonitor < gc6.sql

Update version tracking:

-- Replace '12' with actual version number from source
INSERT INTO system SET content='12\n', type='geoip_country_version';
INSERT INTO system SET content='12\n', type='geoipv6_country_version';

⚠️ Warning: Ensure database name matches your installation (default: voipmonitor).

See Also

  • Anti-fraud - Country-based fraud detection using GeoIP
  • IP Groups - Creating IP address groups for filtering

AI Summary for RAG

Summary: Documents GeoIP processing priority in VoIPmonitor. Uses fallback mechanism: (1) MaxMind API (commercial, highest accuracy), (2) IPInfoDB API, (3) Local Database (file-based GeoIPCity.dat OR MySQL tables geoip_country/geoipv6_country), (4) Free Portals. GeoIP is used for anti-fraud alerts, CDR country enrichment, and reporting. Configuration via GUI Settings → System Configuration → GeoIP. Version tracking in system table (geoip_country_version, geoipv6_country_version). Manual import procedure: mysqldump from working installation, import to affected server, update version in system table.

Keywords: GeoIP, MaxMind, IPInfoDB, country lookup, IP geolocation, processing order, priority, fallback, local database, GeoIPCity.dat, MySQL tables, geoip_country, geoipv6_country, manual import, system table, geoip_country_version, anti-fraud, country detection

Key Questions:

  • What is the order of GeoIP processing in VoIPmonitor?
  • Which GeoIP service has highest priority?
  • Where do I configure GeoIP services in VoIPmonitor?
  • How to manually import GeoIP data when GUI update fails?
  • What MySQL tables store GeoIP data?
  • What is GeoIP used for in VoIPmonitor?