Logger for the Contact Center plugin
Plugin namespace identifier
Private $configPlugin configuration
Private $webexReference to the Webex SDK instance
Private agentAgent configuration and profile information
Private eventEvent emitter for handling plugin events
Private metricsManager for handling metrics and analytics
Private servicesCore services for Contact Center operations
Private taskManager for handling contact center tasks
Private webService for handling web-based calling functionality
Private webexService for handling Webex API requests
Unregisters the Contact Center SDK by closing all the web socket connections and removing event listeners
Resolves when deregistration is complete
This method does not do a station signout.
If deregistration fails
const cc = webex.cc;
await cc.register();
// Perform operations like login, state change, etc.
await cc.deregister();
Returns the list of buddy agents who are in the given user state and media type based on their agent profile settings
The data required to fetch buddy agents
A promise resolving to the buddy agents information
If fetching buddy agents fails
const cc = webex.cc;
await cc.register();
await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
await cc.getBuddyAgents({state: 'Available', mediaType: 'telephony'});
This is used for getting the list of queues to which a task can be consulted or transferred.
Optional search: stringoptional search string
Optional filter: stringoptional filter string
page number (default is 0)
number of items per page (default is 100)
Promise<ContactServiceQueue[]> Resolves with the list of queues
Error If the operation fails
const cc = webex.cc;
await cc.register();
await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
const queues = await cc.getQueues();
Initializes the Contact Center SDK by setting up the web socket connections
Agent profile information after successful registration
If registration fails
const cc = webex.cc;
await cc.register();
// After registration, you can perform operations like login, state change, etc.
Sets the state of the agent to Available or any of the Idle states
State change parameters including the new state
Response with updated state information
If state change fails
const cc = webex.cc;
await cc.register();
await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
await cc.setAgentState({
state: 'Available',
auxCodeId: '12345',
lastStateChangeReason: 'Manual state change',
agentId: 'agent123',
});
This is used for making the outdial call.
The destination number to dial
Promise
Error If the outdial operation fails
const destination = '+1234567890';
const cc = webex.cc;
await cc.register();
const task = await cc.startOutdial(destination);
// Can do task operations like accept, reject, etc.
Refer to ITask interface for more details.
Performs agent login with specified credentials and device type
Login parameters including teamId, loginOption and dialNumber
Response containing login status and profile
If login fails
const cc = webex.cc;
await cc.register();
await cc.stationLogin({
teamId: 'team123',
loginOption: 'EXTENSION',
dialNumber: '1002'
});
// After successful login, you can perform operations like state change, task handling, etc.
Performs a station logout operation for the agent
Logout parameters
Response indicating logout status
A logout operation cannot happen if the agent is in an interaction or haven't logged in yet.
If logout fails
Updates the agent device type. This method allows the agent to change their device type (e.g., from BROWSER to EXTENSION or anything else). It will also throw an error if the new device type is the same as the current one.
type is AgentDeviceUpdate - The data required to update the agent device type, including the new login option and dial number.
Promise
Error If the update fails
const data = {
loginOption: 'EXTENSION',
dialNumber: '1234567890',
teamId: 'team-id-if-needed', // Optional, if not provided, current team ID will be used
};
const result = await webex.cc.updateAgentProfile(data);
const cc = webex.cc;
await cc.register();
await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
await cc.updateAgentDeviceType(data);
Uploads logs to help troubleshoot SDK issues.
This method collects the current SDK logs including network requests, WebSocket messages, and client-side events, then securely submits them to Webex's diagnostics service. The returned tracking ID, feedbackID can be provided to Webex support for faster issue resolution.
Promise
Error If the upload fails
const cc = webex.cc;
try {
await cc.register();
}
catch (error) {
console.error('Error during registration:', error);
cc.uploadLogs();
}
Private connectPrivate getPrivate getPrivate handlePrivate handlePrivate Handles device type specific configuration and setup Configures services and settings based on the login device type
The type of device being used for login
The dial number associated with the device
Private handlePrivate Handles incoming task events and triggers appropriate notifications
The incoming task object containing task details
Private handlePrivate Handles task hydration events for updating task data
The task object to be hydrated with additional data
Private handlePrivate incomingPrivate setupPrivate silent
ContactCenter
Implements
IContactCenter
Description
Contact Center Plugin main class which provides functionality for agent management in Webex Contact Center. This includes capabilities for:
Example