Restaurant calls are a good test case for voice ai because the workflow is familiar: answer the phone, ask a few questions, confirm the booking, and send a text message.
The Telnyx code example for this is:
It is a Python Flask app that combines Voice AI, AI Inference, and SMS/MMS in one small demo.
The Flow
The caller dials a Telnyx number. Telnyx sends the call event to a webhook. The app answers, speaks a greeting, gathers speech, sends the caller's words to Telnyx AI Inference, speaks the response back, and repeats until the reservation is complete.
When the booking is confirmed, the app sends an SMS confirmation.
That is the interesting part: this is not just a chatbot. It is a phone workflow with voice input, ai reasoning, spoken output, and a messaging follow-up.
Why I Like This Example
It is simple enough to demo quickly, but it still maps to real developer questions:
- how do i answer an inbound phone call with code?
- how do i collect speech from a caller?
- how do i use ai to decide what to say next?
- how do i send an sms after a call?
- how do i inspect what happened after the demo?
The /reservations endpoint is useful because it gives the audience something visible after the call. The SMS confirmation gives the demo a clear finish.
Run It Locally
git clone https://github.com/team-telnyx/telnyx-code-examples.git
cd telnyx-code-examples/ai-restaurant-reservation-voice-agent-python
cp .env.example .env
pip install -r requirements.txt
python app.py
Then expose the webhook:
ngrok http 5000
In the Telnyx Portal, point your Voice API application webhook to:
https://<ngrok-id>.ngrok-free.app/webhooks/voice
Assign a Telnyx number to that Voice API application and call the number.
What To Demo
I would keep the demo short:
- Show the Voice API app webhook.
- Call the number.
- Book a table.
- Show the SMS confirmation.
- Open
/reservations.
That gives viewers the full loop without getting lost in implementation details.
Where To Take It Next
The demo uses in-memory state, which is perfect for learning. The next production steps are database storage, availability checks, webhook verification, and a real reservation system integration.
The important thing is that the skeleton is already there: voice in, ai decision, voice out, and SMS follow-up.
Resources
- Code example: https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-restaurant-reservation-voice-agent-python
- Telnyx Voice docs: https://developers.telnyx.com/docs/voice
- Telnyx AI Inference docs: https://developers.telnyx.com/docs/inference
- Telnyx Messaging docs: https://developers.telnyx.com/docs/messaging
Top comments (0)