无法从 ejabberd 服务器 15.09 路由自定义数据包
Posted
技术标签:
【中文标题】无法从 ejabberd 服务器 15.09 路由自定义数据包【英文标题】:failed to route custom packet from ejabberd server 15.09 【发布时间】:2015-10-08 11:41:43 【问题描述】:我正在使用 ejabberd 15.09 并尝试创建一个模块来发送确认消息以换取收到的消息,我在路由此数据包时遇到错误。
错误日志:
2015-10-08 11:10:57.333 [错误] @ejabberd_sm:route:118 function_clause,[ejabberd_sm,do_route,[jid,>,>,>,>,>,>,jid,>,>,>,>,>,>,xmlelement,"message",["id",>,"type","Ack_receipt","from",>,"to",>],[xmlelement,"body",[],[xmlcdata,>]]],[file,"src/ejabberd_sm.erl",line,424],ejabberd_sm,route,3,[file,"src/ejabberd_sm.erl" ,line,116],ejabberd_local,route,3,[file,"src/ejabberd_local.erl",line,112],ejabberd_router,route,3,[file," src/ejabberd_router.erl",line,75],mod_ack,log_packet,3,[file,"src/mod_ack.erl",line,32],mod_ack,on_user_send_packet,4 ,[file,"src/mod_ack.erl",line,28],ejabberd_hooks,safe_apply,3,[file,"src/ejabberd_hooks.erl",line,385], ejabberd_hooks,run_fold1,4,[file,"src/ejabberd_hooks.erl",line,368]]
处理时: jid,>,>,>,>, >,>,jid,>,>,>, >,>,>,xmlelement,"message",["id",>,"type ","Ack_receipt","来自",>,"to", >],[xmlelement,"body",[],[xmlcdata,>]]
【问题讨论】:
【参考方案1】:您正在格式化xmlelement
记录。这种格式已过时。最新 ejabberd 上的数据包记录为 xmlel
记录。您需要更新代码以支持新格式。
记录格式说明如下:https://github.com/processone/xml/blob/master/include/xml.hrl
【讨论】:
以上是关于无法从 ejabberd 服务器 15.09 路由自定义数据包的主要内容,如果未能解决你的问题,请参考以下文章
无法将用户从 iOS 客户端注册到 Ejabberd 服务器 - XMPP
无法从 Android 在 Ejabberd 服务器中添加新用户。它给出了禁止(403)