Optional
autoAuto-wrapup timer for the task This is used to automatically wrap up tasks after a specified duration as defined in AutoWrapup
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.
Answers or accepts an incoming task. Once accepted, the task will be assigned to the agent and trigger a TASK_EVENTS.TASK_ASSIGNED event. The response will contain updated agent contact information as defined in AgentContact.
Promise
task.accept();
Declines an incoming task for Browser Login
Promise
task.decline();
Ends/terminates the current task
Promise
task.end();
Fetches the IVR transcript for the current voice task This method retrieves the Interactive Voice Response transcript that was recorded during the customer's interaction with the IVR system before being connected to an agent. Only available for voice tasks that have IVR interactions.
Organization ID (required)
Interaction ID for the task (required)
Timeout in minutes for the transcript URL (required)
Promise
Error if the task is not a voice task, no IVR transcript is available, or the fetch operation fails
// Fetch IVR transcript after accepting a voice task
try {
const transcript = await task.fetchIvrTranscript(
task.data.orgId,
task.data.interactionId,
10 // timeout in minutes
);
console.log('Conversation turns:', transcript.length);
transcript.forEach((turn) => {
if (turn.customer) {
console.log(`${turn.customer.timestamp}: Customer — ${turn.customer.query}`);
}
if (turn.bot) {
console.log(`${turn.bot.timestamp}: Bot (${turn.bot.botName}) — ${turn.bot.reply}`);
}
});
} catch (error) {
console.error('Failed to fetch IVR transcript:', error);
// Handle case where no transcript is available
}
Places the current task on hold
Promise
task.hold();
Pauses the recording for current task
Promise
task.pauseRecording();
Resumes a task that was previously on hold
Promise
task.resume();
Resumes a previously paused recording
Parameters for resuming the recording
Promise
task.resumeRecording({
autoResumed: false
});
Initiates wrap-up process for the task with specified details
Wrap-up details including reason and auxiliary code
Promise
task.wrapup({
wrapUpReason: "Customer issue resolved",
auxCodeId: "RESOLVED"
});
Interface for managing task-related operations in the contact center Extends EventEmitter to support event-driven task updates