无法列出ejabberd的muc房间

时间:2016-04-14 09:32:18

标签: ejabberd

我在我的ejabberd服务器上遇到了错误。 似乎ejabberd想要从conference.localhost列出,而不是从我真正的主持人会议列表.xmpp.mydomain.com。

2016-04-14 11:03:49.167 [info] <0.982.0>@ejabberd_s2s:new_connection:406 New s2s connection started <0.992.0>
2016-04-14 11:03:49.168 [info] <0.992.0>@ejabberd_s2s_out:log_s2s_out:1253 Trying to open s2s connection: xmpp.mydomain.com -> conference.localhost with TLS=true
2016-04-14 11:03:49.183 [info] <0.992.0>@ejabberd_s2s_out:open_socket:246 s2s connection: xmpp.mydomain.com -> conference.localhost (remote server not found)
2016-04-14 11:03:51.939 [info] <0.992.0>@ejabberd_s2s_out:handle_info:940 Reconnect delay expired: Will now retry to connect to conference.localhost when needed.

这是我的ejabberd.yml [已编辑]:

websocket_ping_interval: 60
websocket_timeout: 86400

loglevel: 4
log_rotate_size: 10485760
log_rotate_date: ""
log_rotate_count: 1

hosts:
  - "xmpp.mydomain.com"

listen: 
  - 
    port: 5222
    module: ejabberd_c2s
    max_stanza_size: 65536
    shaper: c2s_shaper
    access: c2s
  - 
    port: 5269
    module: ejabberd_s2s_in

  -
    port: 5280
    ip: "::"
    module: ejabberd_http
    hosts:
      - "xmpp.mydomain.com"
    request_handlers:
      "/websocket": ejabberd_http_ws
    web_admin: true
    http_bind: true
  -
    port: 5285
    module: ejabberd_http
    hosts:
      - "xmpp.mydomain.com"
    request_handlers:
       "/rest": mod_rest

s2s_use_starttls: optional
s2s_certfile: "/etc/ejabberd/ejabberd.pem"

##
## MySQL server:
##
odbc_type: mysql
odbc_server: "localhost"
odbc_database: "ejabberd"
odbc_username: "ejabberd"
odbc_password: "pwd"

shaper:
  normal: 1000
  fast: 50000

max_fsm_queue: 1000

###.   ====================
###'   ACCESS CONTROL LISTS
acl:    
  admin:
    user:
      - "admin": "xmpp.mydomain.com"
  local: 
    user_regexp: ""

  loopback:
    ip:
      - "127.0.0.0/8"

###.  ============
###'  ACCESS RULES
access:
  ## Maximum number of simultaneous sessions allowed for a single user:
  max_user_sessions: 
    all: 10
  ## Maximum number of offline messages that users can have:
  max_user_offline_messages: 
    admin: 5000
    all: 100
  ## This rule allows access only for local users:
  local: 
    local: allow
  ## Only non-blocked users can use c2s connections:
  c2s: 
    blocked: deny
    all: allow
  ## For C2S connections, all users except admins use the "normal" shaper
  c2s_shaper: 
    admin: none
    all: normal
  ## All S2S connections use the "fast" shaper
  s2s_shaper: 
    all: fast
  ## Only admins can send announcement messages:
  announce: 
    admin: allow
  ## Only admins can use the configuration interface:
  configure: 
    admin: allow
  ## Admins of this server are also admins of the MUC service:
  muc_admin: 
    admin: allow
  ## Only accounts of the local ejabberd server can create rooms:
  muc_create: 
    local: allow
  ## All users are allowed to use the MUC service:
  muc: 
    all: allow
  ## Only accounts on the local ejabberd server can create Pubsub nodes:
  pubsub_createnode: 
    local: allow
  ## In-band registration allows registration of any possible username.
  ## To disable in-band registration, replace 'allow' with 'deny'.
  register: 
    all: allow
  ## Only allow to register from localhost
  trusted_network: 
    loopback: allow

language: "en"

###.  =======
###'  MODULES

