Dial-out
A guide to dialing out from a Daily Bot
Building a bot that dials out to a phone number or a SIP address.
The workflow is as follows:
- Buy a phone numbers, if you already have a number you can reuse it for dial-out.
- Set the
phoneNumber
orsipUri
to be dialed within thedialout_settings
and send the config to/bot/start
- The bot will automatically dial the
phoneNumber
or thesipUri
Structure of dialout_settings
dialout_settings
allows dialing out to several phone numbers or SIP URIs. Hence, it is an arry of objects. Each object contains either phoneNumber
or sipUri
key.
The payload to /bot/start
is as follows:
Dial out to a phone
As an example, for developers familiar with the daily-bots-web-demo, we have added /api/dialout
endpoint. If you are running the sample application locally, you can use cURL
as follows to initiate dialing out:
The daily-bots-web-demo would then call /bot/start
with dialout_settings
set. The Daily bot on receiving the Bot config would start dialing out when the bot joins the Daily Room, the call will be connected when the Phone user picks up the phone.
Use SIP to dial out to Twilio
On Twilio, you will need to configure a SIP domain (e.g., daily-twilio-interconnect.sip.twilio.com
) that invokes a TwiML Bin
or a webhook when an incoming call is received on the configuredd SIP domain.
An example of a TwiML bin is as follows:
The TwiML will parse out the phone number present in the username position in the SIP URI and dial it.
You are now all set up to Dial out!