Search code examples
xmppwebhookschatbotejabberd

Is there an ejabberd module that sends stanzas using webhooks?


I want to make it easy for people to write bots for my ejabberd server by allowing them to register webhooks with their bot JIDs. Basically, I want them to be able to interact with my ejabberd server using HTTP to send and receive XMPP stanzas instead of having to maintain persistent XMPP connections. For example, the bots could simply make HTTP calls to my ejabberd server to send XMPP stanzas, and then the server would send messages to the bots by making HTTP calls to the registered webhooks. This would allow the bots to be simple HTTP servers that could easily scale horizontally.

I did find this module (https://github.com/adnam/ejabberd-webhooks) but it doesn’t seem to do exactly what I want and also it doesn’t seem to be maintained. Is there a well-maintained (maybe official) ejabberd module that does this? Maybe there is an XEP I’m not aware of that ejabberd implements? Are there other XMPP servers that support this? Thank you in advance!


Solution

  • the bots could simply make HTTP calls to my ejabberd server to send XMPP stanzas,

    You can do this installing mod_rest in ejabberd: https://github.com/processone/ejabberd-contrib/tree/master/mod_rest

    and then the server would send messages to the bots by making HTTP calls to the registered webhooks.

    I am not aware of any simple module to do this. There are Push XEPs, see https://xmpp.org/extensions/xep-0357.html but I think ejabberd Community Server does not implement everything required, only the Business Edition.