// This file was auto-generated by Fern from our API Definition.

import type * as Vapi from "../index.js";

export interface TransferPlan {
    /**
     * This configures how transfer is executed and the experience of the destination party receiving the call.
     *
     * Usage:
     * - `blind-transfer`: The assistant forwards the call to the destination without any message or summary.
     * - `blind-transfer-add-summary-to-sip-header`: The assistant forwards the call to the destination and adds a SIP header X-Transfer-Summary to the call to include the summary.
     * - `warm-transfer-say-message`: The assistant dials the destination, delivers the `message` to the destination party, connects the customer, and leaves the call.
     * - `warm-transfer-say-summary`: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call.
     * - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`: The assistant dials the destination, waits for the operator to speak, delivers the `message` to the destination party, and then connects the customer.
     * - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary`: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer.
     * - `warm-transfer-twiml`: The assistant dials the destination, executes the twiml instructions on the destination call leg, connects the customer, and leaves the call.
     * - `warm-transfer-experimental`: The assistant puts the customer on hold, dials the destination, and if the destination answers (and is human), delivers a message or summary before connecting the customer. If the destination is unreachable or not human (e.g., with voicemail detection), the assistant delivers the `fallbackMessage` to the customer and optionally ends the call.
     *
     * @default 'blind-transfer'
     */
    mode: Vapi.TransferPlanMode;
    /**
     * This is the message the assistant will deliver to the destination party before connecting the customer.
     *
     * Usage:
     * - Used only when `mode` is `blind-transfer-add-summary-to-sip-header`, `warm-transfer-say-message`, `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`, or `warm-transfer-experimental`.
     */
    message?: Vapi.TransferPlanMessage | undefined;
    /**
     * This is the timeout in seconds for the warm-transfer-wait-for-operator-to-speak-first-and-then-say-message/summary
     *
     * @default 60
     */
    timeout?: number | undefined;
    /**
     * This specifies the SIP verb to use while transferring the call.
     * - 'refer': Uses SIP REFER to transfer the call (default)
     * - 'bye': Ends current call with SIP BYE
     * - 'dial': Uses SIP DIAL to transfer the call
     */
    sipVerb?: Record<string, unknown> | undefined;
    /**
     * This sets the timeout for the dial operation in seconds. This is the duration the call will ring before timing out.
     *
     * Only applicable when `sipVerb='dial'`. Not applicable for SIP REFER or BYE.
     *
     * @default 60
     */
    dialTimeout?: number | undefined;
    /**
     * This is the URL to an audio file played while the customer is on hold during transfer.
     *
     * Usage:
     * - Used only when `mode` is `warm-transfer-experimental`.
     * - Used when transferring calls to play hold audio for the customer.
     * - Must be a publicly accessible URL to an audio file.
     * - Supported formats: MP3 and WAV.
     * - If not provided, the default hold audio will be used.
     */
    holdAudioUrl?: string | undefined;
    /**
     * This is the URL to an audio file played after the warm transfer message or summary is delivered to the destination party.
     * It can be used to play a custom sound like 'beep' to notify that the transfer is complete.
     *
     * Usage:
     * - Used only when `mode` is `warm-transfer-experimental`.
     * - Used when transferring calls to play hold audio for the destination party.
     * - Must be a publicly accessible URL to an audio file.
     * - Supported formats: MP3 and WAV.
     */
    transferCompleteAudioUrl?: string | undefined;
    /**
     * This is the plan for manipulating the message context before initiating the warm transfer.
     * Usage:
     * - Used only when `mode` is `warm-transfer-experimental`.
     * - These messages will automatically be added to the transferAssistant's system message.
     * - If 'none', we will not add any transcript to the transferAssistant's system message.
     * - If you want to provide your own messages, use transferAssistant.model.messages instead.
     *
     * @default { type: 'all' }
     */
    contextEngineeringPlan?: Vapi.TransferPlanContextEngineeringPlan | undefined;
    /**
     * This is the TwiML instructions to execute on the destination call leg before connecting the customer.
     *
     * Usage:
     * - Used only when `mode` is `warm-transfer-twiml`.
     * - Supports only `Play`, `Say`, `Gather`, `Hangup` and `Pause` verbs.
     * - Maximum length is 4096 characters.
     *
     * Example:
     * ```
     * <Say voice="alice" language="en-US">Hello, transferring a customer to you.</Say>
     * <Pause length="2"/>
     * <Say>They called about billing questions.</Say>
     * ```
     */
    twiml?: string | undefined;
    /**
     * This is the plan for generating a summary of the call to present to the destination party.
     *
     * Usage:
     * - Used only when `mode` is `blind-transfer-add-summary-to-sip-header` or `warm-transfer-say-summary` or `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary` or `warm-transfer-experimental`.
     */
    summaryPlan?: Vapi.SummaryPlan | undefined;
    /**
     * This flag includes the sipHeaders from above in the refer to sip uri as url encoded query params.
     *
     * @default false
     */
    sipHeadersInReferToEnabled?: boolean | undefined;
    /**
     * This configures the fallback plan when the transfer fails (destination unreachable, busy, or not human).
     *
     * Usage:
     * - Used only when `mode` is `warm-transfer-experimental`.
     * - If not provided when using `warm-transfer-experimental`, a default message will be used.
     */
    fallbackPlan?: Vapi.TransferFallbackPlan | undefined;
}
