point and I'd like to get my feet wet with Python and test-writing. Aioxmpp
seems like a great project in this regard, and I promise I will do my best
to minimize the amount of hand-holding!
I was wondering if the following issue still needs work and/or if anyone is
working on it? I would like to take a stab at it.
On Donnerstag, 5. Juli 2018 08:35:42 CEST you wrote:
> Hi, I want to send message to conference. I have added sender user to
> that conference and trying to send message as usual but JID goes like
> CONF_NAME(a)conference.JABBER_SRV but it doesn't work. I can't find
> anything about conferences in documentation.
Please see the MUC module  and the muc_logger.py example  for how to use
Multi-User Chats (Conferences).
Since joining a MUC/Conference on a client is a stateful operation, it is a
bit more complex than simply sending a message: the MUC module takes care of
most of that, but in the end there’s still an object which holds the state and
you have to use the send method of that object.
However, depending on your use-case, you might want to go a different route.
For example, if what you are building is a kind of "notification bot" which
rarely sends messages to a MUC and does not need to receive messages, it might
be more wise to look into which features your server offers for that. For
example, prosody has  which allows to send messages to MUCs via a Slack-
like HTTP API.
If you give more details on what you’re trying to achieve, I can probably give
you more ideas on how to do that.
Please note, too, that you need to be subscribed to the mailing list in order
to post. You can alternatively also join our MUC at
kind regards & have fun,
(Note: I am assuming that you are using the latest release, which is why I
pointed the links to the documentation/example from the latest release. If
you’re using the devel branch, please replace 0.9 with devel in the
documentation link and use the example from the devel branch).
-----BEGIN PGP SIGNED MESSAGE-----
First of all, to post to aioxmpp-devel, you need to be subscribed. As an
administrator, I still got your message, but nobody else got it. Replying to
On Samstag, 22. Juli 2017 17:01:30 CEST you wrote:
> Is there a way to embed a substanza directly (so as a string with XML tags)
> to the Message and IQ stanzas?
Yes, with some (supported) trickery. See below ...
> I need to stress test an IOT application which communicates with various
> hardware devices, and it would be extremely tedious to define these stanzas
> (so I don't care about the response, I just want to send a bunch of stuff)
In general, it is preferable to define it properly. If there is even a slim
chance that you might need to do proper interaction with the IoT application
at a later point (for example for a server side application or something like
that), you’ll benefit from properly defining the schema.
> An example of what I want to send:
> <message id="2190" type="chat"
> from="84eb18ceb80d(a)xmpp-cls.intamac.com/smarthub" xmlns="jabber:client">
> <alert xmlns="Intamac:alert" id="14147" alert="Car_AlarmEnd" source="aad"
> timestamp="1470013199" /> </message>
aioxmpp supports sending and receiving arbitrary XML trees. You cannot
directly send raw strings of XML, because that would be unsafe (the whole
stream would break if you sent "<test>" without closing tag).
By default, Message stanzas do not support this, but you can monkey patch that
behaviour into it using:
# put these lines somewhere in the start up of your app
aioxmpp.Message.raw = aioxmpp.xso.Collector()
(see  for details on the Collector descriptor)
Now you can compose your message like this:
import lxml.etree as etree
msg = aioxmpp.Message(
'<alert xmlns="Intamac:alert" id="14147" alert="Car_AlarmEnd"'
' source="aad" timestamp="1470013199" />'
The Collector-based attribute is a list of ElementTree or Element objects
(from the etree-API). It is normally used as catch-all in situations where it
isn’t known what elements will occur beforehand (for example in PubSub
notifications), but it can also be used to embed arbitrary XML.
I’ve added a send_raw.py example, check it out in the git repository .
-----BEGIN PGP SIGNATURE-----
-----END PGP SIGNATURE-----