Page 1 of 1

agent API logout not working as expected

PostPosted: Mon Jun 19, 2017 1:44 pm
by Two8nine
Hi, we're currently in the midst of getting a Vicidial testing environment running for our site, having an issue I'm hoping I can get some input on.

We're pretty specialized, and have some pretty complex calling rules, so rather than try to adapt Vicidial to this, we intend on using our inhouse campaign management software, with Vicidial being the replacement for agent and phone management. (previously UCCX)

I'm developing a desktop app that integrates the two systems, and having issues with the log-in/log-out functions. We cannot allow agents access to campaign selection, so logging in is handled internally. This we've got working ok, they just submit a username and password, and they are logged into whatever campaign the manager has selected for them. (HTTP post request handled by apacheclient 4.3).

This works, the agent conference initiates ok, and they are shown logged-in on the server/admin page.

However, if I submit the logout request as per the api, the server responds ok, i.e: SUCCESS: logout function set - LOGOUT|1497895547|102

But the agent call does not change, nor are they logged out of the server. If I repeat the above steps in say, Chrome, it all works fine -- but the logout php does nothing if run in our app. (java mostly) I'm thinking it has to do with the session id not matching, but not sure.

Appreciate any thoughts.

Re: agent API logout not working as expected

PostPosted: Mon Jun 19, 2017 4:12 pm
by mflorell
I don't really have a clear picture of how you are running things. The Agent APIs were designed to work with agents logging in through standard web browsers(Firefox, Chrome, etc...) We have never tested them running in different environments, and the agent screen needs a full Javascript-enabled web browser to run properly.

Re: agent API logout not working as expected

PostPosted: Mon Jun 19, 2017 5:20 pm
by Two8nine
The main thing I've been instructed to do is bypass the agent screen entirely, as under no circumstances are the agents to be able to see the campaign selection screen.

I do understand that it has to be running regardless, so what I'm trying to do is run it in a hidden state, passing in the login data through our own login screen (campaigns are selected by admin), this works, and calls can be made ok, but the api doesn't work. (more and more I suspect it's because the session id's don't match when doing it this way.) I don't think the programming environment is causing issue, as I can run the site ok within our app, and everything works as long as it's visible. (This is a javafx webview) The only snag we seem to hit it the api commands don't seem to do anything unless the agent screen is actively visible. (i.e. running it in the background logs in and allows calling, but doesn't recognize things like logout and external_hangup, despite the server responding that the commands were successful.

The other option I suppose is to just run the agent screen in it's own tab inside of our app, which already works, but still need a way to prevent agent campaign selection.

This may end up being more of a java/apacheclient question however, so I've got some feeling off there as well.

Re: agent API logout not working as expected

PostPosted: Mon Jun 19, 2017 9:59 pm
by mflorell
You can run the agent screen in a hidden IFRAME, there is an example of how to do this in the extras/crm_iframe folder in the codebase.

Re: agent API logout not working as expected

PostPosted: Tue Jun 20, 2017 8:18 am
by Two8nine
Will give that a go, appreciate the responses.