- Contents
Interaction Scripter Developer's Guide
Workgroup Queue Watcher Script
The JavaScript below demonstrates how to set up a workgroup watcher within Scripter for watching objects being added and changed in a workgroup.
function ConnectToQueue(p_QueueName) { g_CustomQueue = scripter.createQueue();
// valid queue types are // 3 station queue // 9 user queue // 10 workgroup queue // 15 line queue
g_CustomQueue.connect(10, p_QueueName); g_CustomQueue.callObjectAddedHandler = callObjectAdded; g_CustomQueue.objectChangedHandler = callObjectChanged; g_CustomQueue.objectRemovedHandler = callObjectRemoved;
alert("Connected to Queue" + p_QueueName); }
function callObjectAdded(p_Call) { alert(p_Call.id + " has been added to the queue"); }
function callObjectChanged(p_Type, p_ID) { //only concerned with call objects if (p_Type == 2) { alert(p_ID + " has changed state"); } }
function callObjectRemoved(p_Type, p_ID) { //only concerned with call objects if (p_Type == 2) { alert(p_ID + "has been removed from queue"); } }