cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4211
Views
3
Helpful
7
Replies

Getting status info from a Jabber server

shayhodg
Level 1
Level 1

Is it possible to programmatically get status info from a Jabber server - e.g., is a person online? - without an account on the server?


Specifically, we were thinking of creating a physical board with LEDs for our group within Cisco, mirroring the Jabber status colors in real space, using something like an Arduino Yun to connect to the Cisco Jabber server, but it seems we'd need to use someones CEC ID and password on the Arduino to log into server to get the status info?

Thanks,

Shayne

1 Accepted Solution

Accepted Solutions

npetrele
Cisco Employee
Cisco Employee

You don't need an account on server X to get presence status for accounts on server X. All you need to do is log into some other Jabber server (server Y) and add contacts from server X.  If server X is configured to approve contact requests automatically, then the users on server X don't even have to approve the request to add them as contacts.

Here's one example:  Let's say you have an account with jabberpl.org.  Log into that account and add a Cisco Jabber user as a contact.  Assuming the Cisco Jabber user approves the contact request, or the Cisco Jabber server automatically approves such requests, you now get presence updates for that Cisco Jabber user without needing an account on the Cisco Jabber server.

Here's an example of the presence setting that eliminates the requirement for approval:

presence.png

View solution in original post

7 Replies 7

npetrele
Cisco Employee
Cisco Employee

You don't need an account on server X to get presence status for accounts on server X. All you need to do is log into some other Jabber server (server Y) and add contacts from server X.  If server X is configured to approve contact requests automatically, then the users on server X don't even have to approve the request to add them as contacts.

Here's one example:  Let's say you have an account with jabberpl.org.  Log into that account and add a Cisco Jabber user as a contact.  Assuming the Cisco Jabber user approves the contact request, or the Cisco Jabber server automatically approves such requests, you now get presence updates for that Cisco Jabber user without needing an account on the Cisco Jabber server.

Here's an example of the presence setting that eliminates the requirement for approval:

presence.png

For server-to-server type applications, where the application wants to monitor presence status for multiple users, see the 'Presence Web Service' APIs (REST and SOAP), covered in the Developer Guide here

Cisco CUPAPI

Thanks.  I figured that should work.  The SOAP/REST services let me access the contacts in the roster, so I figure it should also allow me to set an endpoint and set presence notifications for that contact, even if that contact exists on a non-Cisco Jabber server. 

Thanks for all the help.  I just want to make sure I'm clear on one thing.

I install a Jabber server on a VM on one of my servers.  I create an account on my Jabber Server - call the account Yun- and then have Yun add the contacts of our team from the main Cisco jabber server, which our team members have to approve.  Once approved, I can then call the REST API on my server, using account Yun, to get the status info of the contacts shared from the main Cisco Jabber server?

Thanks!

Shayne

No, I don't think it would work that way with SOAP.  I know you could do that with the Jabber SDK.  You could log in as Yun with the Jabber SDK and receive all the presence updates for Yun's contacts.  That might not do you much good, though, because Javascript couldn't control your physical board.

If you want to use SOAP presence web services, this is how you'd normally do it:  Create an Application User on the main Cisco Jabber server.  Then when you use PWS (presence web services, soap or rest), you follow this logic in your code:

1. Log in as the app user, get the session key. 

2. Use that session key to register an endpoint. The endpoint is a URL to a web service (you need to write that separately) that handles the presence notifications. You will get an endpoint ID.

3. Use that endpoint ID to subscribe to the presence of end user contacts to get notifications.

4. Repeat as needed until you have subscribed to the presence of all the contacts.

When a presence changes for one of the end users you subscribed, it should trigger a call to endpoint web service. 

Here's the documentation for EPASSoap and PWS:

https://developer.cisco.com/fileMedia/download/a2ce9071-4c3b-4ad5-adaa-095153ea1b4c

If you can't create and use an Application User on the main Cisco Jabber server, then I think you'd need to take another approach, like Jabber SDK, or any of a dozen other Jabber APIs in various languages that can log in as Yun and process presence notifications. David Staudt can correct me if I'm wrong on this, but that's how I understand it. 

Another thing you might want to investigate:  XMPP federation.  It looks like if you define the main server as a federated domain, your separate Cisco Jabber server can get presence updates from the main server.  Here's a screen shot to show you which setting I mean:

federation.png

Andrew Waylen
Level 1
Level 1

I was wondering if you had any luck with this and if you did if you could possibly provide a sample for the code you used to display individual users presence (without being authenticated and using an existing roster)?

Thanks,

Andrew