Using Daily’s Transport to make calls to external SIP Addresses and PSTN numbers
enable_dialout
in dailyRoomProperties
. Then, include the target phone number(s) in the request body
of {service}/start
.
In this example, we use the dialout_settings
array to pass one or more phone numbers for the bot to dial. Each object in the array must include a phoneNumber
and can optionally specify a callerId
to control the outbound caller ID.
callerId
is provided, a random phone number will be used to make the
call. To specify the caller ID, use the phone number’s
id
as the
callerId
.joined
state.
Unlike dial-in scenarios where the bot typically speaks first, dial-out calls may require the bot to wait for the remote user to speak. In these cases, you can start listening for the remote user when the on_dialout_answered
event fires.
This is also a good point to initiate voicemail detection—for example, by analyzing the remote user’s audio to determine if the call has reached a voicemail.
dialout_settings
dialout_settings
array: