cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3029
Views
1
Helpful
18
Replies

server to server application for notifications

stephan.steiner
Spotlight
Spotlight

Hi

I need to develop a server to server solution that monitors agent for state changes. I understand that I need to do a subscribe request for every agent I'm interested in and I understand the data format that is returned. And based on the protocol matrix section, I think that I need to talk XMPP to the finesse notification service.

But what about the plumbing around it? I've worked with the presence API where I indicate a local endpoint that is listening for notifications.. then presence does a get on that address and I know there's new data to be extracted.

Clearly, with Finess things do work differently. I take it that I need to do some kind of xmpp subscription for things to work out. Are there any samples for server to server apps? I'm targetting .net but I suppose any sample is better than none. While there's a subsection in the notification chapter in the documentation, it only mentions the BOSH channel - and as I'm doing server to server, I need the XMPP channel instead.

Thanks

Stephan

1 Accepted Solution

Accepted Solutions

ptindall
Cisco Employee
Cisco Employee

Stephan,

There's some Java server to server code here that works with Finesse -- you might want to take a look at the XMPP class in here https://cisco.box.com/robotagentsource

This particular example is a robot agent tool for running automated virtual agent activity.   The top level link is here if you need it https://cisco.box.com/CC-Traffic-Simulation

Paul

View solution in original post

18 Replies 18

ptindall
Cisco Employee
Cisco Employee

Stephan,

There's some Java server to server code here that works with Finesse -- you might want to take a look at the XMPP class in here https://cisco.box.com/robotagentsource

This particular example is a robot agent tool for running automated virtual agent activity.   The top level link is here if you need it https://cisco.box.com/CC-Traffic-Simulation

Paul

Paul

Thanks, this will definitely come in handy

@Paul Tindall: Could it be that the source dump is incomplete? When I try to build, I get complaints about a missing exception package

Certainly possible. Let me know what error you're getting and I'll check it.

According to the jar, I'm at least missing the following classes: IllegalOrphanException, NonexistingEntityException, PreexistingEntityException.

Looks like these were auto-generated by the IDE when the Java Persistence bit was added.  I've uploaded them to the source folder on Box under autoagent.exceptions if you have to add manually.   The JPA part is only there to make it easier to expose current status data to monitoring web apps etc so it's not essential in any way to the Finesse interfacing part.

Paul

Is there another prerequisite that needs to be satisfied so this can run? I managed to compile and start running it, but after 3 lines of code things crap out after a long waiting time:

Exception in thread "main" java.lang.ExceptionInInitializerError

  at autoagent.Main.main(Main.java:77)

Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named AutoAgentPU

I tried the same in Netbeans, same story there. I can run the jar just fine but I need to see what's really going on (plus the jar isn't really doing much.. I see a lot of 404 returns even though I know the API works.. I've tried various commands with my own C# lib and they work).

I tried commenting out code that uses the persistence layer (as apparently the problem comes from there), but to no avail.. it's so deeply integrated I can't just rip it out. Is there an older version without the persinstence layer so I don't have to go through the process of setting all up just to get the sample running? (in the end I just care about seeing and sniffing what happens.. my implementation will be in c#).

I've posted a simplified version for you with persistence and embedded web server ripped out.

https://cisco.box.com/robotversions

Thanks.. now I can step through the code. I'm also getting 404s when trying to extract data for the user and realize I should've used the port all along.

While I play with this.. I hope you don't mind a related question - my app is server to server so I'm wondering about authentication. I posted the full rundown in another thread.

agent login in server to server scenario - what credentials to use?

The question also applies to XMPP subscription.. ideally I'd have one session that subscribes for events for different users (at the moment I just need user states), plus with XMLPP I wonder about authorization.. who gets authorized to subscribe to which user.

Currently, Finesse doesn't expose an all-events / multi-agent interface so you really have to run a session per agent at the server-side.  The only other way to get visibility (and limited control) of more that one agent is as a supervisor but that would lead to a fairly clunky solution and would more often than not hit supervisor/agent limits.   To address the security issue, going forward, you may be able to make use of the road-mapped single sign-on mechanism but for now I think you'll have to pass the credentials securely to the server.

But, the devguide clearly states that you can subscribe for other events than the logged in user's. So, how would authorization work there and are there any samples to look at?

And how would SSO work in a server to server scenario? We have SSO in place for the UC infrastructure, but that's for end users - we use app users for server side applications, coupled with local end users for another API not really made for server to server applications (presence webservice). After all the server application would either work on a service account that isn't mapped to a user in the UC system, or a local account on the machine it runs on. Or is there an impersonation part to the SSO component I'm missing?

I can partially respond to my own question... doing trial & error I found that:

supervisors seem to be able to see and manage their team (even change their state) and there's a system parameter that allows a supervisor to be active everywhere.

This also seems to hold true for the notification mechanism that I got working with the matrix xmpp library. I can now subscribe to notifications of other users/teams in a session.

So I guess I have to build a virtual team containing all the agents I'm interested in, assign that to a local cucm enduser that my app creates, and use that to do what I want to do. The missing bit of the puzzle is now how to managed that virtual team.. I'm not seeing a method to add a team or update a team.

upchaurasia
Spotlight
Spotlight

Hello,

We are also try to capture events for every agent state change. We can see there is one user in Finesse name "finesse" added to my agent when agent logged-in in Pidgin.

What is the use of "finesse" user? Is it possible to use "finesse" use to capture events of all agents.

Thanks & Regards,

Umesh

The "finesse" user is solely used for presence. As stated in chapter 7 of the developer guide:

The presence of the 'finesse' BOSH user:

Presence indicates whether Finesse has an active connection to the Cisco Finesse Notification Service (Unified CCE) or the Cisco Unified CCX Notification Service (Unified CCX) . An UNAVAILABLE presence for the 'finesse' BOSH user may mean that the connection is lost or that the Finesse web app crashed.

You cannot use the "finesse" user to capture events of all agents.