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 jabber.org, my JID is email@example.com, and you are registered with a Jabber server running at your company, and your JID is firstname.lastname@example.org.
If you want to know whether I’m available, you have to
subscribe to my
This is done by sending a
packet to me with the
type attribute set
subscribe. In the example that follows, the XML
fragments are sent and received from your perspective:
SEND: <presence type='subscribe' email@example.com'/>
I receive the
packet, and when I receive it, it’s been stamped (by your Jabber
server) with a
from attribute with the
value firstname.lastname@example.org. 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' email@example.com/home' firstname.lastname@example.org/work'/>
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
<presence/> packet on my behalf), that availability information ...