Web-based Screen Pop

From VESupport

Revision as of 21:56, 27 June 2012 by Ronjtanner (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Background

OPC (and I guess Global Telelinks now) want to be able to use Border Elements, but need a way to notify people that they have calls. So we thought, we'd just build something out and give them the code (or run something as a service).

Generally with AJAX, you have the client poll constantly -- the issue with that is that there can be a delay in getting the screenpop, and that can cause a lot of load on the server.

To solve this we wrote a Comet application so that the client is notified whenever a call comes in.

How it Works

We have the client make an asynchronous request using Javascript (it calls Check.nfy -- passing it's Agent ID) to the web server asking if there is anything assigned to it for that particular agent. It times out after 60 seconds (client side). I have some neat logic built in so that if for some reason the request gets cancelled and returns early, it will immediately open up a new request.

We set up the web server so that it handles any requests to *.nfy asynchronously. This is essential because, IIS can only handle a couple hundred synchronous requests at a time.

When the server gets a request from a client, it checks shared memory to see if there is anything pending and then creates a new instance of a manual reset event and waits up to 60 seconds before it is either triggered or times out.

When the IVR wants to notify a client that there is a call waiting for it, it just makes an HttpRequest to notify.nfy and passes a few different parameters (more on that below). When the web server gets the request it stores it into shared memory.

We have a separate thread that checks the shared memory every few milliseconds (I think it's set to 10 or 20) to see if there are any messages for any of the agents that are connected. If there are any messages available for any waiting agents, it triggers the reset event, and the messages goes off to the agent.

It's really fast, and seems like it should be pretty flexible, and easy for our customers to use.

If you want to test it out: Go to http://screenpop.voiceelements.com/

The username is test@test.com and the password is test

When you log in, you'll see a real ugly blank page, that just says "Waiting". We purposely kept it ugly, because we didn't want OPC or Global Telelinks to think that we wanted anything to do with their app.

Then when you want to force it to open up a new window, call something like this: http://screenpop.voiceelements.com/notify.nfy?AgentId=1&Url="ParameterTest.aspx?Name=Ron Tanner?Product=HmpElements"&Height=600&Width=600

The required fields are AgentId and Url. Please note that you can pass any URL there (say "http://www.lds.org"). So that we can pass parameters on to the webpage, you'll want to wrap up everything in quotes (like above).

Optional Parameters are Height and Width (which specify how big you want the new browser window).

Keep in mind that most browsers block popup windows, so you'll have to allow from the website, and then try again.

Personal tools