Web-based Screen Pop
Many of our clients want to be able to use Voice 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 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.
How To Test It Out
Here is how to test it out:
Go to 
The username is email@example.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 our clients 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.