cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1907
Views
0
Helpful
2
Replies

Does PWS requires Jabber client

wimarques
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

dstaudt
Cisco Employee
Cisco Employee

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

GET https://10.194.104.62:8083/presence-service/users/labuser2/presence/basic/contacts/labuser1@ds-cups105.cisco.com

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>

View solution in original post

2 Replies 2

dstaudt
Cisco Employee
Cisco Employee

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

GET https://10.194.104.62:8083/presence-service/users/labuser2/presence/basic/contacts/labuser1@ds-cups105.cisco.com

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>

wimarques
Level 1
Level 1

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