Things you’ll need
- An active Daily developer account with API key
- At least one phone number purchased through Daily (covered below)
- A server to handle webhooks (we’ll show local development with ngrok)
Dial-in Example
Complete dial-in implementation with webhook handling
Dial-out Example
Outbound calling with Daily PSTN integration
Cold Transfer Example
Cold transfer implementation for advanced call routing
Phone Number Management
Before setting up dial-in or dial-out, you’ll need to purchase phone numbers through Daily.Daily Phone Numbers Guide
Complete guide to searching, purchasing, and managing phone numbers with
Daily’s REST API
Dial-in
Dial-in allows users to call your phone number and connect directly to your Pipecat bot.How It Works
Here’s the sequence of events when someone calls your Daily phone number:- Daily receives an incoming call to your phone number
- Daily calls your webhook server (
/start
endpoint) - The server creates a Daily room with dial-in capabilities
- The server starts the bot process with the room details
- The caller is put on hold with music
- The bot joins the Daily room and signals readiness
- Daily forwards the call to the Daily room
- The caller and the bot are connected, and the bot handles the conversation
Create a pinless dial-in configuration
A pinless dial-in configuration connects your purchased phone number to a webhook URL. When someone calls your number, Daily will send a webhook to your server with call details.Create pinless dial-in config
Set up your webhook server
Your server acts as the orchestrator for incoming calls. When Daily receives a call, it sends a webhook to your server with call details (callId
and callDomain
). Your server then:
- Creates a Daily room with SIP dial-in capabilities
- Spawns a bot process with the room details and call information
- Returns success to Daily, which keeps the caller on hold until the bot is ready
Complete Server Implementation
See the full FastAPI server code with room creation, process management, and
error handling
Use
--subdomain
to get a reusable URL for your ngrok tunnel.Configure your Pipecat bot for dial-in
The bot receives arguments from the server process and uses them to create the Daily transport. The key components are: Bot Entry Point: Thebot()
method receives RunnerArguments
containing:
room_url
: Daily room URL for the calltoken
: Daily room token for authenticationcall_id
andcall_domain
: Call identifiers from Daily’s webhook
DailyTransport
:
bot.py
Complete Bot Implementation
See the full bot.py with argument handling, transport setup, and pipeline
configuration
Run the Example
Once you have your webhook server configured and your bot ready, you can test the complete dial-in flow:- Start your server: Run your FastAPI webhook server
- Expose with ngrok: Make your local server publicly accessible
- Configure Daily: Set up the pinless dial-in configuration with your webhook URL
- Call your number: Dial your Daily phone number to connect with your bot
Complete Setup Instructions
See the full README with step-by-step setup, environment variables, and
troubleshooting tips
Dial-out
Dial-out allows your bot to initiate calls to phone numbers. Unlike dial-in, your bot starts the call rather than waiting for incoming calls.You must contact Daily to enable dial-out for your account. Submit a support
request
here.
How It Works
Here’s the sequence of events for dial-out calls:- Your application triggers a dial-out (via API call or user action)
- Server creates a Daily room with dial-out capabilities enabled
- Bot joins the Daily room and sets up the pipeline
- Bot initiates the dial-out call to the target phone number
- Daily connects the call to the phone number
- The recipient answers and is connected to your bot
- The bot handles the conversation with the called party
Set up your server for dial-out
The dial-out server is simpler than dial-in since you’re initiating calls rather than receiving webhooks. Your server needs to:- Create Daily rooms with dial-out enabled
- Start bot processes with the target phone number
- Handle API requests to trigger outbound calls
Complete Server Implementation
See the full FastAPI server code with room creation and dial-out triggering
Configure your Pipecat bot for dial-out
The dial-out bot receives the target phone number and creates a transport without dial-in settings: Bot Entry Point: Thebot()
method receives RunnerArguments
containing:
room_url
: Daily room URL for the calltoken
: Daily room token for authenticationphone_number
: Target phone number to call
DailyTransport
:
bot.py
Complete Bot Implementation
See the full bot.py with dial-out configuration and pipeline setup
Run the Example
To test dial-out functionality:- Start your server: Run your FastAPI server
- Trigger a call: Make an API request to start a dial-out call
- Answer your phone: The bot will call the specified number
- Talk to your bot: Have a conversation with your AI agent
Complete Setup Instructions
See the full README with step-by-step setup, API usage, and configuration
details
Call Transfers
Daily supports cold transfers, allowing you to transfer an active call to another phone number. The bot can initiate a transfer and then leave the call, connecting the caller directly to the transfer destination.How Call Transfers Work
- Bot receives transfer request (via function call or user input)
- Bot informs the caller about the transfer
- Bot initiates SIP call transfer to the destination number
- Daily connects the transfer to the destination
- Bot leaves the call (cold transfer)
- Caller and destination continue the conversation
Implementing Call Transfers
Call transfers are typically implemented as LLM function calls that your bot can invoke:bot.py
Handling Transfer Events
Your bot should handle transfer-related events to manage the call flow:bot.py
Complete Transfer Implementation
See the full call transfer example with LLM function calls, event handling,
and error management
Deployment
Pipecat Cloud
For production deployment without managing your own infrastructure, use Pipecat Cloud:Daily Dial-in on Pipecat Cloud
Deploy dial-in bots with webhook handling and automatic scaling
Daily Dial-out on Pipecat Cloud
Deploy dial-out bots with caller ID management and voicemail detection
Self-Hosted Deployment
For self-hosted production deployment, ensure your servers are:- Publicly accessible with HTTPS
- Able to handle concurrent requests
- Properly configured with your Daily API credentials
Next Steps
- Explore the complete examples for full implementations
- Learn about Daily’s SIP integration for more advanced telephony scenarios
- Check out Daily’s REST API documentation for additional configuration options