Creates a new Task instance
The routing contact service instance
The web calling service instance
Initial task data
Event data received in the Contact Center events. Contains detailed task information including interaction details, media resources, and participant data as defined in TaskData
Map associating tasks with their corresponding call identifiers.
Private contactPrivate localPrivate metricsPrivate webAgent accepts the incoming task.
Promise
Error
task.accept().then(()=>{}).catch(()=>{})
Consults another agent or queue on an onngoing task for further assistance.
ConsultPayload containing destination and destinationType
Promise
Error
const consultPayload = {
destination: 'myBuddyAgentId',
destinationType: DESTINATION_TYPE.AGENT,
}
task.consult(consultPayload).then(()=>{}).catch(()=>{});
Transfer the task to the consulted agent or queue.
Consult transfer configuration containing destination and destinationType
Promise
Error
const consultTransferPayload = {
destination: 'anotherAgentId | queueId',
destinationType: 'agent | queue',
}
task.consultTransfer(consultTransferPayload).then(()=>{}).catch(()=>{});
Declines the incoming webrtc task.
Promise
Error
task.decline().then(()=>{}).catch(()=>{})
Ends the task/interaction with the customer.
Promise
Error
task.end().then(()=>{}).catch(()=>{})
Ends the consult session in progress for a task.
Promise
Error
const consultEndPayload = {
isConsult: true,
queueId: 'myQueueId',
}
task.endConsult(consultEndPayload).then(()=>{}).catch(()=>{});
Puts the current task/interaction on hold.
Promise
Error
task.hold().then(()=>{}).catch(()=>{})
Pauses the recording for the current voice task.
Promise
Error
task.pauseRecording().then(()=>{}).catch(()=>{});
Resumes the task/interaction that was previously put on hold.
Promise
Error
task.resume().then(()=>{}).catch(()=>{})
Resumes the recording for the voice task that was previously paused.
Configuration for resuming recording, defaults to {autoResumed: false}
Promise
Error
task.resumeRecording(resumeRecordingPayload).then(()=>{}).catch(()=>{});
Transfer the task to an agent dierctly or to the queue.
Transfer configuration containing destination and destination type
Promise
Error
const transferPayload = {
to: 'myQueueId',
destinationType: 'queue',
}
task.transfer(transferPayload).then(()=>{}).catch(()=>{});
Wraps up the task/interaction with the customer.
WrapupPayLoad containing auxCodeId and wrapUpReason
Promise
Error - Throws if task data is unavailable, auxCodeId is missing, or wrapUpReason is missing
task.wrapup(wrapupPayload).then(()=>{}).catch(()=>{})
Private reconcile
Task class represents a contact center task/interaction that can be managed by an agent. This class provides all the necessary methods to manage tasks in a contact center enivornment, handling various call control operations and task lifecycle management.
Implements
Example