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

interface ITask {
    aiSummaryCapabilities: Readonly<Required<Pick<AISummaryFeatureEnablement, "midCallEnabled" | "postCallEnabled">>>;
    autoWrapup?: default;
    data: TaskData;
    state?: any;
    uiControls: TaskUIControls;
    webCallMap: Record<string, string>;
    accept(): Promise<TaskResponse>;
    cancelAutoWrapupTimer(): void;
    consult(consultPayload): Promise<TaskResponse>;
    consultConference(): Promise<TaskResponse>;
    decline(): Promise<TaskResponse>;
    dropConferenceParticipant(payload): Promise<TaskResponse>;
    emit(event, ...args): boolean;
    end(): Promise<TaskResponse>;
    endConsult(consultEndPayload): Promise<TaskResponse>;
    exitConference(): Promise<TaskResponse>;
    getWxAppMuted?(): boolean;
    hold(mediaResourceId?): Promise<TaskResponse>;
    off(event, listener): this;
    on(event, listener): this;
    once(event, listener): this;
    pauseRecording(): Promise<TaskResponse>;
    requestMidCallSummary(action): Promise<AISummary>;
    requestPostCallSummary(): Promise<AISummary>;
    resume(mediaResourceId?): Promise<TaskResponse>;
    resumeRecording(resumeRecordingPayload): Promise<TaskResponse>;
    sendMidCallSummaryResponse(response, action): Promise<void>;
    sendPostCallSummaryResponse(response): Promise<void>;
    switchCall(): Promise<TaskResponse>;
    syncWxAppMuteFromCallDetails?(): Promise<boolean>;
    toggleMute(options?): Promise<void>;
    transfer(transferPayload, options?): Promise<TaskResponse>;
    transferConference(): Promise<TaskResponse>;
    transmitDtmf(options): Promise<void>;
    wrapup(wrapupPayload): Promise<TaskResponse>;
}

Hierarchy (view full)

Implemented by

Properties

aiSummaryCapabilities: Readonly<Required<Pick<AISummaryFeatureEnablement, "midCallEnabled" | "postCallEnabled">>>

Current AI-summary capabilities for this task. Both flags are false until the matching feature-enablement event is received.

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

state?: any
uiControls: TaskUIControls

Latest UI controls derived from the state machine. Each control has isVisible and isEnabled flags computed from current task state. Subscribe to TASK_EVENTS.TASK_UI_CONTROLS_UPDATED for change notifications.

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" });
    
  • Removes a supported participant from the active conference. Resolves after the correlated ParticipantLeftConference routing event.

    Parameters

    Returns Promise<TaskResponse>

    Promise

    Example

    await task.dropConferenceParticipant({participantId: 'participant-id'});
    
  • Current wxApp mute state for engaged telephony (Voice tasks only).

    Returns boolean

  • Places the current task on hold.

    Parameters

    • Optional mediaResourceId: string

      Optional media resource ID to use for the hold operation. If not provided, uses the task's current mediaResourceId

    Returns Promise<TaskResponse>

    Promise

    Example

    // Hold with default mediaResourceId
    await task.hold();

    // Hold with custom mediaResourceId
    await task.hold('custom-media-resource-id');
  • Parameters

    • event: string
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: string
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Requests an AI-generated mid-call summary for a consult or transfer flow.

    Parameters

    • action: AISummaryAction

      The consult or transfer flow requesting the summary.

    Returns Promise<AISummary>

    Promise resolving with the matching mid-call summary payload.

  • Requests an AI-generated post-call summary for this task.

    Returns Promise<AISummary>

    Promise resolving with the matching post-call summary payload.

  • Resumes a task that was previously on hold.

    Parameters

    • Optional mediaResourceId: string

      Optional media resource ID to use for the resume operation. If not provided, uses the task's current mediaResourceId from interaction media

    Returns Promise<TaskResponse>

    Promise

    Example

    // Resume with default mediaResourceId
    await task.resume();

    // Resume with custom mediaResourceId
    await task.resume('custom-media-resource-id');
  • Sends the consumer's mid-call summary response for a consult or transfer flow.

    Parameters

    • response: AISummaryResponse

      Validated mid-call response observations and summary state.

    • action: AISummaryAction

      The consult or transfer flow responding to the summary.

    Returns Promise<void>

    Promise resolving when AI Assistant acknowledges the response.

  • Sends the consumer's post-call summary response.

    Parameters

    • response: AISummaryResponse

      Validated post-call response observations and summary state.

    Returns Promise<void>

    Promise resolving when AI Assistant acknowledges the response.

  • Toggles between consult call and main call during consulting. If on consult leg, switches to main call (holds consult). If on main call, switches to consult (resumes consult). Only available when in CONSULTING state.

    Returns Promise<TaskResponse>

    Promise

    Example

    await task.switchCall();
    
  • Re-seed wxApp mute from GET telephony/calls/{callId}. Resolves to muted state when known.

    Returns Promise<boolean>

  • Toggles mute/unmute for the active call. WebRTC tasks toggle the local stream; wxApp engaged tasks route to telephony mute REST when enableWxBetterTogether is active.

    Parameters

    • Optional options: TaskToggleMuteOptions

      Optional target mute state (muted) for wxApp; ignored for WebRTC toggle.

    Returns Promise<void>

    Promise

    Example

    await task.toggleMute();
    await task.toggleMute({ muted: true });
  • Transfers the task to another agent or queue.

    Parameters

    • transferPayload: TransferPayLoad

      Transfer details including destination and type

    • Optional options: TransferOptions

    Returns Promise<TaskResponse>

    Promise

    Example

    await task.transfer({ to: "queueId", destinationType: "queue" });
    
  • Sends in-call DTMF tones for wxApp engaged telephony tasks when enableWxBetterTogether is active.

    Parameters

    • options: TaskTransmitDtmfOptions

      DTMF digit(s) and optional shared-line owner id.

    Returns Promise<void>

    Promise

    Example

    await task.transmitDtmf({ dtmf: '5' });
    
  • 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"
    });