Interface for managing task-related operations in the contact center Extends EventEmitter to support event-driven task updates

interface ITask {
    autoWrapup?: default;
    data: TaskData;
    webCallMap: Record<string, string>;
    accept(): Promise<TaskResponse>;
    cancelAutoWrapupTimer(): void;
    consult(consultPayload): Promise<TaskResponse>;
    consultConference(): Promise<TaskResponse>;
    consultTransfer(consultTransferPayload?): Promise<TaskResponse>;
    decline(): Promise<TaskResponse>;
    end(): Promise<TaskResponse>;
    endConsult(consultEndPayload): Promise<TaskResponse>;
    exitConference(): Promise<TaskResponse>;
    hold(): Promise<TaskResponse>;
    pauseRecording(): Promise<TaskResponse>;
    resume(): Promise<TaskResponse>;
    resumeRecording(resumeRecordingPayload): Promise<TaskResponse>;
    toggleMute(): Promise<void>;
    transfer(transferPayload): Promise<TaskResponse>;
    transferConference(): Promise<TaskResponse>;
    wrapup(wrapupPayload): Promise<TaskResponse>;
}

Hierarchy

  • EventEmitter
    • ITask

Implemented by

Properties

autoWrapup?: default

Auto-wrapup timer for the task This is used to automatically wrap up tasks after a specified duration as defined in AutoWrapup

data: TaskData

Event data received in the Contact Center events. Contains detailed task information including interaction details, media resources, and participant data as defined in TaskData

webCallMap: Record<string, string>

Map associating tasks with their corresponding call identifiers.

Methods

  • Cancels the auto-wrapup timer for the task. This method stops the auto-wrapup process if it is currently active. Note: This is supported only in single session mode. Not supported in multi-session mode.

    Returns void

    void

  • Initiates a consultation with another agent or queue.

    Parameters

    • consultPayload: ConsultPayload

      Consultation details including destination and type

    Returns Promise<TaskResponse>

    Promise

    Example

    await task.consult({ to: "agentId", destinationType: "agent" });
    
  • Transfers the task after consultation.

    Parameters

    Returns Promise<TaskResponse>

    Promise

    Example

    await task.consultTransfer({ to: "agentId", destinationType: "agent" });
    
  • Toggles mute/unmute for the local audio stream during a WebRTC task.

    Returns Promise<void>

    Promise

    Example

    await task.toggleMute();
    
  • Transfers the task to another agent or queue.

    Parameters

    • transferPayload: TransferPayLoad

      Transfer details including destination and type

    Returns Promise<TaskResponse>

    Promise

    Example

    await task.transfer({ to: "queueId", destinationType: "queue" });
    
  • Initiates wrap-up process for the task with specified details.

    Parameters

    • wrapupPayload: WrapupPayLoad

      Wrap-up details including reason and auxiliary code

    Returns Promise<TaskResponse>

    Promise

    Example

    await task.wrapup({
    wrapUpReason: "Customer issue resolved",
    auxCodeId: "RESOLVED"
    });