Items marked (preview) in this article are currently in public preview. This preview is provided without a service-level agreement, and we don’t recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
Prerequisites
- Existing phone numbers purchased from Twilio.
- Twilio Account SID and Auth Token.
- A saved voice-first agent in a Foundry project that passes browser testing. See Quickstart: Create a voice-first prompt agent.
Configure transfer to a person
An agent that can’t complete a request should reach a human rather than end the call. Configure named transfer targets for the agent. These targets are separate from its telephony bindings. First, read the current target list and itsETag response header:
PUT, using the returned ETag in If-Match. Include every target you want to keep: this operation replaces the entire list, and an empty array clears it.
twilio destination can be a Twilio user, or the resource account of a call queue or auto attendant. That’s how a voice agent hands a caller back into an existing Twilio call flow.
Give each target a description that says when to use it. The agent chooses based on that text.
Transfer requests select a target from the agent’s configured list rather than supplying an arbitrary destination.
Manage a live call
List the agent’s calls, and use the service-generated callid as {callId} in subsequent requests:
operator target:
GET {projectEndpoint}/agents/{agentName}/telephony/calls/{callId}?api-version=v1.
Configure audio for phone calls
Phone networks carry narrowband audio, so tune the agent for the channel:- Set
noise_reductiontoazure_deep_noise_suppressionfor contact center traffic. - Increase
silence_duration_ms. Callers on a phone pause more than callers at a keyboard. - Add
phrase_listhints for the identifiers callers read aloud, such as order or policy numbers. - Attach the
end_conversationsystem tool so the agent can end a completed call.
Test the call
- From a controlled caller, call the configured number.
- Confirm the agent answers.
- Complete a short conversation.
- Interrupt the agent.
- Use one safe tool or knowledge path.
- Test the approved human-handoff behavior.
- End the call.
- Confirm that monitoring and trace data appear.
- Test timestamp and time zone.
- Called number.
- Callee identifier.
- Azure Communication Services resource ID.
- Agent name and version.
- Event Grid delivery result.
- Azure Communication Services call correlation ID.
Trace phone calls
When a call arrives through telephony, the session’s root trace span records the provider, the provider’s call ID, and the dialed and calling numbers. You can correlate a Foundry session with a record in your telephony provider. Caller and callee phone numbers are personal data. Review who can read your project’s Application Insights resource before you enable content capture. See Voice agent tracing, monitoring, and evaluation.Troubleshoot telephony
Disconnect a number
Disconnecting removes the Foundry binding. It doesn’t:- Release the Twilio number.
- Remove the Twilio resource account.
- Delete Azure Communication Services.
- Remove the bot or app registration.
- Revoke Twilio Phone Extensibility consent.
Security checklist
- Use Microsoft Entra authentication and managed identities.
- Don’t share Azure Communication Services keys, connection strings, tokens, bot secrets, or portal cookies.
- Validate that the Event Grid topic is the intended Azure Communication Services resource.
- Use the exact public Foundry project webhook endpoint.
- Keep webhook audience and Event Grid delivery identity concepts separate.
- Use a dedicated single-tenant webhook application when governance requires it.
- Don’t persist service-generated call callback or media tokens.
- Confirm the binding target before update or deletion.
- Apply recording, consent, disclosure, retention, and privacy requirements.
- Prevent sensitive caller data from being read aloud or unnecessarily stored.