Build an AI Call Router That Sends Callers to the Right Team Telnyx has released an open-source AI-powered call router that uses natural language processing to route callers to the correct team, replacing traditional IVR menus. The Python Flask application integrates Telnyx Call Control and AI Inference to transcribe caller speech and classify intent using an LLM, then transfers the call accordingly. The project includes webhook verification for security and is available on GitHub. Traditional IVRs make callers do the routing work. You call a business, listen to a menu, remember the options, press a number, and hope you picked the right path. That works, but it is not how people naturally ask for help. Most callers already know what they want: The ai-powered-call-router example turns that sentence into the routing decision. Code: https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-powered-call-router https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-powered-call-router This is a Python Flask app that handles inbound calls with Telnyx Call Control and classifies caller intent with Telnyx AI Inference. The flow looks like this: php Inbound call - Telnyx sends a Call Control webhook - Flask verifies the webhook - app answers the call - app speaks a greeting - app gathers caller speech - AI classifies intent - app announces the transfer - Call Control transfers the caller Instead of asking the caller to press buttons, the app asks what they need and routes based on their answer. The example uses: The source keeps the route table intentionally small: ROUTE TABLE = { "billing": "+1XXXXXXXXXX", "sales": "+1XXXXXXXXXX", "support": "+1XXXXXXXXXX", } In a real app, those destinations might be queues, agents, contact center flows, or PBX extensions. Once the inbound call is answered, the app plays a greeting. After the greeting finishes, it starts speech capture using Call Control's AI gather action. The important detail is that the app waits for the call.speak.ended event before starting the gather. That avoids the greeting and the caller's first response overlapping. The gather step produces a call.ai gather.ended event with the caller's utterance. That text becomes the input to the intent classifier. The app sends the caller's transcribed request to Telnyx AI Inference and asks the model to classify it into one of the supported routes. The default model in the sample is: meta-llama/Llama-3.3-70B-Instruct The model does not need to write a long answer. It only needs to return a routing label such as: billing sales support That keeps the AI part narrow and practical. The LLM is not running the whole call center. It is doing one job: mapping natural language to a route. After intent classification, the app speaks a short announcement: Transferring you to billing. Please hold. Then it waits for that announcement to finish before calling the transfer action. That makes the caller experience cleaner. They hear what is happening before the bridge is created. The example uses a blind transfer: Telnyx dials the destination and connects the original caller once the destination answers. Voice automation should not trust random HTTP requests. The app verifies inbound Telnyx webhooks with Ed25519 signature verification before processing the event: event = unwrap with ed25519 request.get data , request.headers, key=TELNYX PUBLIC KEY, That means call actions like answer, gather, and transfer only run after the app verifies the webhook came from Telnyx. Clone the examples repo: git clone https://github.com/team-telnyx/telnyx-code-examples.git cd telnyx-code-examples/ai-powered-call-router Create a virtual environment and install dependencies: python3 -m venv venv source venv/bin/activate pip install -r requirements.txt Create your .env file: cp .env.example .env Set the required values: TELNYX API KEY=