Internal platform · unified communications managed service · 2026

Custom voice gateway for Copilot Studio agents

A Python gateway on Azure Communication Services that puts any Copilot Studio agent on a phone number — with a choice of neural voices, per-number voice routing and live transfer to a Teams user.

  • Azure
  • Microsoft 365 & Teams
  • Telephony & contact centre
  • Power Platform & Dynamics
gateway overhead per turn
<100ms
filler dead air cut
4.0s → 1.5s
voice providers routed by dialled number
2
Architecture

How it fits together

  1. 01

    Call in

    • Direct Routing
    • Teams Phone Extensibility
  2. 02

    Answer

    • Azure Communication Services
    • Event Grid
  3. 03

    Gateway

    • Azure Functions (Python)
    • Azure AI Speech (STT)
  4. 04

    Agent

    • Copilot Studio Direct Line
  5. 05

    Speak / escalate

    • Azure AI Speech
    • ElevenLabs
    • Microsoft Graph → Teams user
Outcome

Gateway overhead under 100 ms per turn, and a demo stack that can front any customer's agent by swapping a single secret.

The problem

Copilot Studio’s native real-time voice channel limits voice choice. Customers wanted natural local-accent voices, and the ability to put their existing agents on the phone without rebuilding them.

What I did

  • Built a Function App that answers inbound Teams Phone Extensibility calls through ACS, runs speech recognition, relays text to the agent over Direct Line, and speaks responses with Azure Speech or ElevenLabs.
  • Added routing by dialled number — two numbers on one ACS resource, each with a different voice provider — by carrying the choice across events on the call’s correlation ID.
  • Implemented escalation to a named Teams user: the agent emits a handoff, the gateway resolves the person through Graph and adds them to the live call.
  • Diagnosed latency with Application Insights: the gateway itself was under 100 ms; the real variance was the agent’s knowledge routing. Rewriting 14 near-identical knowledge-source descriptions and cutting filler dead air from 4.0 s to 1.5 s made calls feel noticeably tighter.
  • Tested voice availability per region with real synthesis calls instead of trusting published tables.

Result

The gateway runs in production on the supported Teams Phone Extensibility path, with a separate demo stack that can’t affect production.