ejabberd - Comments for "extending ejabberd" https://www.ejabberd.im/node/402 en avoid a complete recompile https://www.ejabberd.im/node/402#comment-870 <blockquote><p>avoid a complete recompile of the entire server and save some time</p></blockquote> <p>'make' only compiles new or modified source code files, so my proposed method is optimal.</p> Thu, 29 Sep 2005 19:14:47 +0000 mfoss comment 870 at https://www.ejabberd.im log error https://www.ejabberd.im/node/402#comment-859 <p>I have followed your directions exactly as specified and I get the following log error:</p> <p>=ERROR REPORT==== 28-Sep-2005::12:33:31 ===<br /> E(&lt;0.918.0&gt;:gen_mod:43): {undef,[{mod_echo2,<br /> start,<br /> [[{host,"echotest.localhost"}]]},<br /> {gen_mod,start_module,2},<br /> {lists,foreach,2},<br /> {ejabberd_app,start,2},<br /> {application_master,start_it_old,4}]}</p> <p>Any ideas? [Thanks in advance!]</p> Wed, 28 Sep 2005 17:24:23 +0000 kloidster comment 859 at https://www.ejabberd.im miscommunication... https://www.ejabberd.im/node/402#comment-851 <p>I'm sorry, I didn't mean to question what you were saying; the instructions you gave were very clear and concise. I was only trying to figure out if I could avoid a complete recompile of the entire server and save some time. I thought it would be easier to simply compile the parts of the server that were modified (i.e. the individual modules themselves), instead of the whole server. From now on, I will do exactly as you recommended. Thank you very much for taking the time to answer my questions; I really appreciate it!</p> Wed, 28 Sep 2005 11:51:28 +0000 kloidster comment 851 at https://www.ejabberd.im why didn't you follow the instructions? https://www.ejabberd.im/node/402#comment-850 <blockquote>I simply moved ejabberd.hrl, jlib.hrl, and mod_echo2.erl to another directory</blockquote> <p>I said 'Put mod_echo2.erl on ejabberd/src'. You did something completely different.</p> <blockquote>then in erl I compiled with c( mod_echo2 )</blockquote> <p>I said 'Compile ejabberd'. You did something completely different.</p> <p>If you don't follow my instructions, don't ask me your problems, because I won't know. Weren't the instructions specific enought?</p> <p>PD: I fixed some mistakes in the instructions and added more explanations.</p> Wed, 28 Sep 2005 08:19:12 +0000 mfoss comment 850 at https://www.ejabberd.im recompiling https://www.ejabberd.im/node/402#comment-844 <p>Do I have to recompile the entire mod_echo2? I simply moved ejabberd.hrl, jlib.hrl, and mod_echo2.erl to another directory and then in erl I compiled with c( mod_echo2 ).</p> <p>I got the following error:</p> <p>./mod_echo2.erl:13: Warning: undefined call-back function start/1<br /> ./mod_echo2.erl:13: Warning: undefined call-back function stop/0<br /> {ok,mod_echo2}</p> <p>A beam file has been outputted as well. I moved the beam file to the mod directory and changed the cfg file to reflect the presence of the new mod. I then restarted the server and it seems to be up and running fine. Is this method acceptable as well or is the recompile necessary?</p> Tue, 27 Sep 2005 20:39:32 +0000 kloidster comment 844 at https://www.ejabberd.im How to add a new module to ejabberd https://www.ejabberd.im/node/402#comment-843 How to add a brand new module to ejabberd: <ol> <li>Put mod_echo2.erl on ejabberd/src </li><li>Make sure the module is correctly named. On that file, modify this line to reflect the new name of the module: <pre>-module(mod_echo2).</pre> </li><li>And make sure to change the name of the proccess, so it does not conflict with the existing one provided by 'mod_echo': <pre>-define(PROCNAME, ejabberd_mod_echotwo).</pre> </li><li>Compile ejabberd. It will automatically compile the new file: <pre>... Recompile: mod_echo2 ...</pre> </li><li>Configure ejabberd to start this module at startup. Edit ejabberd.cfg and add on 'modules' section: <pre> {mod_echo2, [{host, "echotest.localhost"}]},</pre> </li><li>Now start ejabberd. If everything went ok, no mention to mod_echo2 will be shown on the error log. Log in with any account on the server and open the 'Service Discovery' on your Jabber client. You will see the new echotest.localhost, provided by the new module. </li></ol> Tue, 27 Sep 2005 20:17:47 +0000 mfoss comment 843 at https://www.ejabberd.im it's easier to modify current code https://www.ejabberd.im/node/402#comment-841 <p>You can copy the current mod_muc, rename the files, rename the module, rename the Mnesia and ETS tables and the proccess, so all this does not conflict with the stock mod_muc. But why don't you just modify the code of the current mod_muc?</p> <p>The module that implements MUC is called mod_muc, and the files that implement the required functionality are spread on several files on the mod_muc/ directory. </p> <p>Just simply modify those files, recompile and restart ejabberd. It's the same for any other code.</p> <p>The simpliest modules you can find are mod_echo, mod_time and mod_version.</p> Tue, 27 Sep 2005 20:10:04 +0000 mfoss comment 841 at https://www.ejabberd.im hacking mod_muc https://www.ejabberd.im/node/402#comment-840 <p>I've checked out the code via SVN and feel this is a good place to start extending ejabberd. I will most defenitely start playing with mod_muc. I hope to get up to stud level in erlang programming and then hopefully be able to contribute better to ejabberd.</p> Tue, 27 Sep 2005 20:01:10 +0000 kloidster comment 840 at https://www.ejabberd.im first steps https://www.ejabberd.im/node/402#comment-836 <p>I am in the process of learning Erlang. Could you please give me some starting points to start hacking at the embedded MUC module? </p> <p>I am guessing the following approach might work. </p> <p>1) copy the MUC module and rename it somehow<br /> 2) register the new module under the new name<br /> 3) incrementally modify it to suit my purposes</p> <p>I would think that understanding how the MUC module works would also be a good starting point. I know nothing of the ejabberd architecture, so please let me know if I am barking up the wrong tree. I am making a number of assumptions here (most notably that the MUC module exists in an editable file).</p> <p>Is there a module template that is lying around somewhere that I can start with? I will go over the documentation some more and look over my installation of ejabberd to better understand the architecture.</p> Tue, 27 Sep 2005 17:20:22 +0000 kloidster comment 836 at https://www.ejabberd.im not an option https://www.ejabberd.im/node/402#comment-835 <p>Jive Messenger is out of the question (for a number of reasons). I will look into JEP-0114 and JSO. Thank you!</p> Tue, 27 Sep 2005 17:15:05 +0000 kloidster comment 835 at https://www.ejabberd.im three free implementations of Multi-User Chat https://www.ejabberd.im/node/402#comment-834 <blockquote> I would like to customize the multiuser chat components, or perhaps write my own; if there is a multiuser chat module available in Java that works with ejabberd then please let me know. </blockquote> <p> There are at least three free implementations of Multi-User Chat (JEP-0045): <ul> <li>MU-Conference: stand-alone component that can be used with any Jabber server, including ejabberd. </li><li>MUC module embedded in ejabberd. </li><li>MUC module embedded in Jive Messenger 2. </li></ul> </p> Tue, 27 Sep 2005 15:10:56 +0000 mfoss comment 834 at https://www.ejabberd.im Random suggestions https://www.ejabberd.im/node/402#comment-832 <p>You can write "components" using the protocol in <noindex><a href="http://www.jabber.org/jeps/jep-0114.html" rel="nofollow" >JEP-0114</a></noindex>. Such components can be attached as subdomains of your ejabberd server. I don't use Java myself, but the <noindex><a href="http://jso.jabberstudio.org/" rel="nofollow" >JSO</a></noindex> library is said to be useful for writing components.</p> <p>Alternatively, you can run a <noindex><a href="http://www.jivesoftware.org/messenger/" rel="nofollow" >Jive Messenger</a></noindex> server on a separate machine, and try to customize their MUC module.</p> <p>Of course, in the long run you'll be happier learning Erlang ;-)</p> Tue, 27 Sep 2005 15:01:39 +0000 legoscia comment 832 at https://www.ejabberd.im excellent resources https://www.ejabberd.im/node/402#comment-831 <p>These are excellent links. Thank you very much. I do intend on learning Erlang because I think it is a GREAT tool for certain problems (especially problems that require concurrency). Your first link is extremely helpful. Thanks again!</p> Tue, 27 Sep 2005 11:49:04 +0000 kloidster comment 831 at https://www.ejabberd.im hhmmm... https://www.ejabberd.im/node/402#comment-830 <p>I would like to create some custom behaviors to ejabberd. In particular, I would like to customize the multiuser chat components, or perhaps write my own; if there is a multiuser chat module available in Java that works with ejabberd then please let me know. I think I should start with reading JEP-0045 (is that the correct JEP?). </p> <p>In the most general sense, I would like to extend ejabberd's functionality the same way one would extend a servlet container such as jetty or tomcat.</p> <p>Thank you very much for your response!</p> Tue, 27 Sep 2005 11:47:25 +0000 kloidster comment 830 at https://www.ejabberd.im What kind of services? https://www.ejabberd.im/node/402#comment-829 <blockquote> I want to extend ejabberd by providing my own services but I do not know where to begin. </blockquote> <p> What does 'services' mean to you? Services like these: <a href="http://www.jabber.org/software/components.shtml">Jabber components</a>? Could you tell examples of services that you are interested in? </p> Tue, 27 Sep 2005 08:05:50 +0000 mfoss comment 829 at https://www.ejabberd.im