0
votes

I have nearly updated ejabberd from 16.02 to 18.01. Main problem is that my module which i developed in older version is not working properly, because in older version of ejabberd wasn't using xmpp library (instead for that there was jlib), so iq record definition has changed.. i don't know how to add my custom namespace in xmpp library

1
it's not easy and it's boring, you should add new clause to xmpp_codec:get_mode/3 and add new module for decoding and encoding your xml.Pouriya
yesterday i tried making my own xmpp spec..i registered my spec module with xmpp:register_code(conversation) but after restarting ejabberd there is a critical errorBeka Gelashvili
@BekaGelashvili I was working on a similar problem described here [stackoverflow.com/questions/50208545/… with my ejabberd iq handler module. Could you help me out please?abhishek ranjan

1 Answers

0
votes

You can add custom namespace by adding new plugin in eJabberd.

Please follow the step below:

  1. Add your custom namespace in jlib.hrl with define macro.
  2. Create a new plugin module in eJabberd which can refer mod_ping.
  3. Modify section modules of ejabberd.cfg to enable your plugin.

Please remember to register your plugin with gen_iq_handler:add_iq_handler, when your plugin is started.

If you want to add a feature which can be negotiated you must register your plugin with mod_disco:register_feature.