- Contents
Interaction Scripter Developer's Guide
dialer object
Definition
The dialer object encapsulates properties of the agent's session with Dialer and properties such as which campaigns the agent is active in.
Methods
Ends a break so that the agent will receive campaign calls. |
|
This method requests a break. Dialer will automatically grant the break when its predictive algorithm determines that enough agents are available to process calls without this agent. |
|
dialer.sendCustomHandlerNotification
|
Initiates custom handlers through the custom notification initiator.
|
dialer.subscribeToCustomHandlerNotification | This hook allows a custom script to asynchronously subscribe and listen to a Send custom notification step in a custom handler. |
Callbacks
campaignLoginHandler |
This handler is invoked when agents are logged into a campaign by an administrator. |
This handler is invoked when agents log out of a campaign. |
|
This handler is invoked whenever the agent requests a break. |
|
This handler is invoked whenever a break request is granted. |
|
This handler is invoked whenever a break ends. |
|
This handler is invoked whenever a user is logged into or out of a campaign. |
Properties
breakStatus |
This property returns the agent's break status (On Break, Break Pending, Not on Break). |
campaigns |
This property returns an array of campaigns that the agent is active in. |
Example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Dialer Object Demo Page</title> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script language="javascript">
// This is a sample script utilizing the dialer object in an autoloaded page. $(document).ready(function() { init(); });
function init() { // Add a handler to pick up changes to the campaigns list. (new campaings being logged into, or out of) scripter.dialer.campaignsChangedHandler = handleDialerChange; InitTagValues() }
function InitTagValues() { $("#tagAgentId").html(scripter.myUser.name); $("#tagServerId").html(scripter.notifierName); $("#tagFirstCampaignName").html(scripter.dialer.firstCampaignName); $("#tagCampaignEnum").html(fillCampaignList()); $("#tagDialerCampaigns").text(scripter.dialer.Campaigns); $("#tagBreakStatus").html(evalBreakEnum(scripter.dialer.breakStatus)); $("#RequestBreakBtn").click( function() { scripter.dialer.requestBreak(); }); $("#EndBreakBtn").click( function() { scripter.dialer.endBreak(); }); $("#RefreshBtn").click( function() { window.location = "http://localhost/script.htm"; } ); scripter.dialer.breakRequestedHandler = HandleBreakChange; scripter.dialer.breakGrantedHandler = HandleBreakChange; scripter.dialer.breakEndedHandler = HandleBreakChange; scripter.dialer.campaignLoginHandler = handleLogInChange; scripter.dialer.campaignLogoutHandler = handleLogoutChange; }
function HandleBreakChange() { $("#tagBreakStatus").html(evalBreakEnum(scripter.dialer.breakStatus)); }
function handleDialerChange() { InitTagValues(); }
function handleLogoutChange(campaignName) { alert(campaignName); InitTagValues() }
function handleLogInChange(campaignName) { alert(campaignName); InitTagValues(); }
function evalBreakEnum(e) { switch (e) { case 0: return "Not On Break"; break; case 1: return "Break Pending"; break; case 2: return "On Break"; break; case 3: return "Not Logged Into a Campaign"; break; } }
function fillCampaignList() { var campaigns = scripter.myUser.startAvailableCampaignObjectEnum; var campaignList = ''; while (campaigns.hasMoreElements()) { var campaign = campaigns.nextElement(); campaignList += campaign.campaignName + ','; } return campaignList; } </script> </head>
<body> <button id="RefreshBtn">Text</button><br /> <table border="1" cellpadding="5"> <tr> <td>Agent ID</td> <td><span id="tagAgentId" /></td> </tr> <tr> <td>scripter.notifierName</td> <td><span id="tagServerId" /></td> </tr> <tr> <td>scripter.dialer.firstCampaignName</td> <td><span id="tagFirstCampaignName" /></td> </tr> <tr> <td>scripter.myUser.startAvailableCampaignObjectEnum</td> <td><span id="tagCampaignEnum" /></td> </tr> <tr> <td>scripter.dialer.Campaigns;</td> <td><span id="tagDialerCampaigns" /></td> </tr> <tr> <td>scripter.dialer.breakStatus</td> <td><span id="tagBreakStatus" /></td> </tr> <tr> <td><button id="RequestBreakBtn">request break</button></td> <td><button id="EndBreakBtn">end break</button></td> </tr> </table> </body> </html>