how to call mod_muc commands through xml-rpc

I am using ejabberd 2.1.11.
I cannot call mod_muc commands (like create_room) through xml-rpc.

This the test command I execute in the ejabberd console:

xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, create_room, [{struct, [{host, "pg03-dev"}, {name, "ROOMNAME"}, {from, "admin@pg03-dev"}, {nick, "admin"}, {opts, []}]}]}).

I receive the following error:

W(<0.606.0>:ejabberd_xmlrpc:328) : Error -112
Unknown call: {call,create_room,
                    [{struct,[{host,"pg03-dev"},
                              {name,"ROOMNAME"},
                              {from,"admin@pg03-dev"},
                              {nick,"admin"},
                              {opts,[]}]}]}
{ok,{response,{fault,-112,
                     "Error -112\nUnknown call: {call,create_room,\n [{struct,[{host,\"pg03-dev\"},\n {name,\"ROOMNAME\"},\n {from,\"admin@pg03-dev\"},\n {nick,\"admin\"},\n {opts,[]}]}]}"}}}

Thank you for your help!

Do you have mod_muc_admin

Do you have mod_muc_admin installed? Then you can call the create_room command, which has only three arguments: name, service and host.

It worked! thank you

It worked! thank you :)

Notes:
you need to install ejabberd_xmlrpc (not mod_xmlrpc) and mod_muc_admin modules.
We download this modules from ejabberd-contrib git repository and compiled them manually (on CentOS)
We run ejabberd 2.1.13

Syndicate content