Attached is a patch implementing a light-weight wrapper around the MaxMind GeoIP API. It adds IP address-to-location lookup capability to OpenSIPS scripts.
Lookups are executed against the freely-available GeoLite City database; and the non-free GeoIP City database is drop-in compatible. All lookup fields provided by the API are accessible by the script. Visit the MaxMind website (http://www.maxmind.com/app/geolitecity) for more information on the location databases.
The patch includes the requisite documentation.