Function createTwilioConnectorWarmTransferTask

  • Build a warm-transfer AgentTask that dials the human agent through the LiveKit Twilio connector instead of a SIP trunk: connectTwilioCall opens an outbound connector session, the Twilio REST API places the call with TwiML that streams it into that session, and the dial resolves once the connector publishes the answered human agent's audio.

    Cancellation starts bounded, best-effort cleanup without waiting for Twilio. Cleanup requires a returned call SID and a running worker. If Twilio accepts the call but its creation response is lost, the task cannot cancel that call.

    This is the functional core; TwilioConnectorWarmTransferTask is a thin class wrapper over it.

    Returns AgentTask<WarmTransferResult>