Overview
DailyTransport provides real-time audio and video communication using Daily’s hosted WebRTC platform. It handles bidirectional media streams, participant management, transcription, recording, and telephony features without requiring your own WebRTC infrastructure. Daily manages all the complexity of WebRTC connections, NAT traversal, and global media routing.
DailyTransport API Reference
Transport methods and configuration options
Example Implementation
Complete Daily transport voice agent example
Daily API Documentation
Official Daily REST API and platform documentation
Daily Dashboard
Sign up for Daily API access and room management
Installation
To useDailyTransport, install the required dependencies:
Prerequisites
Daily Account Setup
Before using DailyTransport, you need:- Daily Account: Sign up at Daily Dashboard
- API Key: Generate a Daily API key from your dashboard
- Room Creation: Daily rooms must be created before connecting (see Usage section)
Required Environment Variables
DAILY_API_KEY: Your Daily API key for room creation and management
Key Features
- Hosted WebRTC: No infrastructure setup required - Daily handles all WebRTC complexity
- Multi-participant Support: Handle multiple participants with individual audio/video tracks
- Built-in Transcription: Real-time speech-to-text with Deepgram integration
- Telephony Integration: [Dial-in/dial-out support for phone numbers via SIP/PSTN
- Recording & Streaming: Built-in call recording and live streaming capabilities
- Global Infrastructure: Daily’s edge network ensures low latency worldwide
- Advanced Controls: Participant management, permissions, and media routing
Configuration
DailyTransport
URL of the Daily room to connect to.
Authentication token for the room. Required for private rooms or when specific permissions are needed.
Display name for the bot in the call.
Transport configuration parameters. See DailyParams below and TransportParams for inherited base parameters.
Optional name for the input transport processor.
Optional name for the output transport processor.
DailyParams
Inherits all parameters from TransportParams (audio, video, VAD settings) with these additional fields:Daily API base URL.
Daily API authentication key.
Receive users’ audio in separate tracks rather than a mixed stream.
Settings for dial-in functionality. See DailyDialinSettings below.
Whether to enable the main camera output track.
Whether to enable the main microphone track.
Whether to enable Daily’s built-in speech transcription (powered by Deepgram).
Configuration for the transcription service. See DailyTranscriptionSettings below.
DailyDialinSettings
Settings for Daily’s dial-in (SIP) functionality.Call ID (UUID) representing the session ID in the SIP network.
Call domain (UUID) representing your Daily domain on the SIP network.
DailyTranscriptionSettings
Configuration for Daily’s built-in transcription service (Deepgram).ISO language code for transcription.
Deepgram transcription model to use.
Whether to filter profanity from transcripts.
Whether to redact sensitive information.
Whether to use endpointing to determine speech segments.
Whether to add punctuation to transcripts.
Whether to include raw response data from Deepgram.
Additional parameters passed to the Deepgram transcription service.
Usage
DailyTransport connects your Pipecat bot to Daily rooms where it can communicate with participants through audio, video, and data channels. Rooms must be created using the Daily API before your bot can join. The transport integrates with Pipecat’s pipeline to process participant audio through your STT, LLM, and TTS services, then send responses back to participants. See the complete example for a full implementation including:- Daily room creation and token management
- Transport configuration with transcription and VAD
- Pipeline integration with participant event handling
- Advanced features like recording and dial-out
Event Handlers
DailyTransport provides event handlers for room lifecycle, participant management, messaging, telephony, and recording. Register handlers using the@event_handler decorator on the transport instance.
Events Summary
| Event | Description |
|---|---|
on_joined | Bot joined the room |
on_left | Bot left the room |
on_before_leave | About to leave the room (sync) |
on_error | Transport error occurred |
on_call_state_updated | Call state changed |
on_first_participant_joined | First participant joined the room |
on_participant_joined | A participant joined |
on_participant_left | A participant left |
on_participant_updated | A participant’s state updated |
on_client_connected | A participant connected |
on_client_disconnected | A participant disconnected |
on_active_speaker_changed | Active speaker changed |
on_app_message | App message received |
on_transcription_message | Transcription message received |
on_recording_started | Recording started |
on_recording_stopped | Recording stopped |
on_recording_error | Recording error occurred |
on_dialin_connected | Dial-in call connected |
on_dialin_ready | Dial-in SIP endpoint ready |
on_dialin_stopped | Dial-in call stopped |
on_dialin_error | Dial-in error |
on_dialin_warning | Dial-in warning |
on_dialout_answered | Dial-out call answered |
on_dialout_connected | Dial-out call connected |
on_dialout_stopped | Dial-out call stopped |
on_dialout_error | Dial-out error |
on_dialout_warning | Dial-out warning |
Room Lifecycle
on_joined
Fired when the bot successfully joins the Daily room.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
data | dict | Join event data from Daily |
on_left
Fired when the bot leaves the Daily room.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
on_before_leave
Fired synchronously just before the bot leaves the room. Use this for cleanup that must happen before disconnection, such as stopping transcription.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
This is a synchronous event — the bot will not leave the room until all handlers complete. Keep handlers fast.
on_error
Fired when a transport-level error occurs.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
error | str | Error message |
on_call_state_updated
Fired when the call state changes (e.g., joining, joined, leaving, left).| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
state | str | The new call state |
Participants
on_first_participant_joined
Fired when the first participant (other than the bot) joins the room. This is commonly used to start the conversation.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
participant | dict | Participant data from Daily |
on_participant_joined
Fired when any participant joins the room.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
participant | dict | Participant data from Daily |
When a participant joins, both
on_participant_joined and on_client_connected fire. Use on_first_participant_joined if you only need to react to the first participant.on_participant_left
Fired when a participant leaves the room.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
participant | dict | Participant data from Daily |
reason | str | Reason the participant left |
on_participant_updated
Fired when a participant’s state changes (e.g., audio/video tracks enabled/disabled).| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
participant | dict | Updated participant data from Daily |
on_client_connected / on_client_disconnected
Transport-agnostic aliases that fire alongsideon_participant_joined and on_participant_left respectively, for compatibility with other transports. Same parameters as their counterparts.
on_active_speaker_changed
Fired when the active speaker in the room changes.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
participant | dict | Active speaker participant data |
Messaging
on_app_message
Fired when an app message is received from a participant.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
message | Any | The message content |
sender | str | The sender’s participant ID |
on_transcription_message
Fired when a transcription message is received from Daily’s built-in transcription service.| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
message | dict | Transcription message with text, participantId, timestamp, and rawResponse fields |
Recording
on_recording_started / on_recording_stopped / on_recording_error
Events for monitoring Daily’s built-in recording feature.| Event | Parameters |
|---|---|
on_recording_started | transport, status (str) |
on_recording_stopped | transport, stream_id (str) |
on_recording_error | transport, stream_id (str), message (str) |
Telephony: Dial-in
Events for monitoring incoming phone calls. See the telephony guides for setup details.on_dialin_ready
Fired when the dial-in SIP endpoint is ready to receive calls. Ifdialin_settings are configured, Pipecat automatically calls the Daily pinlessCallUpdate API.
| Parameter | Type | Description |
|---|---|---|
transport | DailyTransport | The transport instance |
sip_endpoint | str | The SIP endpoint URI |
on_dialin_connected / on_dialin_stopped / on_dialin_error / on_dialin_warning
Lifecycle events for dial-in calls. All receive(transport, data) where data is a dict with event details.
Telephony: Dial-out
Events for monitoring outgoing phone calls. All receive(transport, data) where data is a dict with event details.
| Event | Description |
|---|---|
on_dialout_answered | Dial-out call was answered |
on_dialout_connected | Dial-out call connected |
on_dialout_stopped | Dial-out call stopped |
on_dialout_error | Dial-out error occurred |
on_dialout_warning | Dial-out warning |
Additional Resources
- Events Overview - Overview of all events in Pipecat
- Daily REST Helper Utility
- Pipecat Development Runner’s Transport Utilities
- Client SDK Integration