ejabberd - Comments for "ejabberd_route:route" https://www.ejabberd.im/node/4615 en Your initial code is https://www.ejabberd.im/node/4615#comment-57199 <p>Your initial code is equivalent to this, and it doesn't work:</p> <pre> test() -&gt; LUser = "tom", LServer = "localhost", From = jlib:make_jid(LUser, LServer, "fb"), TUser = "badlop", TServer = "localhost", To = jlib:make_jid(TUser, TServer, "fb"), FromAddress = jlib:jid_to_string(From), ToAddress = jlib:jid_to_string(To), XmlSave = {xmlelement, "save", {"xmlns", ?NS_ARCHIVE}}, XmlBody = {xmlelement, "iq", [{"type", "get"}, {"id", "up1"}, {"from", FromAddress}, {"to", ToAddress}], [XmlSave]}, ejabberd_router:route(From, To, XmlBody). </pre><p> It doesn't work because XmlSave is wrong: you forgot to add two []. Change that line with this, and it will work:</p> <pre> XmlSave = {xmlelement, "save", [{"xmlns", ?NS_ARCHIVE}], []}, </pre> Wed, 30 Mar 2011 16:28:54 +0000 mfoss comment 57199 at https://www.ejabberd.im