It's not the whole page, but should have the relevant parts.
Meta tags are defined before the script.
The script begins by setting onload = init, then setting some global variables.
init runs some functions to set up the status change selection and the disposition radio buttons.
__________________________________________
If the agent logs in via Campaign|Log On|[Choose Campaign]
Two handlers are executed:
IS_Event_NewPredictiveCall()
The scripter objects (IS_ATTR_FirstName.value, etc.) are used to set values in the page.
callObjectAdded(CallObject)
the CallObject parameter is used to set values in the page (document.getElementById("NUMBERDIALED").innerText = CallObject.remoteId;)
__________________________________________
If the agent has the Security right [Logon Campaign] checked (so that he is auto-logged into all available campaigns, there is only one available campaign in our test)
Two handlers are executed:
IS_Event_NewPredictiveCall()
The scripter objects (IS_ATTR_FirstName.value, etc.) are used to set values in the page.
callObjectAdded(CallObject)
when attributes of the CallObject are addressed (CallObject.remoteId;) an error is thrown (Automation is not supported on null values)
__________________________________________
The end result is that I get different results based on how the agent logs in.
//Meta Tags
<meta name="IS_Action_ClientStatus">
<meta name="IS_Action_Pickup">
<meta name="IS_Action_SetForeground">
<meta name="IS_Action_SelectPage">
<meta name="IS_Action_RequestBreak">
<meta name="IS_Action_EndBreak">
<meta name="IS_Action_RequestLogoff">
<meta name="IS_Action_Disconnect">
<meta name="IS_Action_CallComplete">
<meta name="IS_Action_Close">
<meta name="IS_Action_Transfer">
<meta name="IS_System_AgentID">
<meta name="IS_System_ClientStatus">
<meta name="IS_ATTR_Callid">
<meta name="IS_ATTR_CampaignName">
<meta name="IS_ATTR_FirstName">
<meta name="IS_ATTR_LastName">
<meta name="IS_ATTR_CustomerAccountNumber">
<meta name="IS_ATTR_WorkPhoneNumber">
<meta name="IS_ATTR_numbertodial">
<meta name="IS_ATTR_phonenumbertype">
<meta name="is_attr_ElevateNumber">
<meta name="IS_ATTR_AccountNumber">
<meta name="IS_ATTR_LOANNUMBER">
<meta name="IS_ATTR_CITY">
<meta name="IS_ATTR_STATE">
<meta name="IS_ATTR_PORTFOLIOID">
<script language="javascript">
window.onload = init;
var h = 0;
var m = 0;
var s = 0;
var strBreakStatus = "";
var baseURL = "https://test.application.com/agent/html/loadEntity?"
var doScreenPop = "NO"
var queryANI = "ani="
var queryPortfolio = "portfolioId="
var queryAccount = "acct="
var currentID = "";
function init() {
buildStatus();
scripter.myUser.statusChangeHandler = userStatusChange;
scripter.myQueue.callObjectAddedHandler = callObjectAdded;
scripter.callObject.stateChangeHandler = stateChange
buildDisposition();
document.getElementById("GREETING").innerHTML = "<h2>Waiting for call </h2>"
setInterval('Timer();', 1000);
SetTag();
}
function callObjectAdded(CallObject){
document.getElementById("NUMBERDIALED").innerText = CallObject.remoteId;
baseURL = CallObject.getAttribute('ELE_BaseURL')
doScreenPop = CallObject.getAttribute('ELE_DoScreenPOP')
queryANI = queryANI + (CallObject.remoteId).replace(/\D/g,'')
currentID = CallObject.id;
}
function IS_Event_NewPredictiveCall()
{
IS_Action_SetForeground.click();
IS_Action_SelectPage.click();
IS_Action_Pickup.click();
var strHTML = 'Hello this is [Agent], can I speak to [FirstName] [LastName]<br/>'
strHTML = 'Hello, may I speak with [FirstName] [LastName]<br/>'
strHTML = strHTML.replace("[FirstName]", IS_ATTR_FirstName.value);
strHTML = strHTML.replace("[LastName]", IS_ATTR_LastName.value);
strHTML = strHTML.replace("[PhoneNumberType]", is_attr_phonenumbertype.value);
document.getElementById("CAMPAIGNNAME").innerHTML = "<h1>Campaign: " + IS_ATTR_CampaignName.value + "</h1>";
document.getElementById("PHONENUMBERTYPE").innerText = is_attr_phonenumbertype.value;
document.getElementById("ACCOUNTNUMBER").innerText = IS_ATTR_AccountNumber.value;
document.getElementById("LOANNUMBER").innerText = IS_ATTR_LOANNUMBER.value;
document.getElementById("CITY").innerText = IS_ATTR_CITY.value;
document.getElementById("STATE").innerText = IS_ATTR_STATE.value;
var CallObject = scripter.callObject;
queryANI = queryANI;
queryAccount = queryAccount + IS_ATTR_AccountNumber.value;
queryPortfolio = queryPortfolio + IS_ATTR_PORTFOLIOID.value;
var TransferURL = baseURL + queryANI + "&" + queryAccount + "&" + queryPortfolio
document.getElementById("GREETING").innerHTML = strHTML;
document.getElementById("callstatus").innerText = CallObject.stateString;
if (doScreenPop == "YES"){
window.open(TransferURL,'KatabatPop','',true)
}else{
document.getElementById("SCREENPOP").innerText = TransferURL;
}
}
</script>
------------------------------
Tim Cannon
Elevate Credit Services, LLC
------------------------------
Original Message:
Sent: 04-08-2019 09:33
From: Sean Walls
Subject: Scripter Auto Logon
Can you provide a sample some of your code?
Assuming you have all of the scripter actions/events defined in your meta tags correctly, and there is a Predictive Call Event happening this should work.
I know previously I had issues even just getting the IS_System_AgentId.value in my init function on my waiting page.
------------------------------
Sean Walls
Original Message:
Sent: 04-04-2019 15:52
From: Tim Cannon
Subject: Scripter Auto Logon
It is an SPA and I'm using body.onload to fire init().
I am using a function callObjectAdded(CallObject){}
to set some values based on the CallObject
and the function IS_Event_NewPredictiveCall(){}
to process the Event.
When the agent does auto-logon, the CallObject in the function has no attributes. And when I use the scripter.callObject in the IS_Event function it does not have attributes either.
------------------------------
Tim Cannon
Elevate Credit Services, LLC
Original Message:
Sent: 04-04-2019 09:43
From: Sean Walls
Subject: Scripter Auto Logon
Can you be more specific on how you are initializing these?
Is this a SPA?
I faintly remember years ago, I ran into issues using jQuery's document.ready, and instead had to put my init() function in the body.onload. I think an IIFE worked as well. You may want to experiment too with marking the agent ready for calls when you are sure your scripter objects are initialized.
------------------------------
Sean Walls
Original Message:
Sent: 04-03-2019 16:02
From: Tim Cannon
Subject: Scripter Auto Logon
I have a problem in a custom script. When the agent is set to Auto logon (Logon Campaign is unchecked), the scripter objects don't initialize correctly. What do I need to call in the script to make sure all of the resources are initialized?
Thanks,
#Outbound
------------------------------
Tim Cannon
Elevate Credit Services, LLC
------------------------------