2

I want to configure rooms in ejabberd server

1) Create Two Rooms with a Room Name by configuring ejabberd's config file

  Room Names will be 1) visitors 2) native

2) Don't allow users to create room
3) User can join any room those are configured over ejabberd server

so far i have configured following values in mod_muc

{mod_muc,      [
                  %%{host, "conference.@HOST@"},
                  {access, muc},
                  {access_create, muc_admin},
                  {access_persistent, muc_admin},
                  {access_admin, muc_admin},
                  {max_room_id,2},
                  {max_room_name,2},
                  {max_room_desc,300},
                  {default_room_options,
                  [
                       {persistent, true}
                 ]}
                 ]},
  {mod_muc_log,[

                 {access_log, muc},
                 {cssfile, false},
                 {dirname, visitors@mydomain.com},
                 {outdir, "/var/lib/ejabberd/muclogs"},
                 {timezone, universal},
                 {spam_prevention, true},

   ]},

i am passing following values from client interface of strophe

JID : user@mydomain.com
Password: userpassword
Room: visitors@mydomain.com
Nickname:user1

but i don't know where to specify two room names and configured them saperately in the file

with above configuration i am getting following response from server

<body xmlns='http://jabber.org/protocol/httpbind'>
    <presence xmlns='jabber:client' 
          from='user@mydomain.com' 
          to='user@mydomain.com/40570047311328899827978413' 
          type='error'>

    <error code='404' type='cancel'>
        <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
        <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Conference room does not exist</text>
    </error>
    </presence>
    <presence xmlns='jabber:client' 
        from='user@mydomain.com/40570047311328899827978413' 
        to='user@mydomain.com/40570047311328899827978413' 
        type='error'>
        <priority>-1</priority>
        <error code='403' type='auth'>
            <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
            <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Room creation is denied by service policy</text>
        </error>
        <error code='404' type='cancel'>
            <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
            <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Conference room does not exist</text>
        </error>
    </presence>
</body>

In presence handler what i have noticed is my from id doesn't match my room id

1
  • You are sending the stanza to the wrong domain. Typically you should send them to chatroom@conference.yourdomain.com. where chatroom == name of chatroom so your Room should be in this case: visitors@conference.mydomain.com Oct 13 '17 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.