Cisco Unified Presence APIs Developer Forums

« Back to SOAP API

Doubts in Subscribing using Presence Web Service API

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi,
 
I have a doubt in subscribing using the Presence web service API.
 
I know that we need to do the following steps to subscribe for the presence.
  1. Register a HTTP endpoint.
  2. Send a subscribe request specifying the contact list, expiration time and HTTP endpoint id.
  3. Whenever a change happens in the presence details of any of the contacts in the subscription, the server sends a notify message to the registered endpoint.
  4. Client calls the getSubscribedPresence method to get the latest data.
 
My dobuts are:
  1. When I look into the response for the subscribe request, I don't find any other information apart from the subscription id. Then how do I get the initial presence information (i.e. the presence details at the time of subscription)?
Should I have to call the GetSubscribedPresence method immediately after calling the subscribe method? or Should I have to use the getPolledPrsence to get the initial presence and then do the subscription?
 
  2. Will the GetSubscribedPresence method return only the presence details of the contacts whose presence is changed or will it return the presence details of all the contacts associated with the presence? Similarly, will it return only updates on the presence informtion for a contact or the complete presence details of the contact?
 
  3. Can I use more than one HTTP endpoint for a same applicaiton user? E.g. one endpoint to get the change notifications for one set of users (associated with a subscription, say S1) and another endpoint to get the change notifications for another set of users (associated with a subscription, say S2).
 
Please help me to get these doubts clarified.
 
Thanks in advance.
 
Regards,
Ilayaraja M
 

Hi,
 
To response to some of your queries ...
 
1. The developer doc (http://developer.cisco.com/web/cupapi/docs) clearly stated the sample response as below
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<getSubscribedPresenceResponse xmlns="urn:cisco:cup:presence:soap">>
<PresenceResponse>
<presenceType>BASIC_PRESENCE</presenceType>
<basicPresenceList>
<contact contactURI="enduser1@cisco.com" presenceStatus="BUSY"/>
<contact contactURI="enduser2@cisco.com" presenceStatus="AVAILABLE"/>
<contact contactURI="enduser3@cisco.com" presenceStatus="UNKNOWN"/>
</basicPresenceList>
<richPresenceList></richPresenceList>
</PresenceResponse>
</getSubscribedPresenceResponse>
</soapenv:Body>
</soapenv:Envelope>
The <contact> would be showing the presense status.
 
And the difference between the Subscribed Presence Request and Polled Presence Request is as below ,
The getSubscribedPresence request returns presence information for a subscription. This method is called following a notify message from Cisco Unified Presence. But, the getPolledPresence request returns presence information for a list of users.where you keep contactsList (-i.eThe list of contact URIs that are part of the polled presence request.) in the get request. So i believe in your case, you  have to call the GetSubscribedPresence method immediately after calling
the subscribe method.
 
2. I belive GetSubscribedPresence will return complete presence details, see the below sample response...
<pre style="margin: 0em;">
<presence entity="sip:ashutosh@ncbu2.com"
xmlns="urn:ietf:params:xml:ns:pidf"
xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model">
<dm:person>
<activities xmlns="urn:ietf:params:xml:ns:pidf:rpid">
<unknown xmlns="urn:cisco:params:xml:ns:pidf:rpid"/>
</activities>
</dm:person>
<tuple id="default">
<status>
<basic>closed</basic>
</status>
</tuple>
</presence>

3. This is theoretically possible, not sure on the implimentation.

Please refer developer doc in http://developer.cisco.com/web/cupapi/docs
</pre>