Presence subscription

Presence subscription is the name given to the mechanism that allows control over how entity presence information is made available to other entities. By default, the availability of an entity is unknown to other entities.

Let’s put this into more concrete terms. For example, let’s assume that you and I are both Jabber users. I’m registered with the Jabber server running at, my JID is, and you are registered with a Jabber server running at your company, and your JID is

If you want to know whether I’m available, you have to subscribe to my presence. This is done by sending a <presence/> packet to me with the type attribute set to subscribe. In the example that follows, the XML fragments are sent and received from your perspective:

SEND: <presence type='subscribe' to=''/>

I receive the <presence/> packet, and when I receive it, it’s been stamped (by your Jabber server) with a from attribute with the value So, based upon who it is, I decide to accept the subscription request and send back a reply, which you receive:

RECV: <presence type='subscribed'

This lets you know that I’ve accepted your subscription request. From now on, every time my availability changes (when I send a <presence/> packet or when I disconnect and the server generates an unavailable <presence/> packet on my behalf), that availability information ...

Get Programming Jabber now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.