LA Agent Console Developer Guide
LA Agent Console Developer Guide
Guide
Updated: 2022-06-22
Contact Information
The Fusion Live Assist Agent Console SDK is a set of tools for developing a custom agent
application for Fusion Live Assist, and this guide describes the process from a developer
integration perspective. We assume the user is familiar with HTML5 and JavaScript.
CBA Live Assist uses the Fusion Client SDK for voice and video (where applicable) and
authorization. The CBA Live Assist Agent Console SDK is built on top of the Fusion Client
SDK, and helps with integrating the features of CBA Live Assist into a custom agent console.
In voice and video mode, the agent console is registered as a voice and video endpoint
using Fusion Client SDK.
Support sessions are directed to the agent console by directing inbound calls generated by a
CBA Live Assist enabled application or web page to that endpoint.
In co-browse only mode, the agent console and CBA Live Assist-enabled application must
be provided with a correlation ID - an identifier used to correlate the agent and consumer
sessions.
The mechanism by which this string is generated, and distributed to both agent and client
applications, is entirely up to the developer. See the Starting a Co-browse only Session section.
Creating, packaging, and deploying a web application is outside the scope of this document. In
what follows, we assume that you already have a basic application with an HTML page which will
be shown to the agent when they connect to it.
Note: We recommend that you deploy your Agent Console application to the FAS which also
hosts CBA Live Assist. This gives the simplest and most flexible arrangement. If the Agent
Console application is hosted on a separate web server, the application will not be able to use
the CBA Live Assist CallManager.
Loading Resources
A CBA Live Assist Agent Console application needs to include a number of JavaScript files and
Cascading Style Sheets (CSS). Add the following lines to each HTML page, where <fas
address> is the host name or IP address of the CBA Live Assist server. The scripts and style
sheets are available on the CBA Live Assist server (co-hosted with the Fusion Client SDK
Web Gateway):
<script src='<fas
address>/assistserver/sdk/web/shared/js/thirdparty/i18next-1.7.4.min.js'/>
<script src='<fas address>/gateway/adapter.js/>
<script src='<fas address>/gateway/csdk-phone.js/>
<script src='<fas address>/gateway/csdk-common.js/>
<script src='<fas address>/assistserver/sdk/web/shared/js/assist-aed.js/>
<script src='<fas address>/assistserver/sdk/web/shared/js/shared-
windows.js/>
<script src='<fas address>/assistserver/sdk/web/agent/js/assist-console.js/>
<script src='<fas address>/assistserver/sdk/web/agent/js/assist-console-
callmanager.js/>
Setting UI Elements
The console page must contain a DIV element to display the consumer’s screen when co-
browsing; it may also contain elements to display the video received from the consumer, a
preview of the video being sent to the consumer, and an indicator of the call quality. These
should be set after loading the scripts and before starting a support call. It will also need to
implement and set at least some of the callbacks available on the AssistAgentSDK object, and
should do so before starting a support call.
AssistAgentSDK.setRemoteView
Use this to set the DIV element which will show the consumer’s screen during co-browse.
CallManager.setRemoteVideoElement
Use this to set the DIV element to show the video received from the consumer. You do not need
to set this in co-browse only mode, but you should do so in voice and video mode.
Use this to set the DIV element to show the video from the agent’s own camera, which which is
also sent to the consumer. You do not need to set this in co-browse only mode, but it may be
useful in voice and video mode to let the agent know that their camera is working.
CallManager.setCallQualityIndicator
This is less often useful. If set, the DIV element shows an indicator of the current voice and video
quality of the call, which can sometimes provide useful feedback.
The AssistAgentSDK object has too many callbacks to detail here, but the ones you will probably
want to use most often are setRemoteViewCallback, setConsumerJoinedCallback,
setCallEndedCallback, and setOnErrorCallback. see The Size of the Remote View section , the
Requesting Screen Sharing section, the Ending a Support Session , and the Error Handling
section for details.
You will probably have your JavaScript code in a script file which is included by the HTML page;
a suitable time to set these elements is in an initialization function which is called when the file
loads to set up the UI elements:
(function() {
...
var remoteView = document.getElementById("sharingview");
var remoteVideo = document.getElementById("remotevideo");
var previewVideo = document.getElementById("previewvideo");
var qualityIndicator = document.getElementById("call-quality-indicator");
...
AssistAgentSDK.setRemoteView(remoteView);
...
CallManager.setRemoteVideoElement(remoteVideo);
CallManager.setLocalVideoElement(previewVideo);
CallManager.setCallQualityIndicator(qualityIndicator);
AssistAgentSdk.setScreenShareActiveCallback(function() {
...
});
}());
Note: Agents may find the local preview to be more intuitive if it is flipped so that it behaves more
like a mirror. Do this by applying a CSS transform to the provided DIV:
In order to start a voice and video session, the application calls CallManager.init, passing in a
configuration object. CallManager.init obtains a session token and correlation ID from the CBA
Live Assist server and starts a session, waiting for an incoming support call. When the agent
accepts the call, CallManager calls AssistAgentSDK.startSupport automatically. All the
application needs to do is to set up the configuration object (see the Configuration section) and
call CallManager.init at a suitable place in the program:
$(document).ready(function() {
...
var config = {autoanswer : 'true', agentName: 'Bob' };
config.username = 'agent';
config.password = 'password';
CallManager.init(config);
...
}
Configuration
When the agent console starts a support session, or initializes the CallMananger to do so, it
must provide a configuration object. The configuration object may have the following members:
Name Description
CallManager
Using CallManager.init to start the session and wait for an incoming support call is simple.
However:
It always starts a session for voice and video calling, even if a voice call is not wanted.
It does not make outbound calls (for support call back, for instance).
It overrides certain callbacks on the UC object (notably onInitialised; see the FCSDK
Developer Guide), which therefore are not available to the developer.
You can change some of this behavior in the configuration object, or by overriding functions in
CallManager, or by using the global UC object (see FCSDK Developer Guide). If developers still
need different behavior, they should either take the existing code in assist-console-
callmanager.js and modify it to their own needs, or write a similar module using only the
functions in AssistAgentSDK and the FCSDK.
var sessionToken;
var correlationId;
screenShareRequestButton.addEventListener("click", function(){
AssistAgentSDK.requestScreenShare();
...
});
AssistAgentSDK.setConsumerJoinedCallback(function(){
if (autoRequestCobrowse) {
AssistAgentSDK.requestScreenShare();
...
}
});
AssistAgentSDK.setScreenShareActiveCallback(function(active) {
if (active)
// consumer joined screenshare session
else
// consumer left screenshare session
}
The active parameter indicates whether the consumer is, or is not, actually sharing their screen.
If the consumer is using a mobile device, it is true when the co-browsing starts, and whenever
the application returns to the foreground after being put into the background; it is false when the
application goes into the background. When the consumer is using a web browser, active will
never be false, as a web browser cannot be put into the background in the same way that a
mobile application can. Whatever the consumer device, the agent application should receive a
call to this callback with a value of true when the consumer accepts the screen sharing request
and joins the co-browsing session for the first time.
The agent application can also receive a callback if the request for screenshare fails, either
because the agent does not have the necessary permissions, or because the consumer
application rejects it. In this case, the agent application may take whatever action is appropriate,
such as ending the support call or continuing without co-browsing support. At the very least, it
should inform the agent in its UI, and allow them to request screenshare again:
AssistAgentSDK.setScreenShareRejectedCallback(function() {
alert("Screenshare request rejected");
screenshareRequestButton.disabled = false;
}
In addition to providing a DIV on the screen (see the Setting UI Elements section) where CBA
Live Assist displays the consumer’s screen during a co-browsing session, the agent console
should implement a remote view callback, which is called when the co-browse becomes active
(see the Requesting Screen Sharing section), or the remote view changes size or shape. The
callback has parameters containing the remote view’s width and height, and the device’s pixel
ratio:
The agent console can use this call back to ensure that the DIV it provided to contain the co-
browse is a reasonable size. CBA Live Assist scales the remote view appropriately, so the
console application does not need to use the dimensions exactly; however, we recommend that
the agent application should take account of the aspect in order to make the best use of the
available space.
The devicePixelRatio parameter represents the ‘zoom factor’ on the consumer’s device. If the
consumer uses their browser’s zoom function to zoom to 200%, then the callback reports the
width and height of the remote view as half their real value, because the zoom causes each pixel
to occupy two pixels in height and width. The developer can use the devicePixelRatio to correct
for this, so that the size of the remote view DIV does not change.
Shadow Cursor
By default, CBA Live Assist displays the consumer’s mouse pointer on the agent’s screen
during screensharing, updating it every second. Set the shadowCursor and shadowCursorDelay
configuration properties (see the Configuration section) to change this behavior.
using your own image. The element will move about the agent’s screen as the consumer’s
mouse pointer moves.
You can also use the setConsumerCursorCallback function to register for a callback when the
consumer moves their mouse pointer. The callback function itself receives the x and y
coordinates of the shadow cursor on the agent’s screen in pixels.
AssistAgentSDK.setConsumerCursorCallback(function(x, y) {
cursor.style.left = x + 'px';
cursor.style.right = y + 'px';
if (count++ % 2)
cursor.setAttribute('src', '/img/image1');
else
cursor.setAttribute('src', '/img/image2');
});
Modes of Operation
During co-browsing, the agent’s default mode of interaction with the remote view is remote
control. Clicks and drags by the agent are converted into click and drag operations on the
consumer’s application. Change the interaction mode to annotation (see the Annotation section
) by calling AssstAgentSDK.drawSelected, or spotlight (see the Spotlight section) by calling
AssistAgentSDK.spotlightSelected.
In most cases, agent applications provide UI elements which the agent uses to select these
modes. Both drawSelected and spotlightSelected may throw an
AssistAgentSDK.OffAssistPagesException, which the application must handle:
After changing the interaction mode, the agent console can return to remotely controlling the
consumer’s application by calling AssistAgentSDK.controlSelected.
Annotation
In annotation mode, the agent can draw lines on the screen that both parties in the co-browse
can see. Calling the AssistAgentSDK.drawSelected function activates this mode:
try {
AssistAgentSDK.drawSelected();
} catch (e) {
...
}
While in annotation mode, CBA Live Assist interprets drags by the agent as strokes, which
draw a corresponding line on the consumer’s screen. The
AssistAgentSDK.setAgentDrawStyle(strokeRGB, strokeOpacity, strokeWidth) function changes
the appearance of the strokes :
try {
AssistAgentSDK.setAgentDrawStyle('#FFFF00', 0.5, 10);
} catch (e) {
...
}
strokeOpacity must be within the range 0.0 to 1.0; strokeWidth must be between 1 and 25. The
setAgentDrawStyle function may throw an AssistAgentSDK.DrawStyleArgumentException if the
parameters are not valid.
Calling the AssistAgentSDK.clearSelected function clears the shared screen of all annotations.
This does not affect the agent’s current mode of interaction.
Spotlight
In spotlight mode, when an agent clicks on an area of the shared screen, it highlights the
corresponding area of the consumer’s screen. Activate this mode by calling
AssistAgentSDK.spotlightSelected:
try {
AssistAgentSDK.spotlightSelected();
} catch (e) {
...
}
Document Push
When co-browsing is active, the agent can push images or PDF documents to be displayed on
the consumer’s device. There are two functions to do this, and both take the URL of the
document to push:
Acceptable document types are: PDF, and the image formats GIF, PNG, and JPG/JPEG.
Both of these functions take a callback function as a second, optional, parameter with the
signature function(completionEvent), where completionEvent is an object with the following
attributes:
One of:
succeeded
rejected
failed
timeout
closed
url
metadata
This attribute contains the additional information passed in the docMetadata parameter (see
below).
sharedDocId
errorCode
When the type is failed, this attribute contains an error code for failure:
1: Connection Error
2: HTTP Error
httpErrorCode
If the type is failed, and if the failure is due to an HTTP error, the response code is included here.
errorText
initiator
This attribute is populated when the type is closed. Has the values agent or consumer.
A third parameter (also optional) to each of the above functions is the docMetadata, which allows
the agent application to associate additional information with the document, and to send it to the
consumer. The information must be in the form of a string.
AssistAgentSDK.pushDocument('http://server/document.pdf', function(completion)
{
AssistAgentSDK.closeDocument(completion.sharedDocId);
...
}, 'Document description');
Link Push
The agent application can push links to the consumer at any time during a support session by
calling AssistAgentSDK.pushLink, with the link URL as an argument. CBA Live Assist sends the
consumer to the pushed URL.
Note: If the page it sends the consumer to is not itself CBA Live Assist enabled, the consumer’s
co-browsing session becomes unavailable until the consumer returns to a CBA Live Assist
enabled page.
Zoom
Either agent or consumer can open a zoom window on the consumer’s device. While the zoom
window is open, it displays a magnified version of the content of the consumer’s screen where it
is positioned.
The zoom window contains controls to change the magnification and to close the window. Either
party can use these controls, or move the window about the consumer’s screen by dragging it
You can change the appearance of the zoom window in CSS by adding styles for the element
with ID assist-zoom-window; for example:
#assist-zoom-window {
border: 3px solid red;
}
The application can open the zoom window by calling the AssistAgentSDK.startZoom function:
zoom: function() {
AssistAgentSDK.startZoom();
}
You would normally assign the zoom function to the onclick handler of a button.
There is an equivalent AssistAgentSDK.endZoom function, but you do not normally need to call
this explicitly - one of the users normally closes the window with the window’s close button, and if
it is open when the CBA Live Assist session ends, CBA Live Assist closes it automatically.
Note: Screensharing and zooming are mutually exclusive. If the zoom window is open when you
call AssistAgentSDK.pushDocument or AssistAgentSDK.pushContent, the functions do nothing
(apart from logging a message to the console). Similarly, if a document is open when you call
AssistAgentSDK.startZoom, it has no effect. AssistAgentSDK.pushLink will still work, however,
because it sends the consumer to a different page, which automatically removes the zoom
window.
The application can receive notifications when the zoom window opens or closes:
AssistAgentSDK.setZoomStartedCallback(function() {
...
AssistAgentSDK.setZoomEndedCallback(function() {
...
pushDocumentButton.disabled = false;
});
You might want to use these callbacks to update the user interface to prevent user interaction
which will not work.
The agent application receives these callbacks whichever application, consumer or agent, has
opened or closed the zoom window.
Form Filling
When a consumer navigates to a page or screen that CBA Live Assist identifies as containing a
form, it provides the agent with a form editor, to enable the agent to assist the consumer in
completing the form. In order to receive notification that the consumer has navigated to a form,
and to display the form editor, the agent console calls the AssistAgentSDK.setFormCallBack
function. It must provide a function that takes a single argument, the HTML FORM element which
contains the form editor. How and where to display the form editor is entirely within the control of
the agent console. The form editor given to the agent console is only usable while the consumer
is still viewing the page or screen which contains the form. If the consumer navigates away from
the form, the agent receives the form callback again with either a new form, or undefined if there
is no longer a form to edit:
AssistAgentSDK.setFormCallBack(function(formElement) {
if (formElement) {
formContainer.style.display = "block";
formContainer.appendChild(formElement);
} else {
formContainer.style.display = "none";
}
arrangeTools();
});
On some platforms, consumers can take a snapshot to send to the agent during a support
session. To receive notification of this happening, the agent can set a callback function by calling
the AssistAgentSDK.setSnapshotCallBack function:
AssistAgentSDK.setSnapshotCallBack(function(snapshot) {
// create a new view object containing the snapshot
var snapshotWindow = document.createElement("DIV");
var snapshotImg = document.createElement("IMG");
snapshotImg.src = snapshot;
snapshotImg.classList.add("snapshot");
snapshotWindow.appendChild(snapshotImg);
snapshotWindow.style.backgroundRepeat = "norepeat";
snapshotWindow.style.backgroundSize = "contain";
var snapshotDiv = $(snapshotWindow);
consoleContainer.appendChild(snapshotWindow);
});
The agent console is entirely responsible for displaying, storing, or otherwise managing these
images.
When using CBA Live Assist with voice and video, the support session closes automatically
when the call ends, which can be done by calling the CallManager.endCall function at a suitable
place in the code. This causes both the agent and the consumer to leave the support session:
An application will probably also need notification when a consumer hangs up, in order to
change its user interface and internal state to indicate that it is now able to accept another
support call. It can receive this by calling the AgentAssistSDK.setCallEndedCallback function
with a callback which will take action when a call ends:
AssistAgentSDK.setCallEndedCallback(function(){
...
3. Edit the entries so that the values are in the target language.
4. Save the file in the same directory, under the name assistIi18n.<lang>.json, where <lang> is
the 2 letter language code of the target language: es for Spanish, fr for French, and so on.
5. Re-zip the file, maintaining the original file structure, and redeploy it to the server (update
assist_assets.war with the new file – see the FAS Administration Guide).
The advantage of communicating a short code, rather than communicating the correlation ID
directly, is that the short code generated by the CBA Live Assist server is guaranteed to be both
unique during the communication process, and short enough for the client to communicate by
voice (or whatever other out-of-band communication channel is in use) without error.
If the agent application already knows the correlation ID, but needs a session token for use by
the co-browse only session, it must call the REST service which the CBA Live Assist server
exposes for that purpose (error handling omitted):
The above method works when using anonymous agent access with the agent session service
provided by CBA Live Assist. To use the more secure authenticated agent access, see the
Authenticated Agent Access section.
In co-browse only mode, there is no defined start or end of a support session, as the agent and
consumer can join or leave the session at any time independently. It is up to the developers of
the agent console and CBA Live Assist-enabled consumer application to manage the presence
of the agent and consumer in a session. Calling the AssistAgentSDK.endSupport function
removes the agent from the support session:
The application will also need to clean up its user interface in response to the consumer ending
support. Implement the following callback to get notification when a consumer has explicitly
ended support:
AssistAgentSDK.setConsumerEndedSupportCallback(function() {
...
});
Note: Call AssistAgentSDK.endSupport when the agent wishes to leave the support session.
There is no need to call it in response to the consumer leaving the support session, as CBA Live
Assist will take care of that automatically.
1. The consumer application calls a REST service on the server to generate a short code.
2. The consumer application uses the short code in a call to another REST service on the
server, which generates a session token and a correlation ID associated with the short code.
3. The consumer application starts its own support session using that session token and
correlation ID.
4. The consumer communicates the short code to the agent. This is an out-of-band
communication, and may be as simple as the consumer speaking the short code to the
agent on the existing call - this is how the sample application works.
5. The agent application uses the short code in a call to another REST service, which will
return the correlation ID (the session token is already known):
config.correlationId = cid;
config.sessionToken = sessiontoken;
AssistAgentSDK.startSupport(config);
}
}
};
request.open("GET", "/assistserver/shortcode/agent?appkey=" + shortcode,
request.send(session_description);
The session description is a JSON string; see the FCSDK Developer Guide for details of its
contents. For the purposes of CBA Live Assist session creation, it must contain at least a
webAppId, an additionalAttributes object with the necessary entries, and either an aed or a voice
(if the agent needs voice and video functionality) object:
{
"webAppId":"LIVE_ASSIST_AGENT",
"voice":
{
"username":"agent1",
"domain":"example.com",
...
},
"aed":
{
"accessibleSessionIdRegex":".*",
AED2.allowedTopic must be a Java style regular expression; the agent can only connect to
support sessions which have a correlation ID which matches it. Because agents must usually be
able to access any support session, an agent will normally use a wildcard entry (.*).
For an agent, the role, must always be agent; name is a free-form string which acts as a label for
the agent.
You can set other attributes, depending on your requirements - see the FCSDK Developer
Guide. You can also add extra entries for setting agent permissions; see the Setting Agent
Permissions section.
Note: At least one of voice or aed must be present to create the session token. However, if the
session description includes a voice section (which it must if voice and video functionality is
required), then only the AED2 entries are necessary for CBA Live Assist functionality. If voice
and video functionality is not needed, and there is no voice section, then there must be an aed
section as well as the AED2 section entries.
When using authenticated agent access, you can deny an agent permission to use certain
features by leaving them out of the AED2.metadata.features array in the JSON sent to the
session creation servlet. The names of the features, and what they allow if included, are:
document‑share The agent can share documents and links with the consumer
The agent can interact with the consumer’s screen by clicking on control
buttons or dragging objects. With the interact feature switched off, the
interact
agent can only use the move, resize, and zoom handles on shared
windows.
If the agent does not have a particular feature (zoom, for instance), and the agent console code
tries to use it (by calling the AssistAgentSDK.startZoom function), the SDK functions will not
throw exceptions. However, CBA Live Assist will not send the resulting messages to the
consumer, and so the feature will not work. CBA Live Assist will also write a Feature blocked
message to the browser’s console.
Note: You will frequently start the session by calling CallManager.init (see the Starting a Voice
and Video Session section) with a configuration object. You cannot specify an audit name if you
start the session this way.
Using HTTP
You can include an auditName parameter in the URL which you send to the CBA Live Assist
servlets.
To the agent servlet using anonymous agent access (see the Starting a Co-browse only Session
section):
...
request.open("POST", "/assistserver/agent", true);
...
request.send(... + "&auditName=" + auditname + ...);
To the shortcode servlet (see the Escalating an Existing Call to Co-browse section):
...
request.open("PUT", "/assistserver/shortcode/create?CID=12345&auditName=" +
auditName + ..., true);
...
when creating a short code to be associated with the supplied correlation ID. Or:
...
request.open("GET", "/assistserver/shortcode/agent?appkey=1234&auditName=" +
when retrieving the correlation ID associated with a short code supplied in the appkey parameter.
Using JSON
You can include an auditName element in the AED2.metadata object when supplying JSON to
the sessions servlet (see the Authenticated Agent Access section):
"additionalAttributes":
{
"AED2.metadata":
{
"auditName":"agent1",
}
}
In all cases, the auditName is optional. If omitted, the participant_id is a blank string for entries
involving the agent.
Client applications assign permission markers to UI control elements; each UI element has at
most one permission marker. Elements which do not have a permission marker inherit their
parent element’s permission marker; elements which do not have a permission marker and do
not have a parent (or have a parent which does not have or inherit a permission marker) are
assigned the default permission marker.
Agent permissions
Agents have two sets of permissions, viewable permissions and interactive permissions.
Each set may contain an arbitrary number of values. Agents which are not explicitly assigned
any permissions have the default permission, and only the default permission, in both
interactive and viewable sets.
The application sets the agent’s permissions by including them in the session description when
it creates the session token, which it must do explicitly (see the Setting Agent Permissions
section). It then sets the sessionToken property in the configuration object which it uses when
calling AssistAgentSDK.startSupport or CallManager.init.
Note: If the agent specifies permissions in the session description, but leaves both the viewable
set and interactive set empty, the agent will end up with no permissions, not even the default
permission.
The combination of the element’s and the agent’s permissions determines the visibility of a UI
element to an agent. A UI element is visible to a specific agent if, and only if, the agent’s set of
viewable permissions contains the permission marker assigned to or inherited by that element.
Similarly, an agent may interact with a UI element if and only if the agent’s set of interactive
permissions contains the element’s permission marker.
Permissions and permission markers are free-form text, which (apart from the reserved default
permission) are in the control of the application developer. CBA Live Assist will show to the
agent those, and only those, elements which the agent has permission to view; but it is up to the
CBA Live Assist assumption: When an agent wishes to establish a co-browse, the permissions
the agent should have, as defined by the organization’s infrastructure, are known, and can be
translated into an equivalent set of permissions in the Session Description.
You can set agent permissions when using authenticated agent access (see the Authenticated
Agent Access section) by adding the role (which should always be agent) and permissions
objects to the additionalAttributes.AED2.metadata in the JSON object which creates the session:
"additionalAttributes":{
...
"AED2.allowedTopic":".*",
"AED2.metadata":{
"role":"agent",
"permissions" : {
"viewable" : ["banking", "claims", "default"],
"interactive" : ["claims", "default"]
},
...
}
Note: If you do not specify the permissions attribute for the agent, then it will implicitly have the
default permission; if any permission is specified, then the agent will have only that permission -
in that case, if you want the agent to have the default permission, you have to specify it explicitly;
if you specify the permissions object, but leave either the viewable or interactive sets empty, the
agent will have no permissions for that set, not even the default permission.
Agent Agent
Permission
viewable interactive
marker on Result
permission permission
element
set set
Note: In some circumstances an agent can be granted the default permission implicitly, but that
is not the same thing as having an empty set of permissions. In the above table, an empty
set of agent permissions means exactly that; a set of permissions containing only the default
permission may have been granted either implicitly or explicitly.
An element can also inherit permissions through the UI hierarchy: UI elements that are a child of
a parent UI element inherit the permission marker of the parent, unless the child specifies a
permission marker of its own.
A child element can override its parent permission marker, but it will only be effective if the
agent’s viewable permission set contains the parent’s permission marker as well as the child’s
(the agent must be able to see the container in order to interact with an element inside it). This
allows the developer to make a child element interactive and the parent element not. An example
use of this could be a child button within a parent container, where only the button needs to be
interactive.
AssistAgentSDK.setOnErrorCallback(function (error) {
console.log("Agent console Error " + JSON.stringify(error));
});
Item Description
Code Description
1-4 Reserved
An attempt has been made to start a support session when one is already in
5
progress
The default behavior of CBA Live Assist is to print the error to the console.
Application Errors
Note: Do not use error codes which are, or are likely to be, used by CBA Live Assist itself. CBA
Live Assist does not reserve any values for application use, but high values (as above) should
be safe.
wss://<fas address>:<port>/assistserver/topic
If you called CallManager.init with a configuration object which does not include a session
token, it automatically requests a session token and initializes the FCSDK with it. In this
case, the UC object is automatically available as a global object for you to use.
If you requested a session token from the FCSDK session token REST API, you can provide
it when you initialize UC (see the FCSDK Developer Guide). You can use this session
token and a correlation ID in the configuration object which you pass to
AssistAgentSDK.startSupport to escalate the session for CBA Live Assist after establishing
a call (see the Escalating an Existing Call to Co-browse section).
If you started a co-browse only session, there is no call under the control of the FCSDK, so
the FCSDK objects are not available.
setConnectionEstablishedCallback
Receives notification when the connection is established. The callback function takes no
arguments.
setConnectionLostCallback
Receives notification when the connection is lost and connection will not be retried. The callback
function takes no arguments.
setConnectionReestablishedCallback
Receives notification when the connection is re-established after being dropped. The callback
function takes no arguments.
setConnectionRetryCallback
Receives notification that the connection has dropped and connection will be retried. The
callback function receives a retry count and a retry time in milliseconds:
AssistAgentSDK.setConnectionRetryCallback(function(retryCount,
retryTimeInMilliseconds) {
console.log("Connection lost - " + retryCount + " retry after " +
retryTimeInMilliseconds + "ms");
});
Note: These callbacks are informational. To control connectivity, see the WebSocket
Reconnection Control section).
Connection configuration.
A set of callbacks which listen for connection events, allowing an application to perform its
own reconnection handling.
Note: These callbacks can also be used simply to monitor the state of the connection, but we
recommend that you use the simpler callbacks for this - see the Connectivity Callbacks section.
Connection Configuration
You can specify reconnection configuration as part of the configuration object (see the
Configuration section):
var config;
...
config.retryIntervals = [5.0, 10.0, 15.0];
...
AssistAgentSDK.startSupport(config);
Connection Callbacks
If the default reconnection behavior of CBA Live Assist is not what you want, even after
changing the configuration, you can specify a set of callbacks in the connectionStatusCallbacks
var connectionStatusCallbacks = {
onDisconnect: function(error, connector) {},
onConnect: function() {},
onTerminated: function(error) {},
willRetry: function(inSeconds, retryAttemptNumber, maxRetryAttempts,
connector) {}
};
var config;
...
config.connectionStatusCallbacks = connectionStatusCallbacks;
...
AssistAgentSDK.startSupport(config);
These callbacks provide the same information as the connectivity callbacks (see the Connectivity
Callbacks section), but also allow you to control the reconnection behavior. When implementing
your own reconnection logic, the most important notifications you receive are onDisconnect
(called whenever the connection is lost) and willRetry (called when automatic reconnection is
occurring, and there are more reconnection attempts to come). Both these methods include a
connector object in their arguments; you can use the connector object to make a reconnection
attempt, or to terminate all reconnection attempts.
Item Description
Called for the initial WebSocket failure, and for every failed reconnection
attempt (including the last one). This method is called regardless of
whether retryIntervals is specified (that is, whether automatic reconnection
is active or not). The connector object allows the implementing class to
onDisconnect control reconnection, even if reconnection is automatic. For example, an
application might decide to give up reconnection attempts even if more
reconnection attempts would normally occur; or to try the next
reconnection attempt immediately without waiting until the next retry
interval has passed.
The error parameter which is passed to the onDisconnect and onTerminated callbacks, and
which can be supplied to the connector.terminate function, is an object with two elements:
Item Description
In this example, the default reconnection behavior has been disabled (by specifying an empty
array for retryIntervals in the configuration object), and the application reconnection behavior
depends on the reason for disconnection:
var connectionStatusCallbacks = {
onDisconnect: function(error, connector) {
if (error.code > 0)
connector.reconnect();
else
connector.terminate(error);
In this example, the default reconnection behavior has not been disabled, but there is a UI
control which the user can press to short-circuit the reconnection attempts. If the user has not
terminated the connection attempts, automatic reconnection attempts continue:
var connectionStatusCallbacks = {
onDisconnect: function(error, connector) {},
onConnect: function() {},
onTerminated: function(error) {},
willRetry: function(inSeconds, retryAttemptNumber, maxRetryAttempts,
connector) {
if (userHasTerminated)
connector.terminate({code:-1, message: 'User has terminated connection'});
}
};
```</span>