【发布时间】:2016-10-21 17:31:00
【问题描述】:
大家好,在我的项目中,我有发送者和接收者的 JID 以及消息的正文。我需要在不使用任何聊天客户端的情况下发送消息,因此我使用 mod_rest 以便我可以访问 mod_admin_extra。我使用 Ejabberd 服务器 14.05 对其进行了配置,并尝试运行以下休息调用
[root@centos ~]# wget localhost:5280/rest/ --server-response --post-data 'registered_users localhost'
--2016-06-20 17:03:33-- http://localhost:5280/rest/
Connecting to <<proxy ip>>... connected.
Proxy request sent, awaiting response...
HTTP/1.0 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 1015
Connection: close
Date: Mon, 20 Jun 2016 11:33:33 GMT
Length: 1015 [text/html]
Saving to: “index.html.3”
其中 index.html.3 有以下消息,
Problem 'error function_clause' occurred executing the command.
Stacktrace: [{ejabberd_commands,'-check_access_commands/5-fun-0-',
[{rest,[{registered_users,[all]},{connected_users,[all]}]}],
[{file,"src/ejabberd_commands.erl"},{line,372}]},
{lists,'-filter/2-lc$^0/1-0-',2,[{file,"lists.erl"},{line,1284}]},
{ejabberd_commands,check_access_commands,5,
[{file,"src/ejabberd_commands.erl"},{line,371}]},
{ejabberd_commands,execute_command,4,
[{file,"src/ejabberd_commands.erl"},{line,308}]},
{ejabberd_ctl,call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,293}]},
{ejabberd_ctl,try_call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,269}]},
{ejabberd_ctl,process2,3,
[{file,"src/ejabberd_ctl.erl"},{line,218}]},
{mod_rest,maybe_post_request,3,
[{file,"src/mod_rest.erl"},{line,135}]}]
Mod_admin_extra 已添加到 ejabberd 配置文件中。这是未识别的命令问题。如果是,请解释如何在 ejabberdctl 中添加 mod_Admin_extra 命令对我有益,如果你们知道除了使用 mod_rest 之外还有什么更好的发送消息的方法,请告诉我 非常感谢
【问题讨论】: