07-05-2016 06:14 AM
Dear Community,
We're currently developping a morning check tool to check if the presence engine is working.
We're using PWS through REST.
Our tool is really simple:
1. login user A
2. set user B in the contactlist of user A
3. login user B
4. setPresenceStatus of user B to Busy
5. user A getPresenceStatus from User B
During our tests we noticed that getPresenceStatus only works if UserA and UserB are logged in Jabber client.
If they aren't, PWS always answer that the users are unavailable.
Is it the expected behaviour?
If yes, what would be correct API to use to set and get relevant presence status without necesseraly logging user A&B into jabber.
Thanks for your advises
./WM
Solved! Go to Solution.
07-05-2016 12:27 PM
AFAIK this should work (without Jabber clients), and seems to in my 10.5 test environment:
(login app user to get app session ID)
Login labuser1
POST https://10.194.104.62:8083/presence-service/users/labuser1/sessions
Presence-Session-Key: 577c04a7-146-4941dfa2-2591-2
--------------------------
<?xml version="1.0" encoding="UTF-8"?>
<session>
<sessionKey>577c057f-17d-66c94166-7569-1</sessionKey>
</session>
Login labuser2
POST https://10.194.104.62:8083/presence-service/users/labuser2/sessions
Presence-Session-Key: 577c04a7-146-4941dfa2-2591-2
--------------------------
<?xml version="1.0" encoding="UTF-8"?>
<session>
<sessionKey>577c06fe-f1-7852b5e5-51fa-1</sessionKey>
</session>
Set presence of labuser1
PUT https://10.194.104.62:8083/presence-service/users/labuser1/presence/basic
Content-Type: application/xml
Presence-Session-Key: 577c057f-17d-66c94166-7569-1
Presence-Expiry: 86400
Presence-Override: false
<?xml version="1.0"?>
<presence>AVAILABLE</presence>
Get polled presence on behalf of labuser2 for contact labuser1
Presence-Session-Key: 577c06fe-f1-7852b5e5-51fa-1
---------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<presenceList type="basic">
<contact presenceStatus="AVAILABLE" contactURI="labuser1@ds-cups105.cisco.com"/>
</presenceList>
07-05-2016 12:27 PM
AFAIK this should work (without Jabber clients), and seems to in my 10.5 test environment:
(login app user to get app session ID)
Login labuser1
POST https://10.194.104.62:8083/presence-service/users/labuser1/sessions
Presence-Session-Key: 577c04a7-146-4941dfa2-2591-2
--------------------------
<?xml version="1.0" encoding="UTF-8"?>
<session>
<sessionKey>577c057f-17d-66c94166-7569-1</sessionKey>
</session>
Login labuser2
POST https://10.194.104.62:8083/presence-service/users/labuser2/sessions
Presence-Session-Key: 577c04a7-146-4941dfa2-2591-2
--------------------------
<?xml version="1.0" encoding="UTF-8"?>
<session>
<sessionKey>577c06fe-f1-7852b5e5-51fa-1</sessionKey>
</session>
Set presence of labuser1
PUT https://10.194.104.62:8083/presence-service/users/labuser1/presence/basic
Content-Type: application/xml
Presence-Session-Key: 577c057f-17d-66c94166-7569-1
Presence-Expiry: 86400
Presence-Override: false
<?xml version="1.0"?>
<presence>AVAILABLE</presence>
Get polled presence on behalf of labuser2 for contact labuser1
Presence-Session-Key: 577c06fe-f1-7852b5e5-51fa-1
---------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<presenceList type="basic">
<contact presenceStatus="AVAILABLE" contactURI="labuser1@ds-cups105.cisco.com"/>
</presenceList>
07-06-2016 03:17 AM
Hello,
Thank you so much for your feedback. We noticed in your sample that you've set presence overide to false.
We tried it once and it also worked for us.
Documentation states that, when set to true, this parameter allows PWS to override the presence status of all end user devices. Don't really understand why our code only works when presence override is set to false.
Regards,
./WM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide