Five9

Transfer calls from Five9 VCC to ElevenAgents using Five9 AI Agent Connect.

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:

  1. 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.
  2. Conversation: ElevenLabs answers the call and routes it to the correct agent, optionally through a router agent, then handles the conversation with the caller.
  3. Return path: When the conversation ends, ElevenLabs attaches routing and disposition data to the SIP BYE as X- headers.
  4. 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:

  1. An active Five9 VCC domain with AI Agent Connect enabled.
  2. Administrator access to the Five9 configuration, or a Five9 implementation team to make the changes.
  3. An ElevenLabs account and an agent to handle the transferred calls.
  4. 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

1

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.

2

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.

3

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.

4

Run test calls

Place test calls with Five9 and confirm the inbound headers arrive as dynamic variables and the BYE headers are returned as expected. Inbound header values are visible in the conversation history under the Phone Call tab.

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.

HeaderDynamic variableDescription
X-CallANI{{sip_callani}}The caller’s phone number.
X-CallDNIS{{sip_calldnis}}The dialed phone number.
X-CallID{{sip_callid}}Unique Five9 call identifier.
X-CallSessionID{{sip_callsessionid}}Identifier for the current session.
X-CallCampaign{{sip_callcampaign}}Name of the Five9 campaign.
X-AgentID{{sip_agentid}}Target ElevenLabs agent, used for routing via a router agent.

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:

HeaderDescription
X-RouteTypeThe action Five9 should take, for example SkillTransfer.
X-RouteValueThe target for the action, for example a Five9 skill name.
X-RouteReasonContext for the routing decision, such as the customer’s intent.
X-ConversationIdThe ElevenLabs conversation identifier, for log correlation.

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:

1import os
2from dotenv import load_dotenv
3from elevenlabs import ElevenLabs, InboundSipTrunkConfigRequestModel
4
5load_dotenv()
6
7elevenlabs = ElevenLabs(api_key=os.getenv("ELEVENLABS_API_KEY"))
8
9elevenlabs.conversational_ai.phone_numbers.update(
10 phone_number_id="phnum_8901k4t9z5defmb8vh3e9361y7nj",
11 inbound_trunk_config=InboundSipTrunkConfigRequestModel(
12 attributes_to_headers={
13 "route_type": "X-RouteType",
14 "route_value": "X-RouteValue",
15 "route_reason": "X-RouteReason",
16 "system__conversation_id": "X-ConversationId",
17 }
18 ),
19)

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:

X-RouteType: SkillTransfer
X-RouteValue: billing_support
X-RouteReason: Customer needs help with an invoice
X-ConversationId: conv_7401k6a2b8cxyzmn9pq3r5s7t1uv

Five9 then routes the caller to the billing_support skill.

Keep X-RouteType values simple and predictable so the Five9 flow can branch on them directly.

X-RouteTypeExample X-RouteValueDescription
SkillTransferbilling_supportTransfer the call to a specific Five9 skill queue.
PhoneTransfer+18005550199Transfer the call to an external phone number.
HangupEmptyTerminate the call after the AI interaction.
DispositionOnlyResolvedEnd the call and record a specific disposition.

Five9 setup

Your Five9 implementation team will typically:

  1. Enable AI Agent Connect for your Five9 domain.
  2. Configure the Five9 IVR transfer flow.
  3. Add the ElevenLabs phone number as the transfer destination.
  4. Configure the External Transfer Module.
  5. Configure the outbound X- headers sent to ElevenLabs.
  6. Configure the inbound X- headers returned by ElevenLabs.
  7. Map the returned headers into Five9 call variables.
  8. Configure the post-AI routing logic that branches on those variables.
  9. Test calls end to end.

Troubleshooting

  • 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.
  • Confirm Five9 sends the headers with an X- prefix on the INVITE.
  • Check the normalized variable name. X-AgentID becomes {{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_sid and system__caller_id system variables.
  • Verify attributes_to_headers is set on inbound_trunk_config for 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.
  • Confirm Five9 sends X-AgentID on every transferred call.
  • Check that each X-AgentID value has a matching transfer rule on the router agent.
  • Verify the router agent’s transfer rules reference {{sip_agentid}}.