Most voice AI examples are conversational. A user talks to an assistant, the assistant responds, and the demo ends there.
I wanted something more tactile: call a phone number, say a command, and see a system change.
So this example turns a Telnyx phone number into a voice-controlled facility command line. You call in and say things like:
unlock the loading dock gate
turn on the warehouse lights
check the freezer alarm
The app listens, maps the spoken request to a simulated IoT device, updates state, logs the command, and speaks back the result.
The Basic Flow
The app is a small Python Flask service.
When someone calls the Telnyx number:
- Telnyx sends a Call Control webhook to Flask.
- The app answers the call.
- Telnyx AI gather captures the caller's spoken command.
- The app parses the command into a device and action.
- The app updates simulated device state.
- Telnyx speaks a short confirmation.
- The command appears in an audit log.
The important part is that the result is visible. You can keep /devices open during the demo and refresh it after each command.
Why Use a Local Parser in the Live Call
The app includes a Telnyx AI Inference path for parsing commands through the local HTTP API. That is useful for showing how the pattern can handle broader natural language.
For the live phone call, responsiveness matters more. After Telnyx AI gather captures the command, the app uses a deterministic parser for known demo phrases. That avoids a second AI call and makes the phone experience feel faster.
This is a useful production lesson: not every part of a voice AI system needs to be generative. Use AI where it adds flexibility, and use deterministic logic where latency and reliability matter.
What This Could Become
The current app uses simulated devices:
- loading dock gate
- warehouse lights
- freezer alarm
- backup generator
- irrigation pump
In production, the same pattern could connect to real systems:
- building access control
- field equipment
- fleet devices
- industrial alerts
- facilities operations
For risky actions, you would add caller authentication, allowlists, and confirmation steps. You would also store command logs in a database and keep webhook signature verification enabled.
Demo Script
Open /devices.
Call the number.
Say:
unlock the loading dock gate
Refresh /devices and show the gate is unlocked.
Then say:
turn on the warehouse lights
Refresh again and show the lights are on.
Open /commands to show the audit log.
That is the full story: voice input, command parsing, state change, spoken confirmation, and an audit trail.
Links
- Telnyx Call Control: https://developers.telnyx.com/docs/voice/call-control
- Telnyx AI Inference: https://developers.telnyx.com/docs/inference
- Telnyx IoT: https://telnyx.com/products/iot-sim-card
Top comments (0)