Five9
Before following this guide, consider reading the SIP trunking guide to understand how ElevenLabs supports SIP trunks and custom SIP headers.
Overview
This guide explains how to integrate ElevenAgents with the Five9 Virtual Contact Center (VCC) using Five9 AI Agent Connect. Five9 transfers a live call to an ElevenLabs phone number, the ElevenLabs agent handles the conversation, and ElevenLabs returns routing or disposition data to Five9 so the Five9 flow can continue.
How the Five9 integration works
Five9 AI Agent Connect uses an external transfer over SIP, with call context exchanged through custom SIP X- headers in both directions:
- Inbound transfer: The Five9 IVR External Transfer Module transfers the call to an ElevenLabs phone number, sending call context as SIP
X-headers on the INVITE. - Conversation: ElevenLabs answers the call and routes it to the correct agent, optionally through a router agent, then handles the conversation with the caller.
- Return path: When the conversation ends, ElevenLabs attaches routing and disposition data to the SIP BYE as
X-headers. - Post-AI routing: Five9 maps the returned headers into call variables and continues the call flow, such as transferring to a live agent, ending the call, or recording a disposition.
Requirements
Before setting up the Five9 integration, ensure you have:
- An active Five9 VCC domain with AI Agent Connect enabled.
- Administrator access to the Five9 configuration, or a Five9 implementation team to make the changes.
- An ElevenLabs account and an agent to handle the transferred calls.
- A SIP trunk phone number imported in ElevenLabs to use as the Five9 transfer destination.
AI Agent Connect is a paid add-on to Five9 VCC and is not enabled by default. Contact your Five9 Account Manager to enable it for your domain before starting this integration.
Both teams should agree on the transfer phone number, the header names sent in each direction, the routing values, and the test plan before configuration begins.
ElevenLabs setup
Import the transfer phone number
Follow the SIP trunking guide to import the phone number Five9 will transfer calls to. Custom SIP headers and BYE headers require a SIP trunk phone number.
Import the number in E.164 format with a +1 country code (for example, +18005550100). Five9 sends the transfer in this format, and a mismatch will cause the transfer to fail.
Assign an agent
If a single agent handles all calls from Five9, assign it directly to the phone number in the Phone Numbers dashboard.
If multiple agents share one transfer number, assign a router agent instead and follow Routing multiple agents through one number.
Configure the returned headers
Map the dynamic variables your agent sets during the conversation to the SIP BYE header names Five9 expects. See Configuring BYE headers.
Routing multiple agents through one number
To route calls to several ElevenLabs agents through a single Five9 transfer number, assign a router agent to the phone number and have Five9 send the target agent in a header such as X-AgentID.
Inbound X- headers are exposed as dynamic variables, so X-AgentID is available to the router agent as {{sip_agentid}}. Configure the router agent with the agent transfer tool and add a transfer rule for each X-AgentID value you expect, mapping it to the agent that should take the call.
This avoids provisioning a separate phone number for every agent.
Headers sent from Five9 to ElevenLabs
Five9 can send call metadata as SIP X- headers on the INVITE. Header names are normalized by removing the X- prefix, converting to lowercase, replacing hyphens with underscores, and adding the sip_ prefix.
Use these variables in agent prompts, first messages, and tools to personalize the conversation.
The reserved headers X-Call-ID and X-Caller-ID map to the system__call_sid and
system__caller_id system dynamic
variables.
Five9 sends the unhyphenated X-CallID and X-CallANI, which normalize to sip_callid and
sip_callani instead. Confirm which variables are populated during test calls before referencing
them in prompts.
Headers returned from ElevenLabs to Five9
ElevenLabs returns routing and reporting data on the SIP BYE. The following header names are the recommended convention for Five9 AI Agent Connect:
You can return any additional X- header your Five9 flow needs. Each header value comes from a dynamic variable on the agent, so the agent must set these variables during the conversation.
Configuring BYE headers
BYE headers return the final values of the agent’s dynamic variables to Five9. Map each dynamic variable name to a header name using attributes_to_headers on the phone number’s inbound_trunk_config. Both variables your agent sets and system dynamic variables such as system__conversation_id can be mapped:
The header value is the dynamic variable’s value at the end of the conversation, including values set during the call through agent tools or webhook overrides. A call that ends with the agent setting route_type to SkillTransfer and route_value to billing_support produces the following BYE headers:
Five9 then routes the caller to the billing_support skill.
Recommended routing values
Keep X-RouteType values simple and predictable so the Five9 flow can branch on them directly.
Five9 setup
Your Five9 implementation team will typically:
- Enable AI Agent Connect for your Five9 domain.
- Configure the Five9 IVR transfer flow.
- Add the ElevenLabs phone number as the transfer destination.
- Configure the External Transfer Module.
- Configure the outbound
X-headers sent to ElevenLabs. - Configure the inbound
X-headers returned by ElevenLabs. - Map the returned headers into Five9 call variables.
- Configure the post-AI routing logic that branches on those variables.
- Test calls end to end.
Troubleshooting
Transferred calls fail to connect
- Confirm the ElevenLabs phone number is imported as a SIP trunk number and has an agent assigned.
- Verify the transfer destination configured in the Five9 External Transfer Module matches the imported number.
- Check that your firewall allows SIP signaling traffic on the configured transport and port, and that RTP ports are not blocked.
Inbound headers are not available as dynamic variables
- Confirm Five9 sends the headers with an
X-prefix on the INVITE. - Check the normalized variable name.
X-AgentIDbecomes{{sip_agentid}}, not{{X-AgentID}}or{{agent_id}}. - Inspect the conversation history under the Phone Call tab to see which headers arrived.
- Custom headers cannot override the
system__call_sidandsystem__caller_idsystem variables.
BYE headers are missing or empty
- Verify
attributes_to_headersis set oninbound_trunk_configfor the phone number receiving the call. - Confirm the keys are dynamic variable names and the values are header names, not the reverse.
- Ensure the agent actually sets those dynamic variables during the conversation. An unset variable produces no header value.
Router agent transfers to the wrong agent
- Confirm Five9 sends
X-AgentIDon every transferred call. - Check that each
X-AgentIDvalue has a matching transfer rule on the router agent. - Verify the router agent’s transfer rules reference
{{sip_agentid}}.