1
votes

I was trying to create a MUC room from my XMPP client side communicating with Ejabberd.

Here's my Ejabberd muc config:

mod_muc: 
## host: "conference.@HOST@"
access: muc
access_create: muc_create
access_persistent: mud_create
access_admin: muc_admin
db_type: odbc
max_user_conferences: 100
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

Here's the features I got from the client side on muc:

<iq xmlns='jabber:client' from='conference.my.domain.com' to='[email protected]/null' id='iqid1:sendIQ' type='result'>
    <query xmlns='http://jabber.org/protocol/disco#info'>
        <identity category='conference' type='text' name='Chatrooms'/>
        <feature var='http://jabber.org/protocol/disco#info'/>
        <feature var='http://jabber.org/protocol/disco#items'/>
        <feature var='http://jabber.org/protocol/muc'/>
        <feature var='http://jabber.org/protocol/muc#unique'/>
        <feature var='jabber:iq:register'/>
        <feature var='http://jabber.org/protocol/rsm'/>
        <feature var='vcard-temp'/>
        <feature var='urn:xmpp:mam:tmp'/>
        <feature var='urn:xmpp:mam:0'/>
        <feature var='urn:xmpp:mam:1'/>
        <x xmlns='jabber:x:data' type='result'>
             <field var='FORM_TYPE' type='hidden'>
                 <value>http://jabber.org/network/serverinfo</value>
             </field>
        </x>
   </query>
</iq>

When I tried to create a MUC room from my client side with:

<presence from='[email protected]/null' to='[email protected]/my_nickname' xmlns='jabber:client'>
      <x xmlns='http://jabber.org/protocol/muc'/>
</presence>

I got a new room created response:

<presence xmlns='jabber:client' from='[email protected]/my_nickname' to='[email protected]/null'>
    <x xmlns='http://jabber.org/protocol/muc#user'>
        <item jid='[email protected]/null' affiliation='owner' role='moderator'/>
        <status code='110'/>
        <status code='100'/>
        <status code='201'/>
    </x>
</presence>

When I tried to get the configuration form to set up room fields with:

<iq from='[email protected]/null' to='[email protected]/my_nickname' type='get' xmlns='jabber:client' id='iqid2:sendIQ'>
    <query xmlns='http://jabber.org/protocol/muc#owner'/>
</iq>

I got the answer from Ejabberd server:

<iq xmlns='jabber:client' from='[email protected]/my_nickname' to='[email protected]/null' id='iqid2:sendIQ' type='get'>
    <query xmlns='http://jabber.org/protocol/muc#owner'/>
</iq>

So here are my questions:

  • Why does Ejabberd server response to my queries with the same type, but not with something like type='result' or type='error'? I've tried other queries with type='set', the same thing happened.

  • Why aren't there something like : <feature var='http://jabber.org/protocol/muc#owner'/> or <feature var='http://jabber.org/protocol/muc#admin'/> in the features on muc service?

  • It seems possible to create v-card for rooms, how does it work? Does it require some additionnal configurations on the server side?

2

2 Answers

1
votes

Actually, you are not sending the packet to the room but to user nickname: '[email protected]/my_nickname'. Thus, the packet you send is routed back to you. Remove "/my_nickname" and you will be able to talk to the room itself and get your configuration form.

0
votes
  1. As Mickaël points out, you're just sending the <iq/> to your own occupant address, so ejabberd is passing it back to you.

For your other questions:

  1. Interesting - I tried it out and read the Service Discovery XEP, and I think it's basically considered redundant. The #owner, #admin and #user namespaces are components of MUC, so you should assume their support just from http://jabber.org/protocol/muc. As you can see in XEP-0030, the reference example does not include them either: http://xmpp.org/extensions/xep-0030.html#example-2

  2. I don't think vcard-temp means you can set anything - you can only request the MUC server's vCard, which returned

<vCard xmlns='vcard-temp'> <FN>ejabberd/mod_muc</FN> <URL>http://www.process-one.net/en/ejabberd/</URL> <DESC> ejabberd MUC module Copyright (c) 2003-2011 ProcessOne </DESC> </vCard>

when I tried it.