IQ question

In ejabberd 2.1.5 it seems I can send the following stanza to someone in a muc room over BOSH and it is received by the recipient:

<body rid='340429760'
      xmlns='http://jabber.org/protocol/httpbind'
      sid='9f751cb790d7e0d728623329d8ede1a1520e1ac7'>
  <iq to='abc@conference.abc.com/test'
      id='4465:exec'
      type='set'
      xmlns='jabber:client'>
    <my-custom-query />
  </iq>
</body>

In ejabberd 2.1.6+ it does not seem to be received by the recipient. Is there anything wrong with sending this type of stanza?

Thanks

ejabberd 2.1.6 verifies IQ a

ejabberd 2.1.6 verifies IQ a little more than older versions, and some invalid IQs may not be allowed anymore, see https://support.process-one.net/browse/EJAB-1320

Your Iq element has as invalid child element, see http://tools.ietf.org/html/rfc6120#section-8.4

Quote:

... an IQ stanza of type "get" or "set" MUST contain one
such child element. Such a child element MAY have any name and MUST
possess a namespace declaration
(other than "jabber:client", "jabber:
server", or "http://etherx.jabber.org/streams") that defines the data
contained within the child element. Such a child element is called
an "extension element". An extension element can be included either
at the direct child level of the stanza or in any mix of levels.

I've added in your "child element" a namespace declaration, and now the stanza is delivered correctly to the other room occupant in my tests:

<body rid='340429760'
      xmlns='http://jabber.org/protocol/httpbind'
      sid='9f751cb790d7e0d728623329d8ede1a1520e1ac7'>
  <iq to='abc@conference.abc.com/test'
      id='4465:exec'
      type='set'
      xmlns='jabber:client'>
    <my-custom-query xmlns="jabber:iq:leeb" />
  </iq>
</body>

Thanks once again badlop,

Thanks once again badlop, wish I had spotted that!

I notice that I can send IQs of type result without the namespace attribute. Is that valid? It is hard to understand the meaning of the RFC there.

leeb wrote: Thanks once again

leeb wrote:

Thanks once again badlop, wish I had spotted that!

I notice that I can send IQs of type result without the namespace attribute.

That's because ejabberd doesn't check it right now. But maybe it does in the future, or other XMPP servers do, or other clients, etc.

leeb wrote:

Is that valid? It is hard to understand the meaning of the RFC there.

I don't know either. But you can be in the safe corner by always including your custom xmlns in my-custom-query element.

Syndicate content