modules: 
  mod_adhoc: {}
  mod_admin_extra: {}
  mod_announce: # recommends mod_adhoc
    access: announce
  mod_blocking: {} # requires mod_privacy
  mod_caps: {}
  mod_carboncopy: {}
  mod_client_state:
    drop_chat_states: true
    queue_presence: false
  mod_configure: {} # requires mod_adhoc
  mod_disco: {}
  ## mod_echo: {}
  mod_irc: {}
  mod_http_bind: {}
  ## mod_http_fileserver:
  ##   docroot: "/var/www"
  ##   accesslog: "/var/log/ejabberd/access.log"
  mod_last: 
    iqdisc: one_queue
    db_type: odbc
  mod_mam:
    iqdisc: one_queue
    db_type: odbc
    default: always
  mod_muc: 
    ## host: "conference.@HOST@"
    access: muc
    access_create: muc_create
    access_persistent: mud_create
    access_admin: muc_admin
    db_type: odbc
    default_room_options:
        mam: true
        public: false
        public_list: false
        allow_change_subj: false
        allow_user_invites: false
        members_only: false
        members_by_default: false
        anonymous: false
        allow_private_messages: true
        persistent: true
  mod_muc_admin: {}
  ## mod_muc_log: {}
  ## mod_multicast: {}
  mod_offline:
    db_type: odbc 
    access_max_user_messages: max_user_offline_messages
  mod_ping: {}
  ## mod_pres_counter:
  ##   count: 5
  ##   interval: 60
  mod_privacy: {}
  mod_private: {}
  ## mod_proxy65: {}
  mod_rest:
    allowed_ips: all
  mod_pubsub: 
    access_createnode: pubsub_createnode
    ## reduces resource comsumption, but XEP incompliant
    ignore_pep_from_offline: true
    ## XEP compliant, but increases resource comsumption
    ## ignore_pep_from_offline: false
    last_item_cache: false
    plugins: 
      - "flat"
      - "hometree"
      - "pep" # pep requires mod_caps
  mod_register: 
    welcome_message: 
      subject: "Welcome!"
      body: |-
        Hi.
        Welcome to this XMPP server.

    access: register
  mod_roster: {}
  mod_shared_roster: {}
  mod_stats: {}
  mod_time: {}
  mod_vcard: {}
  mod_version: {}

我在其他没有错误的计算机上使用了相同的配置。 我不明白我在这里失踪了什么

Thanx求助

[编辑] 2016年4月18日: 1 /客户:

<iq from='j9albn7dju@xmpp.mydomain.com/null' to='xmpp.mydomain.com' type='get' xmlns='jabber:client' id='2:sendIQ'>
<query xmlns='http://jabber.org/protocol/disco#items'/>
</iq> 

2 / server:

<iq xmlns='jabber:client' from='xmpp.mydomain.com' to='j9albn7dju@xmpp.mydomain.com/null' id='2:sendIQ' type='result'>
<query xmlns='http://jabber.org/protocol/disco#items'>
<item jid='conference.xmpp.mydomain.com'/>
<item jid='echo.xmpp.mydomain.com'/>
<item jid='irc.xmpp.mydomain.com'/>
<item jid='pubsub.xmpp.mydomain.com'/>
</query>
</iq> 

3 /客户:

<iq to='conference.xmpp.mydomain.com' from='j9albn7dju@xmpp.mydomain.com/null' type='get' xmlns='jabber:client' id='78:sendIQ'>
<query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>

4 / server:

<iq xmlns='jabber:client' from='conference.xmpp.mydomain.com' to='j9albn7dju@xmpp.mydomain.com/null' id='78:sendIQ' type='result'>
<query xmlns='http://jabber.org/protocol/disco#items'>
<item jid='conference.localhost' node='emptyrooms' name='Empty Rooms'/>
</query>
</iq>

1 个答案:

答案 0 :(得分:3)

我们几天前刚遇到同样的问题。我们深入研究Ejabberd代码。请参阅第614行附近的mod_muc。我们发现:

  1. iq_disco_items(Host, From, Lang, <<>>, none)检查指定主机中的可用空间是否超过MAX_ROOMS_DISCOITEMS,设置为100。
  2. case语句后,它会进一步调用iq_disco_items(Host, From, Lang, <<"nonemptyrooms">>, none)

    XmlEmpty = #xmlel{name = <<"item">>, attrs = [{<<"jid">>, <<"conference.localhost">>}, {<<"node">>, <<"emptyrooms">>}, {<<"name">>, translate:translate(Lang, <<"Empty Rooms">>)}], children = []}

  3. 这就是<item jid='conference.localhost' node='emptyrooms' name='Empty Rooms'/>的来源。

    解决方案

    我们决定使用RSM发送迪斯科查询。它将与iq_disco_items(Host, From, Lang, _DiscoNode, Rsm)进行模式匹配。希望它有所帮助。

相关问题