- Contents
Interaction Scripter Developer's Guide
Inbound Waiting For Call Page
This JavaScript code demonstrates how to set up a waiting for call page for an inbound workgroup. It also demonstrates how a single page can handle calls from different inbound workgroups.
<html> <head> <title>Wait for Call</title> <meta name=IS_Action_SetForeground> <meta name=IS_Action_SelectPage> <script type="text/javascript" defer> scripter.myQueue.objectAddedHandler = ObjectAdded; function ObjectAdded(ObjType, ObjId) {
// we only want to look at call objects (type 2) if (2 == ObjType) { scripter.callObject.id = ObjId; var workgroup = scripter.callObject.getAttribute("EIC_AssignedWorkgroup") + "";
// adding an empty string guarantees a string if ("" == workgroup) { // legacy support workgroup = scripter.callObject.getAttribute("AssignedWorkgroup") + "";
// adding an empty string guarantees a string } // compare case insensitive switch (workgroup.toLowerCase()) { //depending on the workgroup name we pop the appropriate page case "sales": window.location.href = "http://server/campaigns/sales"; break; case "marketing": window.location.href = "http://server/campaigns/marketing"; break; default: // this is not a call from a workgroup that we care about break; } } } </script> </head><body> <p>Wait for Call</p> </body> </html>