Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 914
SuperNOVA Avatar asked Jan 07 '23 19:01

SuperNOVA


1 Answers

The parameters are described on mod_muc_admin documentation page:

ejabberdctl create_room room_name muc_service xmpp_domain

Parameters are as follow:

  • room_name: actual chat room name
  • muc_service_name: usually "conference.YOURXMPPDOMAIN"
  • xmpp_domain: The main domain of your service.

For example in your case, it should be:

bin/ejabberdctl create_room testRoom conference.localhost localhost
like image 159
Mickaël Rémond Avatar answered Jan 10 '23 08:01

Mickaël Rémond