简体   繁体   中英

ejabberd how to compile new module

Here I found the code:

erlc -I ~/ejabberd-2.1.13/lib/ejabberd-2.1.13/include -pa ~/ejabberd-2.1.13/lib/ejabberd-2.1.13/ebin   mod_my.erl 

But it did not work?

Here are steps to add your custom module into ejabberd

  1. put your module into ejabberd/src folder.
  2. come to ejabberd directory in terminal and run command $ sudo make
  3. it will show you that your module is compiled. Now run $ sudo make install
  4. Add your module into config file at /etc/ejabberd/ejabberd.yml
  5. restart your ejabberd and your custom module will be running.

Just drop the module in the ejabberd's src/ folder then "make". Nothing special needed to compile it.

These are the Instructions based on Ejabberd recommendation

1) Form the folder structure like below (refer any module from -- https://github.com/processone/ejabberd-contrib ).

sources

│───conf
│ └───modulename.yml
│───src
│ └───modulename.erl
│───README.txt
│───COPYING
│───modulename.spec

2) Add your module folder structure to ejabberd user home directory (check ejabberdctl.cfg for CONTRIB_MODULES_PATH param).

3) Type command ejabberdctl modules_available it will list your module

4) Type ejabberdctl module_install module_name command

For Reference https://docs.ejabberd.im/developer/extending-ejabberd/modules/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM