cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7735
Views
0
Helpful
4
Replies

Jabber SDK - Update Presence

acbwardsmith
Level 1
Level 1


Hi,

I have built a custom application using CAXL and would like to add additional functionality which allows for updating the presence for a given user.  I am not sure if my approach is incorrect or if special permissions need to be set up on the server for the user connecting to the client in order for that user to update another user's presence.  Below is my attempt.

To create the contact for the user whose presence needs updating I'm calling:

     var contact = client.entitySet.entity(jid);

I am then storing the presence object for this contact:

     var presence = contact.getPrimaryPresence();

Next I update the status message:

     presence.setStatus("New Message");

Finally, update the presence for the contact:

   var success =   contact.updatePresence(presence, false);

After this call, success = false, and thus the presence hasn't been updated as desired.  I have confirmed that the contact and presence exist/are not null.

Thanks!

1 Accepted Solution

Accepted Solutions

The CAXL API provides IM&Presence capabilities for a single end-user.  It does not have the ability to manage the presence status of other users.

To do something like that you will want to investigate the server-to-server 'Presence Web Services' APIs (SOAP and REST flavors) available on Cisco IM&P - see the Developer Guide for more details: https://developer.cisco.com/site/unified-presence/documentation/

There is a fairly extensive sample application and doc covering this API that may be helpful: https://developer.cisco.com/site/unified-presence/overview/web-services-reference-application/index.gsp

View solution in original post

4 Replies 4

npetrele
Cisco Employee
Cisco Employee

I'm not sure what you're trying to accomplish.  Are you trying to set the presence of someone other than yourself?  Someone in your roster or quick contact list? 

Essentially, yes.  The app should allow our receptionist to modify the presence for any user on the roster/quick contact list. 

The CAXL API provides IM&Presence capabilities for a single end-user.  It does not have the ability to manage the presence status of other users.

To do something like that you will want to investigate the server-to-server 'Presence Web Services' APIs (SOAP and REST flavors) available on Cisco IM&P - see the Developer Guide for more details: https://developer.cisco.com/site/unified-presence/documentation/

There is a fairly extensive sample application and doc covering this API that may be helpful: https://developer.cisco.com/site/unified-presence/overview/web-services-reference-application/index.gsp

Great, I will look into that.  Thanks!