[ejabberd] Running an echo bot on the 'main' xmpp domain

Adam Hayward adam at happy.cat
Tue Jan 26 19:36:23 MSK 2010


2010/1/26 Badlop <badlop at gmail.com>

> 2010/1/25 Adam Hayward <adam at happy.cat>:
>
> You can try to:
> 1. explain what you *really* want to accomplish,
>
>
Hullo,

supposing I had:
 - a chat server called "recipes.com"
and
 - a chat-bot called "mod_recipes" that provided recipe information on "
recipes.recipes.com"
my aim is to provide said service directly via "recipes.com".  So to get
going, I had a look at the function int() in mod_echo.erl* that would
provide a basic echo service on "echo. at HOST@" and the crucial part seems to
be these two lines:

    MyHost = gen_mod:get_opt_host(Host, Opts, "echo. at HOST@"),
    ejabberd_router:register_route(MyHost),

I kind of hoped that by simply changing MyHost thus:

    MyHost = gen_mod:get_opt_host(Host, Opts, "@HOST@"),

i would turn my entire server into an echo service; although this appears to
not be the case.  I imagine that I need to issue some kind of command to the
router that all incoming messages, iq and presence stanzas should be routed
to my module, but for the life of me I can't figure out how. It had occurred
to me that I may have to *disable* some other modules before attempting
this; or even change the order in which they are loaded somehow.

If anyone has any knowledge of setting up chat bots in this way, I would be
extremely grateful for a pointer; I have a feeling it's only a small point I
am missing, but it has got me rather stuck

Regards,

Adam

* https://svn.process-one.net/ejabberd/trunk/src/mod_echo.erl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20100126/5a41d0b5/attachment.html>


More information about the ejabberd mailing list