VoiceTel

Documentation / VoiceML / Pipecat

Run a Pipecat voice agent on a VoiceTel number.

When someone calls your number, VoiceML requests instructions from the demo server. The server returns <Connect><Stream> to open a two-way audio connection: Deepgram transcribes the caller, Gemini writes a reply, and Cartesia speaks it back.

View the Pipecat demo on GitHub

1. Configure the demo

You’ll need Python 3.11 or later, uv, API keys for Deepgram, Google AI Studio, and Cartesia, and a voice-capable VoiceTel test number. From your terminal, run:

git clone https://github.com/voicetel/pipecat-voicetel-demo
cd pipecat-voicetel-demo
uv sync
cp .env.example .env

In .env, put your VoiceTel Account SID in TWILIO_ACCOUNT_SID and your VoiceML Auth Token in TWILIO_AUTH_TOKEN. Pipecat expects those variable names. Leave TWILIO_BASE_URL set to https://voiceml.voicetel.com so call control goes to VoiceTel. You don’t need a Twilio account.

Fill in DEEPGRAM_API_KEY, GOOGLE_API_KEY, and CARTESIA_API_KEY. Run uv run scripts/check_voicetel.py to check the VoiceTel credentials before starting the agent.

2. Listen to a reply locally

Start the server with uv run server.py. In a second terminal in the same directory, run uv run scripts/fake_caller.py. The script connects to the local WebSocket and saves the agent’s audio to recordings/caller_reply.wav. Play the file to check the reply before routing a phone call.

3. Route an inbound test call

  1. Give the server a public HTTPS address that supports WebSockets. For a temporary test tunnel, install cloudflared and run cloudflared tunnel --url http://localhost:7860. The demo also serves an outbound calling route, /dialout; block public access to that route for an inbound-only test.
  2. Set PUBLIC_URL in .env to the tunnel’s HTTPS origin. Leave STREAM_URL unset to use the local agent. Set VERIFY_WEBHOOKS=1 to verify incoming voice webhook signatures, then restart server.py.
  3. In the VoiceTel portal, set the test number’s inbound voice webhook to the public origin plus the webhook path shown in the demo’s number configuration example. Select POST. The /ws path is for audio; the server supplies it in its webhook response.
  4. Dial the number. Listen for the greeting, ask a question, then interrupt the reply. The server log should show the incoming webhook followed by Stream started.

If the webhook returns 403, check that PUBLIC_URL matches the public origin configured on the number and restart the server. If the stream starts but you hear silence, check the server log for provider key errors and repeat the local audio test.

Trusted by