<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I'm pleased to announce availability of the new 'mmgeoip' module, which adds runtime geo-location information to the OpenSIPS scripting environment. The following example prints out the latitude and longitude associated with the source IP address of the "current" message:</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier">modparam("mmgeoip", "mmgeoip_city_db_path", "/usr/share/GeoIP/GeoLiteCity.dat")</font></div><div><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier">...</font></div><div><div><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier">if(mmg_lookup("lon:lat",$si,$avp(lat_lon))) {</font></div><div><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier"> xlog("L_INFO","Source IP latitude:$(avp(lat_lon)[0])\n");</font></div><div><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier"> xlog("L_INFO","Source IP longitude:$(avp(lat_lon)[1])\n");</font></div><div><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier">};</font></div><div><br></div></div><div>Other geographic data available include country code, region, city, postal code, time zone and more, all described in the module documentation.</div><div><br></div><div>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 (<a href="http://www.maxmind.com/app/geolitecity">http://www.maxmind.com/app/geolitecity</a>) for more information on the location databases and the API.</div><div><br></div><div>The module was developed against a Gentoo Linux distribution. Please do send me your comments/suggestions for bringing it up on other distributions and platforms.</div><div><br></div><div>Cheers,</div><div><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><div>--</div><div>kobi</div></div><br class="Apple-interchange-newline"></span> </div><br></div></body></html>