powered by Jive Software

How to create rooms dynamically in OpenFire?

Hi,

I am a newbie to Openfire. For the last few days, I am struggling in finding a way to create rooms dynamically in OpenFire. My requirement is as follows:

I have installed OpenFire ver 3.9.3 on my local Ubuntu machine ver 12.04. After successfully installing OpenFire, I went to “Group Chat Settings” under “Group Chat” and created a subdomain called “qmobilegroups”. Now I went inside “qmobilegroups” and created a room “agentsupport” under it. Then I went to “User Permissions” under “Room Administration” tab and assigned three room members to that room. My question is, how can I create more rooms under the “qmobilegroups” subdomain and also assign members to those rooms dynamically. Is there any API for doing that? Any help would be truly appreciated.

My question is, how can I create more rooms under the “qmobilegroups” subdomain and also assign members to those rooms dynamically. Is there any API for doing that?

You can do it with XMPP.

See http://xmpp.org/extensions/xep-0045.html#createroom-reserved

You would need to config the room as persistent room ( “muc#roomconfig_persistentroom” ) and probably also as members-only (“muc#roomconfig_membersonly”) in the configuration form.

You can modify the member list as described here:

http://xmpp.org/extensions/xep-0045.html#modifymember

How to set a room as a Persisten Room from Open Fire Admin Console? FYI, I am running OpenFire server ver 3.9.3

I think, it’s by default, it you create a room in admin console.

Thanks for the links that you specified in your last post. I visited the links and saw some xml there and have no idea about what to do with those xmls. I am a newbie to OpenFire and xmpp programming and have no idea of writing plugins in OpenFire. Please help me out.

Also FYI, I have used UserService plugin and it would be great if I could get a similar kind of plugin that would create rooms and assign members dynamically to it.

Oh, you are looking for the API in an Openfire Plugin!?

I haven’t done such a thing yet. I guess you have to study the API: https://www.igniterealtime.org/builds/openfire/docs/latest/documentation/javadoc /index.html

package org.jivesoftware.openfire.muc

https://code.google.com/p/inspired-social/source/browse/trunk/PHP2Java/com/ifsof t/inspired/PHP2Java.java

look for createRoom and configureRoom

how should I call createRoom and configureRoom functions from a PHP script in the form of an API? Infact I can add data directly to “ofMucRoom” and “ofMucService” tables through a simple PHP script but it is not reflecting in the listing. I did some googling and found out that OpenFire does a lot of caching while dealing with data. Can I disable the cache for this particular case or how can I achieve my requirement? Please advice.

Look at this plugin