jadahl / mod_restful

RESTful interface to ejabberd
84 stars 34 forks source link

How to add mod_restfull #23

Open aerlijman opened 10 years ago

aerlijman commented 10 years ago

Hi,

Sorry for this simple question but I haven´t got much experience in linux. I installed in CentOS ejabberd using this tutoria https://www.digitalocean.com/community/articles/how-to-install-ejabberd-on-a-centos-5-and-centos-6-vps that says basically execute sudo yum install ejabberd

But I can´t get to add this module. Where should I put it to compile and which version should I use? thx

jadahl commented 10 years ago

First, you need to find out what version of ejabberd you are running.

If its the ejabberd Community Edition then you should just be able to run "make" and copy the resulting ".beam" files into wherever ejabberd happen to store its .beam files on your system.

If its 2.1.* then you need to check out the 0.1.x branch of mod_restful. Also in that case you need to have the ejabberd source code available. Because of laziness, you need ejabberd source code next to mod_restful, run "make" and then copy the .beam files in the same way as mentioned above.

aerlijman commented 10 years ago

Thx... just before you reply.. got it. For the record, the thing was changing the paths in the make file. Both ejabberd and ejabberd src where in different location.

By the way.. Is there a way to add contacts to a user list using this module? Thx again

jadahl commented 10 years ago

You can probably use the "admin" API in some way to do it, as it just runs the admin commands. Otherwise if you want to design an API, mod_restful is designed to be easily add new API modules, but for that you need to know Erlang.

aerlijman commented 10 years ago

So, you are saying I can send this iq stanza for example? how to do that with restful??

aerlijman commented 10 years ago
<iq from='juliet@example.com/balcony' type='get' id='roster_1'>
  <query xmlns='jabber:iq:roster'/>
</iq> 
mkonecny commented 10 years ago

I was able to get it compiled on Ubuntu 12.04, by getting the source as you described (apt-get source ejabberd). I also needed to get the source code for eunit (apt-get source erlang-eunit)