- Host the webhook yourself in your application infrastructure.
- Let Daily handle the webhook (coming soon).
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:
- 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.
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