In Part 1 of this series, I briefly described Presence in the Unified Communications(well, UCMA to be exact) world. In this post, I'll expand a little into the two main concepts that are used to solve that problem: Containers and Categories.

To recap, our problem can be summarized as follows: Presence needs to communicate 1. the modalities you're available on (IM, Voice, email, etc.) and 2. your willingness to use them now.

The Enhanced Presence framework in Office Communications Server tackles this by splitting Presence information up pieces, called Categories, and allowing them to be published into buckets, called Containers.

Ergo - Buckets and Buckets of Pieces of Presence.

You understand these two concepts and you'll be most of the way to understanding how Presence works.

Containers

Let's start with the buckets - called Containers. A Container is meant to logically encapsulate a group of people with whom you have a similar relationship. For instance, Office Communicator defines several containers by default: Blocked, personal, team, company and public.

Containers are represented by numbers. In practice you can think of them sort of like network ports. The thing with ports is, one port is just as good as another…except that they're not. Just try telling your boss that you're going to put the new company website on port 1031... He'll laugh, then realize you're serious and fire you. (Or fire you, realize you're serious, then laugh...wait...never mind...)

You wouldn't have lost your job if you respected the well known ports for well the known services. Http is typically on port 80, Ftp on 21, telnet on 25, etc. There's nothing special about them, except that their use is backed by the power of convention…which…makes them special.

Similarly, the good folks at Office Communicator have decided that anyone belonging to the 32000 container will be blocked, personal contacts should go into container 400, 300 contains your team members, 200 the whole company, and 100 is everyone else. There are also three other special containers 0, 1 and 2. Zero is used if nothing else matches, and containers 1 and 2 are there so the schizophrenics among us can talk to ourselves.

Ok, maybe schizophrenic isn't the word. I'm just talking about situations where you have more than one device logged in at the same time(eg. Cell phone + laptop). These situations are known collectively as having Multiple Points of Presence, or MPOP(empop). Containers 1 and 2 trade more detailed info between endpoints belonging to you.

So, 0, 1, 2, 100, 200, 300, 400, 32000. There's nothing special about these numbers, just as port 80 isn't "special". But Office Communicator says that these containers have special meanings. If you write a custom app that will never interop with OC you can use whatever containers you want, just as you're perfectly free to have your web server listen at port 1038. Just don't expect much traffic.

Categories

So now we have a bunch of buckets. As we all know empty buckets are sad, sad creatures. Thus, we define Categories. These are the individual pieces of information that can be published. 

Standard categories include Note, Contact Card, State, devices and services. The Note, contact card and state are categories are fairly self explanatory. Note is just that, a short note that is associated with you. Contact card is your contact info(phone, email, title, etc.) and State is your general availability, online, offline, busy, etc. There's a little more to be said about state, and it will be – in another post. J

Devices and services need a little explaining. They are actually the flip side of one another. The Devices category describes the modalities that you are currently available on. For each place you are logged in, you will publish a Devices category to show how this endpoint can handle communications. The server aggregates that information and publishes them back out as Services categories, indicating what you as a user can handle.

For example, Joe is logged into OCS from his cellphone and laptop. The cellphone can handle voice and IM, and the laptop can handle voice, IM plus application sharing. Joe publishes two Device categories – one for his cell phone that indicates voice and IM, and the other for his laptop which also indicates app sharing.

The server will hide the fact that there are two endpoints and just publish a single set of services dictating that Joe can handle IM, voice and app sharing. Thus, when someone tries to voice call Joe, they cannot say "Just call his cell phone, not his laptop."

Conclusion

So there you have it. Categories and Containers. Next post, I'll dig a little bit into how states are implemented in Office Communications Server, and maybe even do some code…