Demo mode: changes are disabled.

Skip to content

Twilio Voice

Last updated

Set up the phone agent of Deskply: the voice bridge the API runs, its public address, and how customers connect their own Twilio number.

How it works

You do not need a Twilio account of your own. Each customer connects their Twilio account in the customer panel, with its Account SID, Auth Token and a phone number they already own. Twilio bills them for the calls.

When someone calls that number, Twilio streams the audio (Media Streams) to the voice bridge, a process of the API. The bridge passes it to the OpenAI Realtime API, which talks to the caller and books appointments.

Your customers find their Account SID and Auth Token in the Twilio Console. How to get a number, and everything else about the phone side, is in Twilio's documentation: Phone numbers and Twilio Voice documentation.

Run the voice bridge

The setup does this when you answer yes to the phone agent: it starts the bridge, gives it the domain you name and writes VOICE_BRIDGE_PUBLIC_WSS_URL. To add the phone agent later, point a domain to the server and run the setup again:

Terminal
sudo bash server/setup.sh

Twilio connects to that domain over a secure websocket, so it must be reachable from the internet. Check the bridge with systemctl status saas-voice.

Voice previews

When a customer picks the voice of their agent, the panel plays a short sample of each voice. The samples are not in the download: they are AI-generated audio, made on your own server with your OpenAI account. Run this once, after the OpenAI key is set (in .env or under Settings → AI & Voice). It costs a few cents.

Terminal
sudo bash server/artisan.sh voice:generate-samples

The clips are saved in storage/app/public/voice-samples/ and served through the public/storage link, which the installer creates. --force makes them again and --text="…" changes the sentence they read. Until they exist, the voices are listed without a preview.

Connect a number

In the customer panel, open Platforms, choose Connect on Twilio Voice and enter the Account SID, the Auth Token and the phone number. The API sets the call webhooks on that number, so nothing has to be entered in the Twilio console.

The API checks that every call and status callback really comes from Twilio. TWILIO_SIGNATURE_VALIDATE=false switches the check off for local tunnels only; in production it always runs.

Check a call

Call the number. The agent should answer with the greeting of the customer's business. Afterwards the call appears in Call Logs with its length, and with a transcript when Deepgram is set up. If nothing answers, see Troubleshooting.