<div>Are "From" and "To" the same as "From1" and "To1"?<br><div><br><br><div class="gmail_quote">On Thu, Nov 3, 2011 at 3:30 AM, Alexander Kuleshov <span dir="ltr"><<a href="mailto:kuleshovmail@gmail.com" target="_blank">kuleshovmail@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hello,<br></div><div><br></div><div>I have simple ejabebrd plugin and i need to esn message from it.</div><div><br>

</div><div>My code:</div><div><br></div><div>send_message(TypeStr, BodyStr) -><br>      LUser = "test1",<br>
      LServer = "localhost",<br>      From1 = jlib:make_jid(LUser, LServer, "fb"),<br>    <br>      TUser = "test2",<br>      TServer = "localhost",<br>      To1 = jlib:make_jid(TUser, TServer, "fb"),<br>


<br>      FromAddress = jlib:jid_to_string(From1),<br>      ToAddress = jlib:jid_to_string(To1),<br>    <br>      XmlBody = {xmlelement, "message", [{"type", TypeStr}, {"from", FromAddress}, {"to", ToAddress}], [{xmlelement, "body", [], [{xmlcdata, BodyStr}]}]},<br>


     ejabberd_router:route(From, To, XmlBody).</div><div><br></div><div>But i get error:</div><div><br></div><div>=ERROR REPORT==== 2011-11-03 13:27:12 ===<br>E(<0.494.0>:ejabberd_router:70) : {{badrecord,jid},<br>

                                                                                   [{ejabberd_router,do_route,3},<br>
                                                                                    {ejabberd_router,route,3},<br>                                                                                    {mod_poker,on_register,3},<br>


                                                                                    {ejabberd_hooks,run1,3},<br>                                                                                    {ejabberd_c2s,wait_for_auth,2},<br>


                                                                                   {p1_fsm,handle_msg,10},<br>                                                                                   {proc_lib,init_p_do_apply,3}]}<br>


when processing: {"test1@localhost","test2@localhost",<br>                  {xmlelement,"message",<br>                      [{"type","chat"},<br>                       {"from","test1@localhost/fb"},<br>


                       {"to","test2@localhost/fb"}],<br>                      [{xmlelement,"body",[],[{xmlcdata,"test test"}]}]}}<br></div><div><br></div><div>How can i fix it? How can i send message from ejabberd plugin?</div>


<div><br></div><div>Thank you.</div>
<br>_______________________________________________<br>
ejabberd mailing list<br>
<a href="mailto:ejabberd@jabber.ru" target="_blank">ejabberd@jabber.ru</a><br>
<a href="http://lists.jabber.ru/mailman/listinfo/ejabberd" target="_blank">http://lists.jabber.ru/mailman/listinfo/ejabberd</a><br>
<br></blockquote></div><br>
</div></div>