The quantum physics says that some events will happen differently if someone is watching. And one doesn’t need to be a physics to have that experience. At least my performance is always worst when someone is watching me playing piano.
Authors of IMS Presence System were either aware of it or they knew that there can be a thin line between being a watcher and being a stalker. Either way IMS allows to inform a presentity about watchers and authorize their subscription.
The key specification is the RFC 3857 which defines so called watcher info (winfo) event “template-package”. Event template-packages are event packages that can be applied to any other event package (so not only presence). The winfo provides the users with information about who is watching the subscribed resource. If the winfo is applied to presence (see previous posts Presence – More than you wanted to know and Is the Presence Social?) the value of the Event header field is set to presence.winfo.
The package defines a new MIME type application/watcherinfo+xml. When a SIP request or response contains a Content-Type header field set to application/watcherinfo+xml, it is indicating that the body is an XML document that contains watcher information.
NOTIFY sip:Richard@operator.com SIP/2.0
<?xml version="1.0"?> <watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo" version="0" state="full"> <watcher-list resource="sip:Richard@operator.com" package="presence"> <watcher id="23456abcd" event="subscribe" status="pending">sip:Jorgen@operator.com</watcher> </watcher-list> </watcherinfo>
Our scenario can be following. Jorgen subscribes for a winfo.presence package. When Richard wants to watch Jorgen’s presence Jorgen has to approve it first. Based on the approval status Richard’s subscription can be in pending/active/terminated state.
So our call will look like:
This is so-called reactive authorization. There can be also some services applied by PS e.g. black-list alerting, pro-active subscription etc.
Some more information can be found in Presence – from the other site.