I think your best bet is using an ejabberd module, and register your hook in the start function inherited from the gen_mod behavior. This tutorial can show you how to build a module with hook support: Elixir Sips: ejabberd with Elixir – Part 2 and here is a small ‘real’ module I wrote a while back as an example: mod_auto_cluster/lib/mod_auto_cluster.ex at master · mpope9/mod_auto_cluster · GitHub






















