Overview
Pipecat provides several utility modules for configuring transports and handling transport-specific operations. While the development runner handles most of these automatically, these utilities are useful for custom setups, advanced configurations, or when building your own deployment infrastructure.Daily Configuration
The Daily utilities handle room creation, token generation, and authentication setup for Daily integration. They support both standard video/audio rooms and SIP-enabled rooms for telephony integration.Basic Configuration
Useconfigure() for simple room and token setup:
configure() function returns a DailyRoomConfig object with:
room_url: The Daily room URL for joiningtoken: Authentication token for the botsip_endpoint: SIP endpoint URI (None for standard rooms)
- Uses
DAILY_SAMPLE_ROOM_URLenvironment variable if set, otherwise creates a new room - Creates rooms with 2-hour expiration and automatic ejection by default
- Generates an authentication token with 2-hour expiration using
DAILY_API_KEY
Environment Variables
Required:DAILY_API_KEY: Daily API key for creating rooms and tokens
DAILY_SAMPLE_ROOM_URL: Use an existing room instead of creating oneDAILY_API_URL: Override Daily API endpoint (defaults to https://api.daily.co/v1)
Room and Token Management
When noDAILY_SAMPLE_ROOM_URL is provided, rooms are created automatically with:
- 2-hour expiration from creation time
- Automatic participant ejection when the room expires
- Unique names using UUID prefixes (e.g.
pipecat-uuid)
Expired rooms are automatically cleaned up by Daily, so you don’t need to
manage them manually.
SIP Configuration
Daily utilities support SIP-enabled rooms for telephony integration. When SIP parameters are provided, the function creates rooms with telephony capabilities:sip_caller_phone: Phone number or identifier for SIP display name (enables SIP mode)sip_enable_video: Whether video is enabled for SIP calls (default: False)sip_num_endpoints: Number of allowed SIP endpoints (default: 1)sip_codecs: Audio/video codecs to support (optional, uses Daily defaults if not specified)
SIP-enabled rooms cannot use existing room URLs from
DAILY_SAMPLE_ROOM_URL.
They always create new temporary rooms with SIP configuration.Backward Compatibility
Theconfigure() function supports tuple unpacking:
LiveKit Configuration
LiveKit utilities manage authentication tokens, room setup, and agent permissions for LiveKit server integration.Basic Configuration
Useconfigure() for standard setup:
Configuration with Arguments
For command-line integration:-r, --room: Specify LiveKit room name-u, --url: Specify LiveKit server URL
Token Generation
LiveKit provides two token generation functions:generate_token(room_name, participant_name, api_key, api_secret)
Creates a standard participant token for users or testing.
generate_token_with_agent(room_name, participant_name, api_key, api_secret)
Creates an agent token with special permissions. Use this for your bots.
Environment Variables
Required:LIVEKIT_API_KEY: LiveKit API keyLIVEKIT_API_SECRET: LiveKit API secretLIVEKIT_URL: LiveKit server URLLIVEKIT_ROOM_NAME: Default room name
WebSocket and Transport Utilities
The transport utilities provide helper functions for WebSocket parsing, SDP manipulation, and transport management.Telephony WebSocket Parsing
Useparse_telephony_websocket() to auto-detect telephony providers and extract call data:
- Reads and parses initial WebSocket messages
- Detects provider based on message structure
- Extracts provider-specific call information
- Returns structured data for transport configuration
Transport Helper Functions
Client ID Detection:When to Use These Utilities
Automatic Usage (Most Common)
The development runner andcreate_transport utility handle these automatically. Most users won’t need to call these functions directly.