For Using Above created Custom xmpp element :
Two ways:
- Modify Dependencies of ejabberd to use your cloned xmpp repositories instead of provided one.
- Let's say u want to use those Custom xmpp Element in your module named my_custom_module.
a. Add the generated files/modules(src/message_custom_module.erl)from above example to your ejabberd src directory.
b. copy thetype and record definationgenerated inxmpp_codec.hrl(use git diff to get the highlighted changes.) and put it in yourinclude/my_custom_module.hrl(naming as per convention, could be anything else also, but as per best procatices.) in the ejabberd repository.
c. In Your custom Module (my_custom_module.erl) include the-include("my_custom_module.hrl").
d. Register the codecs module generatedsrc/message_custom_module.erlin the module.
i. To Register , Instart(Host,Opts)of module addxmpp:register_codec(message_custom_module)