Daily Dial-in
Using Daily’s Transport to receive calls from external SIP Addresses and PSTN numbers
When a user calls one of your purchased phone numbers, the call is received by Daily’s infrastructure and placed on hold. This triggers a webhook that initializes the Pipecat Bot.
There are two ways to handle this initialization:
- Host the webhook yourself in your application infrastructure.
- Let Daily handle the webhook (coming soon).
For most use cases, letting Daily manage the webhook should be sufficient. However, if you need to customize the bot’s behavior—for example, based on the caller’s number or the number dialed—you’ll need to host the webhook yourself to apply that logic.
We provide example servers built with Next.js
and FastAPI
to help you get started with your own implementation.
FastAPI Webhook Server
Python-based webhook server implementation using FastAPI for handling dial-in calls
Next.js Webhook Server
JavaScript-based webhook server implementation using Next.js for handling dial-in calls
Handling Dial-In Webhook (room_creation_api
)
To support inbound calls, you currently need to host a server that handles incoming call webhooks. In the near future, Daily will support managing incoming calls directly and provide an endpoint—similar to {service}/start
—to handle this automatically.
When someone calls your purchased number, Daily sends a webhook request containing information about the call. Your server can use this data to take the call off hold and connect it to a Pipecat Bot.
Here’s a sample of the webhook payload:
Your webhook handler should then forward this data to the /start endpoint to initialize the session. Here are the required fields to set:
- Set
createDailyRoom
to true - Configure
dailyRoomProperties
with the followingsip
settings:sip_mode
: “dial-in”num_endpoints
: 1 (set to 2 for call transfers)display_name
: typically set to theFrom
number
- In the body, map the webhook payload to
dialin_settings
and convert camelCase to snake_case (e.g.,callId
→call_id
).
Receiving a Call on the Bot
The {service}/start
endpoint creates a Pipecat bot instance and forwards the incoming request to it. Within the bot, pass the dialin_settings
from the request body to the DailyTransport
, see example below. The incoming PSTN or SIP call will then be automatically routed to the bot.
Since this is an inbound call, the bot should begin speaking as soon as the remote user joins the call.
Next Steps
After setting up your webhook server, you can implement a Pipecat bot that handles the call interactions:
Dial-in/Dial-out Bot Example
Complete example of a Pipecat bot implementation that handles both incoming (dial-in) and outgoing (dial-out) calls
This starter template provides all the necessary components to build a production-ready telephony bot.