[ejabberd] external component "route" element from mod_service_log

Badlop badlop at gmail.com
Thu Mar 17 13:51:28 MSK 2011


2011/3/16 Daniel Dormont <dan at greywallsoftware.com>:
> I have managed to register the component using the service listener and I have it configured as a "logger" under mod_service_log. Packets are being delivered correctly, but I see that the packet is enclosed in a "route" tag before it's sent out. May I ask why that's done?
>
> I'm asking because as best I can tell this "route" tag isn't part of the XMPP standard and the Java APIs choke on the packet.


I guess you refer to this line in mod_service_log.erl
                {xmlelement, "route", [], [FixedPacket]})

That line is there since the first version of the module, seven years ago.
And that module was intended to be used with Bandersnatch,
so it had to send the stanza inside that Route element as expected by
that program.
There may be other programs compatible with that one, that also use that.


> I'm working on modifying them to unwrap the "route" tag but I was wondering if there's a way to tell mod_service_log not to send it in the first place.

You can try to customize the code like this:
--- a/src/mod_service_log.erl
+++ b/src/mod_service_log.erl
@@ -72,6 +72,6 @@ log_packet(From, To, {xmlelement, Name, Attrs, Els}, Host) ->
                ServerJID,
                #jid{user = "", server = Logger, resource = "",
                     luser = "", lserver = Logger, lresource = ""},
-               {xmlelement, "route", [], [FixedPacket]})
+               FixedPacket
       end, Loggers).


---
Badlop
ProcessOne


More information about the ejabberd mailing list