phpubuntuxmppejabberdmultiuserchat

How to create a MUC room from php or using direct command with ejabberd


I have an application which needs to register an ejabberd user when the normal registration process takes place. I handled this using the ejabberdctl register command.

Similarly, I need to add some users to an MUC group therefore, I need to create a group using php/command line.

I found the ejabberdctl create_room does what I need but I can't seem to make it work.

I used this:

sudo ejabberdctl create_room testRoom conference.localhost conference.localhost

But this prints out a stacktrace. I have enabled mod_muc_admin

Stacktrace when using ejabberdctl create_room

Now, the create_room command takes 3 arguments namely, name, service and host.

I can't seem to figure out this service parameter.

Any help will be greatly appreciated. Have spent a whole day on this!

P.S. I am using Ubuntu 14.04 x64 and ejabberd 15.07


Solution

  • The parameters are described on mod_muc_admin documentation page:

    ejabberdctl create_room room_name muc_service xmpp_domain
    

    Parameters are as follow:

    For example in your case, it should be:

    bin/ejabberdctl create_room testRoom conference.localhost localhost