Page 1 of 1

iframe, Agent Events Push

PostPosted: Wed Jun 06, 2018 11:53 am
by vicinewman
During the development we've got an issue with correct handling of a situation when a page, with an Iframe, is closed by a user.
We don't see an event (logged_out_complete, get2post callback).

It looks like it's just too little time for the iframe/script to sent this event.

Any tips how to correct handle this ?

Re: iframe, Agent Events Push

PostPosted: Wed Jun 06, 2018 1:33 pm
by mflorell
If you put vicidial.php in an IFRAME, and the main browser window is closed, it won't trigger the closed event. That's not an issue with the IFRAME, it's just how web browsers work.

Re: iframe, Agent Events Push

PostPosted: Thu Jun 14, 2018 6:04 am
by vicinewman
Yes of course, I understand this, that is why the next question - how to deal with the problem when the browser is closed for some reason?

In this case we have a "hanged agent" in the system. Some call could be routed to this “hanged agent”.
Any tips how to understand that there is “hanged agent” to make some further actions like remove it from system call routing, etc … ?

Re: iframe, Agent Events Push

PostPosted: Thu Jun 14, 2018 8:08 am
by mflorell
When we have run into this, we added similar onunload functions to the main web page, including a call to the Agent API to log the agent out.

If you want to go a more direct route, take a look at the code for Emergency Logout of an agent that runs in the admin.php script. It's a lot more complicated, but it does take care of most log issues.

Re: iframe, Agent Events Push

PostPosted: Thu Jun 14, 2018 9:05 am
by vicinewman
Thanks Matt for the prompt reply!
we will try this way