Permalink
Browse files

cleaning up

  • Loading branch information...
titpetric committed Jun 4, 2010
1 parent 51c49ae commit 1a66190076f8ac2939997d6a69c9a6422542d745
Showing with 24 additions and 1 deletion.
  1. +1 −0 build/README
  2. +10 −0 conf/Application.xml
  3. +11 −0 conf/README
  4. +2 −1 src/GeoIP.java
View
@@ -0,0 +1 @@
+Build dir for Wowza GeoIP Module
View
@@ -40,6 +40,16 @@
<Type>String</Type>
</Property>
+ <!-- GeoIPDatabase: default location: /usr/share/GeoIP/GeoIP.dat
+
+ <Property>
+ <Name>GeoIPDatabase</Name>
+ <Value>/path/to/your/GeoIP.dat</Value>
+ <Type>String</Type>
+ </Property>
+
+ -->
+
<!-- snip -->
</Properties>
View
@@ -0,0 +1,11 @@
+Application.xml
+
+File contains snippets you should add to your Application.xml config.
+
+Snipets cover module loading, and configuration of module (config locations
+for the GeoIP database, locationinfo.xml and default restrictions)
+
+example-locationinfo.xml
+
+This is the expected config file by the GeoIP module. You can modify
+this as you wish. Suitable for live & vod streams.
View
@@ -50,7 +50,8 @@ public boolean allowPlayback(String streamName, String IPAddress)
// resolve country by ip
String CountryCode = "--";
try {
- LookupService cl = new LookupService("/usr/share/GeoIP/GeoIP.dat", LookupService.GEOIP_MEMORY_CACHE);
+ String GeoIPDatabase = ServerSideParameters.getPropertyStr("GeoIPDatabase","/usr/share/GeoIP/GeoIP.dat");
+ LookupService cl = new LookupService(GeoIPDatabase, LookupService.GEOIP_MEMORY_CACHE);
CountryCode = cl.getCountry(IPAddress).getCode();
getLogger().info("GEO Country: "+IPAddress+" => "+CountryCode);
} catch(Exception e) {

0 comments on commit 1a66190

Please sign in to comment.