@twilio/flex-sdk
    Preparing search index...

    Class AddExternalVoiceParticipant

    Adds a participant to a voice task.

    The unique identifier (SID) of the voice task to add the participant to.

    The phone number of the participant to be added.

    An optional parameter for specifying additional options for the participant.

    A promise that resolves to an AddVoiceParticipantResponse object, indicating the result of the participant addition operation.

    import { createClient } from "@twilio/flex-sdk";
    import { AddExternalVoiceParticipant } from "@twilio/flex-sdk/actions/Voice";

    async function addExternalVoiceParticipant() {
    const client = await createClient("SDK_TOKEN");
    const addParticipant = new AddExternalVoiceParticipant(
    "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "+1234567890"
    );
    const { pendingParticipantResponse, waitForParticipantToSettle } = await client.execute(addParticipant);
    return { pendingParticipantResponse, waitForParticipantToSettle };
    }
    import {
    createClient,
    AddExternalVoiceParticipant,
    TaskParticipant,
    } from "@twilio/flex-sdk";
    import { Worker } from "@twilio/flex-sdk/taskrouter";

    async function addExternalVoiceParticipantWithCustomWorker() {
    const TOKEN = "SDK_TOKEN";

    const worker = new Worker(TOKEN);
    const client = await createClient(TOKEN, { worker });

    const addParticipant = new AddExternalVoiceParticipant(
    "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "+1234567890"
    );
    const { pendingParticipantResponse, waitForParticipantToSettle } =
    await client.execute(addParticipant);

    console.log(pendingParticipantResponse);
    waitForParticipantToSettle
    .then((participant: TaskParticipant) =>
    console.log("waitForParticipantToSettle", participant)
    )
    .catch((err) => console.log("waitForParticipantToSettle", err));

    return { pendingParticipantResponse, waitForParticipantToSettle };
    }

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods