2009-08-29 78 views
3

我有两个ejabberd服务器,一个在foobar.com上在本地很远的一个在线服务器。Xmpp ejabberd和添加用户命令

使用XMPP洋泾浜控制台我可以给IQ节的测试:

本地服务器主机名是EEPC

<iq to='eeepc' from='[email protected]' id='get-registred-users-num-1' type='set'> 
    <command xmlns='http://jabber.org/protocol/commands' action='execute' node='http://jabber.org/protocol/admin#get-registered-users-num'/> 

</iq> 

<iq from='eeepc' to='[email protected]/3493331071251540036345753' id='get-registred-users-num-1' type='result'> 
    <command xmlns='http://jabber.org/protocol/commands' sessionid='2009-08-29T14:01:55.714639Z' node='http://jabber.org/protocol/admin#get-registered-users-num' status='completed'> 
     <x xmlns='jabber:x:data'> 
      <field type='hidden' var='FORM_TYPE'> 
       <value>http://jabber.org/protocol/admin</value> 
      </field> 
      <field type='text-single' label='Number of registered users' var='registeredusersnum'> 
       <value>7</value> 
      </field> 
     </x> 
    </command> 
</iq> 

远程服务器

<iq to='foobar.com' from='[email protected]' id='get-registred-users-num-1' type='set'> 
    <command xmlns='http://jabber.org/protocol/commands' action='execute' node='http://jabber.org/protocol/admin#get-registered-users-num'/> 
</iq> 

<iq from='foobar.com' to='[email protected]/36523779951251567671615394' id='get-registred-users-num-1' type='error'> 
    <command xmlns='http://jabber.org/protocol/commands' action='execute' node='http://jabber.org/protocol/admin#get-registered-users-num'/> 
    <error code='404' type='cancel'> 
     <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> 
    </error> 
</iq> 

我不明白为什么我得到一个,我看不到任何特定的选项告诉服务器接受来自远程的命令?

回答

1

也许mod_configure只是不加载远程服务器。 您可以在ejabberd管理员shell中通过lists:member(mod_configure, gen_mod:loaded_modules("foobar.com")).进行检查。 我无法想象这是关于成为远程用户,因为在foobar.com和[email protected]之间不需要s2s连接。

0

查看the mod_configure.erl source code似乎有一个ACL检查,以确保配置adhoc命令只有当请求者在用户帐户上时才允许在该虚拟主机上配置priv。默认情况下,我认为他们没有。

acl:match_rule(LServer, configure, From) 

您可能需要添加类似...

{access, configure, [{allow, [email protected]}]}. 

...您ejabberd.cfg文件。