JEP0080 Support in Wildire

Hi,

I’‘m using Wildfire as IM Server for Location Based Services. I have problems in dispatching XMPP User Geolocation InfoQuery Request’'s packets such as:

What’‘s the problem? Wildfire reject unknown packets by default? UserGeolocation JEP’'s is not implemented in Wildfire?

Thanks a lot for your support.

Hi,

JEP 0080 is not supported. You might want to vote for its support. You can get the list of supported JEP’'s here:

http://www.jivesoftware.org/builds/wildfire/docs/latest/documentation/protocol-s upport.html

Thanks, I supposed that. There’‘s no hack to by-pass this unsupported feature, such as skipping packet’'s filtering ?

By the way, how can I add JEP0080 support by myself with a plug-in?

Many thanks,

LP

Hi LP,

If you know Java, it’'s fairly straight forward. There are a couple of ways you could do this:

Considering your Wildfire host is localhost.localdomain, you could develop:

  1. A plugin class that implements PacketInterceptor for your host. A good sample code could be found in contentFilter plugin from Wildfire source code.

  2. A plugin class that implements Component. Your can register your component as e.g. geoloc.localhost.domain. Sample code: search plugin from Wildfire source code.

Wildfire source code could be downloaded from http://www.jivesoftware.org/source.jsp.

Guides to create plugin: http://www.jivesoftware.org/builds/wildfire/docs/latest/documentation/plugin-dev -guide.html

Ciao Loreto,

JEP-80 requires the server to implement Publish-Subscribe. JEP-80 is going to be modified in the near future to be based on PEP. Besides that the other functionalities are clients based. Therefore, you should be fine if you want to use JEP-80: User Geolocation with Wildfire.

Since you are getting some error packet when you send some IQ packet, it would be of help if you post the entire sent and received packet. I guess that the problem has to do with something else (eg. IQ packet sent to bare JID instead of full JID).

Regards,

– Gato

Hey Loreto,

I actually wrote a plugin like aznidin suggests awhile ago. I did it as an exercise to understand XMPP and Wildfire better. It’‘s not perfect but it worked well enough, I used it to hook the group chat web application up with gmaps. If you’'d like I could post the code here. The kicker is that it converts IP to GEO location using the MaxMind GEO IP DB that you have to purchase to get to the latitude and longitude level. You could replace that lookup though with whatever else you have or just purchase the MaxMind DB.

Thanks,

Jay

Interesting! A kind of Geocode Wildfire’‘s plugin! I’'m using a Java driver to GPS unit to get User Geolocation information (lat, lon, alt, bearing, timestamp, etc.) and broadcasting them through Jabber IM in a JEP-080 way. I wrote a free library to interface NMEA GPS units to Java mobile enabled devices - http://sourceforge.net/projects/libgps4j2me/.

I thank you very much if you post your plugin code here!

Thanks again,

Cheers,

Loreto

dombiak_gaston wrote:

JEP-80 is going to be modified in the near future to be based on PEP.

Note that PEP is currently undergoing major changes, so it’'s unimplementable, blocking many other JEPs, too (like user tune, user avatar, user profile, etc).

Hey Loreto,

Sorry for the delay in posting, it’‘s on a different box at home and I haven’‘t had time to pull it off yet. I haven’'t forgotten.

Thanks,

Jay

Hey Loreto,

Here are the files and the Smack code used to gather the GEO information of a given JID. The finder and handler classes are packaged in a WF plugin, there’‘s really nice documentation on how to do that in the WF section. GEOIQ is a Smack extension; I had to modify a Smack config file to make it work but off the top off my head I can’'t remember what it was, I can find it if you need it.

XMPPConnection con = new XMPPConnection("serverDomain");
con.loginAnonymously(); GEOIQ geoRequest = new GEOIQ();
geoRequest.setType(IQ.Type.GET);
geoRequest.setTo("serverDomain");
geoRequest.setJid(jidValue); // retrieved whatever way makes sense for your client // Create a packet collector to listen for a response.
PacketCollector collector = con.createPacketCollector(new PacketIDFilter(geoRequest.getPacketID()));
con.sendPacket(geoRequest); // Wait up to 5 seconds for a result.
String IP = null;
GEOIQ geoResult = null;
IQ result = (IQ)collector.nextResult(5000);
if (result != null && result.getType() == IQ.Type.RESULT) {
geoResult = (GEOIQ)result;
// Do something with result...
IP = geoResult.getIp();
// use geoResult to get all the GEO information, call into Google maps, etc.
} con.close();

Thanks,

Jay

Thanks Jay, I just put Wildfire and Smack src under Eclipse to start WF plug-in development and better understand the code. Your sources will be helpful to me.

Many thanks,

Loreto

Hey Loreto,

Cool, that’'s exactly what I developed the plugin under so if you need assistance setting it up let me know.

Jay