Q:

jabber - create room

I have the following setup:

A server with CentOS 6  
XMPP server (used ejabber)
A browser client (used Candy-chat)
Chat is working, users have permissions, etc.

What I need to do is to create a room when user X wants to. If the user uses a stand alone client (like Pidgin) everything is ok but I need to create a room using a browser based client.
The question is how do I do that?
Note: Tried to find a client that supports the feature - failed.
Note 2: It is ok if I can do it from server command line (shell script) since I can send an ajax request to a php script that runs the line. - I tried to use ejabberdctl for this but I couldn't find any functions that do that (found 9999 functions about users, server, etc. but nothing regarding rooms. I guess I must edit the mod_muc options then restart the server but I'm not sure and is not right for all users to restart server).
Thank you for your time.

A:

See http://xmpp.org/extensions/xep-0045.html#createroom
XEP-0045 define the Multi-User Chat protocol in XMPP.  You don't need to use the command line or any other out-of-band communication,  the protocol is already defined and works in-band in the  user XMPP session.  This is what any Jabber client that supports chat rooms implements.
Note that the protocol itself is long, complex and has many options and alternatives (to configure the room parameters,  affiliations, do administration work, etc), but you don't have to use all of them, see Example 153, just
<presence from='crone1@shakespeare.lit/desktop'to='coven@chat.shakespeare.lit/firstwitch'>
   <x xmlns='http://jabber.org/protocol/muc'/>
</presence>

will be enough to create room "coven".  After that user "crone1" will be the owner of that room, and will be logged in the room with nick "firstwitch".

