Skip to navigation

ElevenLabs SIP Technical Reference

Interoperability requirements and behavior of the ElevenLabs SIP service, covering network addressing, transports, signaling, and media.

Overview

This page specifies the requirements that a SIP trunk, PBX, or SBC must meet to interoperate with the ElevenLabs SIP service, and describes how the service behaves. It covers network addressing, transports (UDP, TCP, TLS), signaling (SIP), and media (RTP/SRTP).

Use it as a companion to the SIP trunking guide, which explains how to import a SIP trunk phone number and assign it to an agent.

Conventions and terminology

The keywords MUST, MUST NOT, SHOULD, and MAY are to be interpreted as described in RFC 2119.

ElevenLabs terms

  • Inbound call: A call that you place to ElevenLabs.
  • Outbound call: A call that ElevenLabs places to you.
  • Load balancer: The public entry point to which you send initial INVITEs (sip.* and sip-static.* hostnames).
  • SIP proxy: The ElevenLabs server that handles a call behind the load balancer (sip1.*, sip2.*, sip3.* hostnames).
  • In-dialog request: A request sent within an established call: ACK, BYE, REFER, NOTIFY, re-INVITE.
  • Next hop: The address to which ElevenLabs sends an in-dialog request. See Next hop selection.
  • Remote domains: A setting of your SIP trunk in ElevenLabs: the list of domain names against which your TLS certificate is verified.
  • Imported phone number: The phone number that you registered in ElevenLabs and assigned to an agent. Technically, it can be any alphanumeric string. See Number matching.

General terms

  • SIP: Session Initiation Protocol (RFC 3261). Sets up, modifies, and ends calls. It does not carry audio.
  • SDP: Session Description Protocol. Text carried in SIP messages that describes codecs, IP addresses, ports, and encryption parameters.
  • RTP: Real-time Transport Protocol. Carries the audio of a call over UDP. It does not retransmit, so it is sensitive to delay and packet loss.
  • SRTP: Encrypted RTP. Both endpoints must support it.
  • RTCP: RTP Control Protocol. Reports packet loss and jitter statistics.
  • SIP trunk: A connection that carries calls between your PBX, SBC, or carrier and ElevenLabs.
  • SBC: Session Border Controller. An edge device that secures SIP traffic, normalizes messages, and handles NAT traversal.
  • PBX: Private Branch Exchange. A private phone system.
  • Dialog: The call state shared by both parties, identified by the Call-ID, the From tag, and the To tag. A request that matches no dialog is rejected.
  • Contact: The header that identifies the address of a party for requests within the dialog.
  • Record-Route / Route: Headers through which a proxy stays on the path of in-dialog requests. See Route set.
  • Digest authentication: Authentication with a username and a password, without sending the password in plain text.
  • ACL: Access control list. Authorization by source IP address (IP allowlist).
  • Codec: The audio encoding. Both endpoints must support a common codec. G.711 (PCMU, PCMA) uses 8 kHz audio; G722 uses 16 kHz.
  • DTMF: Keypad tones, used for example to navigate menus.
  • E.164: The international phone number format: +, country code, and subscriber number (for example +15551234567).
  • SIP URI: The address of a SIP party: sip:<identifier>@<host>:<port> (for example sip:+19991234567@sip.rtc.elevenlabs.io:5060).
  • NAPTR / SRV: DNS records used to discover the transport, host, and port of a SIP server (RFC 3263).
  • NAT: Network address translation. An endpoint behind NAT advertises a private address, which can misroute signaling and audio. See Media addresses and NAT.
  • MTU: Maximum transmission unit. A SIP message larger than the MTU may be fragmented or dropped over UDP.
  • Latency, jitter, packet loss: Delay of the audio, variation in packet arrival time, and lost packets. Each of them degrades the audio quality.

Network requirements

Signaling destinations

Send initial INVITEs to one of the following load balancers.

  • sip-static.rtc.elevenlabs.io
    • Transports: UDP, TCP, TLS
    • Ports: 5060 (UDP, TCP), 5061 (TLS)
  • sip.rtc.elevenlabs.io
    • Transports: TCP, TLS
    • Ports: 5060 (TCP), 5061 (TLS)

For UDP, you MUST use sip-static.rtc.elevenlabs.io.

ElevenLabs publishes NAPTR and SRV records (RFC 3263) for the load balancer hostnames, in the order of preference TLS, TCP, UDP. An SRV record for UDP is also published for sip.rtc.elevenlabs.io, but UDP is not accepted there. If your system selects the transport through NAPTR/SRV, make sure that it does not select UDP for a sip.* hostname.

Signaling sources

ElevenLabs sends in-dialog requests (BYE, REFER, and others) and outbound calls (INVITE) from its SIP proxies:

  • sip1.rtc.elevenlabs.io
  • sip2.rtc.elevenlabs.io
  • sip3.rtc.elevenlabs.io

You MUST accept SIP traffic from all three proxies and from the load balancers listed in Signaling destinations, on any source port. TCP and TLS connections opened by ElevenLabs use an ephemeral source port.

The three proxies are not always all running. At any given time, one or more of them may be out of service, for example during maintenance or scaling. Do not send initial INVITEs to an individual proxy, and do not treat an unreachable sipN hostname as an outage; use the load balancers instead. Your allowlist MUST still cover all three, because any of them may be in service and handle your next call.

Regions

The hostnames above belong to the global (US) region. Each data residency region has its own hostnames. Use the hostnames of the region in which your ElevenLabs workspace is located. All other requirements on this page apply equally to every region.

  • Global (US)
    • Load balancers (INVITE destinations): sip-static.rtc.elevenlabs.io, sip.rtc.elevenlabs.io
    • SIP proxies (request sources): sip1.rtc.elevenlabs.io, sip2.rtc.elevenlabs.io, sip3.rtc.elevenlabs.io
  • EU
    • Load balancers (INVITE destinations): sip-static.rtc.eu.residency.elevenlabs.io, sip.rtc.eu.residency.elevenlabs.io
    • SIP proxies (request sources): sip1.rtc.eu.residency.elevenlabs.io, sip2.rtc.eu.residency.elevenlabs.io, sip3.rtc.eu.residency.elevenlabs.io
  • India
    • Load balancers (INVITE destinations): sip-static.rtc.in.residency.elevenlabs.io, sip.rtc.in.residency.elevenlabs.io
    • SIP proxies (request sources): sip1.rtc.in.residency.elevenlabs.io, sip2.rtc.in.residency.elevenlabs.io, sip3.rtc.in.residency.elevenlabs.io
  • Singapore
    • Load balancers (INVITE destinations): sip-static.rtc.sg.residency.elevenlabs.io, sip.rtc.sg.residency.elevenlabs.io
    • SIP proxies (request sources): sip1.rtc.sg.residency.elevenlabs.io, sip2.rtc.sg.residency.elevenlabs.io, sip3.rtc.sg.residency.elevenlabs.io

In every region, sip-static.* accepts UDP, TCP, and TLS, and sip.* accepts TCP and TLS, on the ports listed in Signaling destinations.

All IP addresses used in an isolated (data residency) region are announced from servers located inside that region. ElevenLabs actively submits this information to the public geolocation databases, but does not guarantee that every public geolocation database is up to date. A geolocation lookup may therefore report a different location for an address than the region it serves. ElevenLabs takes no responsibility for calls that fail because of outdated geolocation information in public geolocation databases (for example, calls blocked by location-based filtering on your side or on your carrier’s side).

Media ports

ElevenLabs sends and receives media (RTP/SRTP) on UDP ports 10000–60000. You MUST allow this port range in both directions.

IP addresses and firewall allowlists

ElevenLabs signaling and media addresses belong to the range 199.88.252.0/24, with one exception: the sip.* load balancers (sip.rtc.elevenlabs.io and its regional equivalents) are outside this range.

  • If you require a firewall allowlist, allow the entire range.
  • If you send INVITEs to a sip.* load balancer, address it by hostname. Alternatively, use sip-static.*, whose addresses are within the range.
  • Requests and media sent by ElevenLabs always originate from 199.88.252.0/24. In-dialog requests and outbound calls originate from the sip1/2/3.* proxies. Responses to your INVITEs are returned over the connection that you opened.

The hostnames may begin resolving to different IP addresses, subject to 30 days’ notice. Use the hostnames or allow the entire range. Do not hardcode individual IP addresses.

Transports

ElevenLabs supports UDP, TCP, and TLS (SIP over TLS, indicated by ;transport=tls).

TCP or TLS is recommended. UDP has the following limitations:

  • A large INVITE (many codecs, SRTP keys, custom headers) can exceed the UDP MTU and may be fragmented or dropped.
  • There are known load balancing issues with UDP when the network topology changes. Messages of a call in progress can be affected, which may result in failed or dropped calls.

ElevenLabs does not support the sips: URI scheme for encryption in transit. It does support the sip: URI scheme with ;transport=tls.

If a URI uses the sips: scheme, ElevenLabs treats it as a sip: URI with ;transport=tls, and the messages that ElevenLabs sends use sip: with ;transport=tls. Use sip: and ;transport=tls in your URIs rather than relying on this adjustment. This eliminates any possible error made in the adjustment.

TLS connections you open to ElevenLabs

  • TLS 1.2 or newer is required. ElevenLabs selects the cipher suite from those that you offer; you MUST offer at least one modern cipher suite, otherwise the handshake fails.
  • You MUST send SNI. ElevenLabs presents a certificate that is valid for the hostname to which you connected.
  • Each ElevenLabs hostname has its own certificate, valid only for that hostname. For example, the certificate of sip.rtc.elevenlabs.io is not valid for sip-static.rtc.elevenlabs.io or sip1.rtc.elevenlabs.io, and vice versa. Validate each certificate against the hostname of the connection on which it was received. Do not expect a single certificate to cover all hostnames, and do not pin a certificate received from one hostname for use with another.
  • ElevenLabs does not request a client certificate.

TLS connections ElevenLabs opens to you

ElevenLabs opens TLS connections to you for outbound calls and for in-dialog requests that require a new connection. On every such connection, your certificate is verified as follows:

  • TLS 1.2 or newer is required. Your server selects the cipher suite from those that ElevenLabs offers.
  • The certificate chain MUST be signed by a publicly trusted CA, and the certificate MUST NOT be expired.
  • One of the certificate’s DNS subjectAltNames MUST match the domain to which ElevenLabs connects. The CN is considered only if the certificate contains no DNS subjectAltName. The domain to match is either:
    • the host of the next hop, if it is a domain name; or
    • one of the Remote domains configured on your SIP trunk.
  • Wildcards match exactly one label (*.example.com matches sip.example.com). Matching is case-insensitive.
  • If the next hop is an IP address and the trunk has no Remote domains, the certificate cannot be verified and the connection is refused. If your Contact or Record-Route uses an IP address, configure Remote domains on the trunk.
  • If you request a client certificate (mutual TLS), ElevenLabs presents the certificate of its proxy hostname (sipN.rtc.elevenlabs.io).

Inbound calls

INVITE request

The following example shows an initial INVITE sent over TCP:

INVITE sip:+14155550100@sip.rtc.elevenlabs.io;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 203.0.113.10:5060;branch=z9hG4bK776asdhds;rport
Max-Forwards: 70
From: "+12065550123" <sip:+12065550123@trunk.example.com>;tag=1928301774
To: <sip:+14155550100@sip.rtc.elevenlabs.io>
Call-ID: a84b4c76e66710@trunk.example.com
CSeq: 314159 INVITE
Contact: <sip:203.0.113.10:5060;transport=tcp>
Record-Route: <sip:proxy.example.com:5060;transport=tcp;lr>
Content-Type: application/sdp
Content-Length: ...
(SDP offer)

The headers are subject to the following requirements:

  • Request-URI: MUST have the form sip:<number>@<host>, where <host> is an ElevenLabs hostname (for example sip.rtc.elevenlabs.io) or the IP address to which the request was sent. A Request-URI that points elsewhere is rejected with 403 Not relaying. The user part MUST NOT be empty; otherwise the request is rejected with 484 Address Incomplete.
  • Via: Standard RFC 3261. Responses (1xx, 200 OK, errors) are returned to the source address and port of the request, as if rport were always present. Over TCP/TLS, they are returned on the same connection.
  • From: From: "<caller number>" <sip:<caller number>@<your host>>;tag=<tag>. The tag is mandatory: an INVITE without a From tag is rejected with 400 Missing From Tag. The user part is used as the caller number, unless an X-Caller-ID header is present. See Custom headers.
  • To: To: <sip:<called number>@<ElevenLabs host>>. The initial INVITE MUST NOT contain a To tag; an INVITE with a To tag is treated as a re-INVITE of an existing call. The user part is matched against your imported phone number. See Number matching.
  • Contact: Your address for in-dialog requests. It is used as the next hop when no Record-Route is present. See Next hop selection.
  • Record-Route: Optional. See Route set.
  • Call-ID: MUST be globally unique per call. All INVITEs belonging to one call (for example, the INVITE resent with credentials after a 407) MUST use the same Call-ID.
  • CSeq: Standard RFC 3261. The INVITE resent after a 407 MUST carry an increased CSeq.
  • Max-Forwards: Optional. If present, it MUST be greater than 0; otherwise the request is rejected with 483 Too Many Hops.
  • Content-Type: application/sdp.
  • Content-Length: MUST be present over TCP/TLS.

Number matching

The user part of the To header is matched against the phone number that you imported in ElevenLabs. It MUST match exactly, including the leading +. The E.164 format (+14155550100) is recommended.

Technically, the phone number does not have to be a real phone number: it can be any alphanumeric string (for example support or agent42), as long as the To user part equals the value that you imported in ElevenLabs.

Deprecated: if no exact match is found, ElevenLabs currently also attempts a match without the leading +. This fallback will be removed in the future. Do not rely on it.

SDP offer

The INVITE MUST contain an SDP offer with an audio stream. An INVITE without SDP (delayed offer) is rejected with 488 Not Acceptable Here. See Media.

Authentication

Inbound calls are authorized according to the settings of your SIP trunk in ElevenLabs. Two mechanisms are available. Digest authentication is recommended, because it does not depend on fixed IP addresses; an IP allowlist must be updated whenever your addresses change.

IP allowlist

The source IP address of the INVITE (the address from which the TCP/TLS connection or the UDP packet originated) is checked against the allowed addresses of the trunk. If the address is not allowed, the call is rejected with 403.

Digest authentication

Digest authentication applies when the trunk has a username and a password configured.

  1. ElevenLabs answers the first INVITE with 407 Proxy Authentication Required and a Proxy-Authenticate header (realm="LiveKit", algorithm=MD5).
  2. You MUST resend the INVITE with a Proxy-Authorization header, the same Call-ID and From tag, and a new CSeq.
  3. Incorrect credentials are answered with 401 Unauthorized. No new challenge is issued.

Response sequence

ElevenLabs answers an INVITE in the following order:

  1. 100 Processing, immediately.
  2. 180 Ringing, repeated periodically while the call is being set up. ElevenLabs does not send 183 Session Progress and does not provide early media.
  3. 200 OK with the SDP answer, or a final error response. See Error responses.

Additional behavior:

  • If you send CANCEL before the 200 OK, the call is terminated with 487 Request Terminated.
  • If an INVITE arrives with the Call-ID and From tag of a call that was rejected recently (for example, during failover between your servers), it receives the same rejection.

200 OK response

  • Via: Copied from the INVITE.
  • From: Copied from the INVITE.
  • To: Copied from the INVITE, with the ElevenLabs tag added.
  • Call-ID: Copied from the INVITE.
  • CSeq: Copied from the INVITE.
  • Record-Route: The ElevenLabs proxy, placed before your own Record-Route entries. In-dialog requests MUST follow it. See Route set.
  • Contact: The ElevenLabs SIP server, without a user part and with a transport parameter.
  • Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, REFER, NOTIFY
  • Content-Type: application/sdp
  • Content-Length: Length of the SDP answer.

ACK

You MUST acknowledge the 200 OK with an ACK. A missing ACK is tolerated for a short period only: if no ACK arrives and no RTP is received from you, ElevenLabs terminates the call.

In-dialog requests

This section applies to ACK, BYE, REFER, NOTIFY, and re-INVITE.

Route set

ElevenLabs follows RFC 3261 loose routing.

For requests you send to ElevenLabs (ACK, BYE, re-INVITE, NOTIFY):

  • Use the route set from the 200 OK: the Record-Route entries become Route headers, and the Request-URI is the ElevenLabs Contact.
  • The ElevenLabs Record-Route identifies the proxy that handled the call (sipN.rtc.elevenlabs.io or its IP address), not the load balancer. You MUST be able to reach this proxy using the transport of the call.

For requests ElevenLabs sends to you (BYE, REFER, re-INVITE):

  • If your INVITE contained Record-Route headers, ElevenLabs sends them as Route headers in the same order (RFC 3261, section 12.1.1). The request is sent to the topmost Route, which is the topmost Record-Route of your INVITE.
  • If your INVITE contained no Record-Route, the request is sent to your Contact.
  • The topmost Route need not be the address from which the INVITE originated. If it differs, the request is sent to the new destination.

Next hop selection

The next hop is the address in the topmost Route header or, if there is no Route, the address in your Contact. In-dialog requests that ElevenLabs sends (for example BYE or REFER) are addressed to the host and port of the next hop, and are always sent over the same transport as the INVITE of the call. This applies to both inbound calls (you sent the INVITE) and outbound calls (ElevenLabs sent the INVITE).

  • Transport: Always the transport of the INVITE (UDP, TCP, or TLS). The transport that the next hop states (a transport parameter or the sips: scheme) is ignored.
  • Host: The host of the next hop. A domain name is resolved through DNS A records. A private address is replaced only on TCP/TLS (see Connection reuse); over UDP the request is sent to the address as stated.
  • Port: The port of the next hop. If it has no port: 5060 for UDP and TCP, 5061 for TLS.

For example, if the INVITE was sent over TCP and your Contact is <sip:203.0.113.10:5060> or <sip:203.0.113.10:5060;transport=udp>, the BYE is sent over TCP to 203.0.113.10:5060.

A call cannot be moved to a different transport through the Contact or Record-Route. You MUST be able to receive in-dialog requests on the next hop over the transport of the INVITE. For consistency, state that transport (;transport=tcp or ;transport=tls) in your Contact and Record-Route when using TCP or TLS.

Connection reuse

This section applies to TCP and TLS.

Initial transaction

The INVITE and its responses are exchanged over a single TCP/TLS connection. ElevenLabs does not open a new connection to deliver a response, so you MUST keep the connection open until you receive the final response. If the connection is closed before the call is established, the call fails. The ACK follows the route set and may use the same connection or a new connection to the proxy in the Record-Route.

Connection pool

In accordance with RFC 3261, ElevenLabs reuses TCP/TLS connections. Each SIP proxy maintains a pool of connections:

  • TCP: at most one connection per destination IP:port.
  • TLS: a separate connection per destination and per list of Remote domains. A connection verified for one domain is therefore never used for another.

Connection selection

The connection used for a request that ElevenLabs sends within a call (BYE, REFER, and others) depends on the next hop:

  • The IP address from which your INVITE originated. The comparison is a string comparison of the host; the port may differ (for example, you advertise 5061 but connected from an ephemeral port).
    • Connection used: The connection over which your INVITE arrived.
    • If that connection is closed: A new connection is opened to the next hop, using the transport of the original connection. See Next hop selection.
  • A private address (RFC 1918 or 100.64.0.0/10), for example a Contact behind NAT.
    • Connection used: The connection over which your INVITE arrived.
    • If that connection is closed: A new connection is opened to the public IP address from which your INVITE originated, on port 5060 (TCP) or 5061 (TLS).
  • A domain name, or a different IP address. A domain name never matches the source IP address.
    • Connection used: The original connection is not reused. A new connection is opened to the next hop, or an existing pooled connection to that IP:port is reused.
    • If that connection is closed: Not applicable.

Certificate verification

Every new TLS connection opened by ElevenLabs verifies your certificate. See TLS connections ElevenLabs opens to you. If the next hop is an IP address, you MUST configure Remote domains on the trunk. Otherwise, the connection is refused and the request (for example, a BYE) fails.

Idle connections

Idle TCP/TLS connections are closed after a period without traffic. To keep a connection usable during long calls, send keep-alives (for example, CRLF keep-alives or OPTIONS), or be prepared to accept new connections from ElevenLabs.

In summary: keep the connection open for the duration of the call, and be able to accept new connections from the ElevenLabs proxies on the next-hop address.

BYE

Either party may terminate the call with BYE. A BYE sent by ElevenLabs may carry custom headers configured on your trunk (attributes mapped to headers). See BYE headers from dynamic variables.

If ElevenLabs rejects a call that has not yet been answered, it sends a final response to the INVITE instead (for example, 486 Rejected).

Blind transfer with REFER

When the agent transfers a call, ElevenLabs uses SIP REFER (RFC 3515) as follows:

  1. ElevenLabs sends REFER within the dialog, with Refer-To: <sip:...> or <tel:...> and any headers configured for the transfer. A number without a scheme is sent as tel:. The URI may carry headers, for example ?User-to-User=....
  2. You MUST answer with a 2xx response (202 Accepted or 200 OK). Any other final response fails the transfer, and the call remains with the agent.
  3. You SHOULD report progress with NOTIFY (Event: refer, message/sipfrag body). ElevenLabs answers each NOTIFY with 200 OK.

The outcome of the transfer is determined as follows:

  • NOTIFY with a final 2xx sipfrag: Transfer succeeded. ElevenLabs sends BYE.
  • NOTIFY with a final 3xx–6xx sipfrag: Transfer failed. The call remains with the agent.
  • You send BYE: Transfer is considered successful.
  • No final NOTIFY within the timeout: Transfer is considered successful. ElevenLabs sends BYE.

The REFER must be answered promptly. An unanswered REFER fails the transfer.

Supported methods

  • INVITE, ACK, CANCEL, BYE: Supported.
  • re-INVITE: Supported (for example, hold and media change).
  • REFER, NOTIFY: Supported. ElevenLabs sends REFER; you send NOTIFY.
  • OPTIONS: Supported. An OPTIONS request to an ElevenLabs hostname without a user part (OPTIONS sip:sip.rtc.elevenlabs.io) is answered with 200 and may be used as a trunk health check.
  • INFO: Not supported (405). DTMF must be sent in RTP. See DTMF.
  • REGISTER: Not supported (403 Registration not allowed). Use IP and/or digest authentication on the trunk.
  • UPDATE, PRACK: Not supported.

re-INVITE

A re-INVITE is an INVITE sent within an established call, for example to place the call on hold or to change the media. It is recognized by the To tag. It is routed by its Route header and Request-URI only; the rules for the initial INVITE in INVITE request (Request-URI of the form sip:<number>@<host>, non-empty user part) do not apply.

The following example shows a re-INVITE for a call answered with the 200 OK of Example 1:

INVITE sip:10.20.30.40:5060;transport=tcp SIP/2.0
Route: <sip:<sip1 IP>:5060;transport=tcp;lr;...>
Via: SIP/2.0/TCP 203.0.113.10:5060;branch=z9hG4bK99xyz1;rport
Max-Forwards: 70
From: "+12065550123" <sip:+12065550123@trunk.example.com>;tag=1928301774
To: <sip:+14155550100@sip.rtc.elevenlabs.io>;tag=SCL_a1b2c3
Call-ID: a84b4c76e66710@trunk.example.com
CSeq: 314161 INVITE
Contact: <sip:203.0.113.10:5060;transport=tcp>
Content-Type: application/sdp
Content-Length: ...
(SDP offer)

The headers are subject to the following requirements:

  • Request-URI (required): The URI of the ElevenLabs Contact from the 200 OK, copied unchanged: same host, port, and transport parameter. It has no user part, and it may be a private IP address. You MUST NOT replace it with the number, an ElevenLabs hostname, or the address of your connection.
  • Route (required): The Record-Route entries of the 200 OK, in reverse order (RFC 3261, section 12.1.2), with all parameters preserved. If the proxy added two entries for itself, both MUST be present. A re-INVITE without the ElevenLabs Route is rejected with 404 Not here.
  • Via (required): Standard RFC 3261, with a new branch.
  • From (required): Identical to the initial INVITE, including the tag. A request without a From tag is rejected with 400 Missing From Tag.
  • To (required): Identical to the To of the 200 OK, including the ElevenLabs tag. Without the tag, the request is treated as a new call.
  • Call-ID (required): Identical to the initial INVITE.
  • CSeq (required): Method INVITE; the number MUST be higher than that of your previous request in the call.
  • Max-Forwards (optional): If present, MUST be greater than 0 (483 Too Many Hops otherwise).
  • Contact (required): Your address for in-dialog requests. It SHOULD be the same as in the initial INVITE, and it MUST include ;transport=tcp or ;transport=tls when UDP is not used.
  • Proxy-Authorization (optional): A re-INVITE is not challenged, also on trunks with digest authentication.
  • Content-Type (required): application/sdp.
  • Content-Length (required over TCP/TLS): Length of the SDP offer.
  • Body (required): An SDP offer with an audio stream, subject to the same rules as the initial offer. See Media. An offer without an audio stream is rejected with 488 Not Acceptable Here. If Media encryption is set to Required, the offer MUST contain a supported crypto suite.

Deliver the re-INVITE as follows:

  • Send the re-INVITE to the topmost Route (the ElevenLabs proxy), using the transport of the call. Do not send it to the load balancer hostname or to the address in the Request-URI.
  • ElevenLabs answers with 200 OK and an SDP answer. You MUST acknowledge it with an ACK that carries the same Request-URI and Route headers as the re-INVITE.

Routing examples

The examples in this section illustrate the rules of In-dialog requests. They assume the following:

  • Your SBC has the public IP address 203.0.113.10.
  • It listens on port 5060 (TCP) and port 5061 (TLS).
  • It opens connections to ElevenLabs from an ephemeral port (49152).

Only the headers relevant to routing are shown. ... denotes other parameters.

  1. Requests you send to ElevenLabs: Not applicable; shows how to build your own requests.
  2. Contact with your public IP address: Existing connection reused.
  3. Contact with a private address (NAT): Existing connection reused.
  4. Record-Route with a domain name, TLS: New TLS connection.
  5. Record-Route with an IP address, TLS: Existing connection reused; Remote domains required for a new connection.
  6. Record-Route without a transport parameter: Existing connection reused; fallback is a new connection over the transport of the INVITE.
  7. Record-Route pointing to a different host: New TCP connection.

Example 1: Requests you send to ElevenLabs

You send the INVITE over TCP to sip.rtc.elevenlabs.io. The 200 OK contains:

SIP/2.0 200 OK
Record-Route: <sip:<sip1 IP>:5060;transport=tcp;lr;...>
Contact: <sip:10.20.30.40:5060;transport=tcp>

Your ACK, BYE, and re-INVITE MUST use the Record-Route as Route and the ElevenLabs Contact as Request-URI:

BYE sip:10.20.30.40:5060;transport=tcp SIP/2.0
Route: <sip:<sip1 IP>:5060;transport=tcp;lr;...>

The request is sent to the topmost Route (the ElevenLabs proxy sip1), over the existing connection if it is still open.

  • The proxy may add two Record-Route entries for itself (with r2=on). Build the route set from all entries, as RFC 3261 requires. Do not drop or rewrite them.
  • The ElevenLabs Contact may be a private address. Never send requests to it directly; always follow the Route.
  • Over TLS, the Record-Route contains the hostname of the proxy (sip:sip1.rtc.elevenlabs.io:5061;transport=tls;lr;...). Validate the certificate against that hostname.

Example 2: Existing connection is reused

Your INVITE arrives over TCP from 203.0.113.10:49152, without Record-Route:

Contact: <sip:203.0.113.10:5060;transport=tcp>

When the agent hangs up, the BYE is addressed to sip:203.0.113.10:5060;transport=tcp. The host 203.0.113.10 is the IP address from which your INVITE originated (the port is not compared), so the BYE is sent over your existing connection from port 49152.

If you have closed that connection, ElevenLabs opens a new TCP connection to 203.0.113.10:5060 from sip1/2/3.rtc.elevenlabs.io.

With Contact: <sip:203.0.113.10:5060> (no transport parameter), the behavior is identical: the BYE is sent over the existing connection, and a new connection would also use TCP, the transport over which your INVITE arrived.

Example 3: Endpoint behind NAT

Your INVITE arrives over TLS from 203.0.113.10:49152, without Record-Route and with your private address in the Contact:

Contact: <sip:192.168.1.20:5061;transport=tls>

ElevenLabs cannot reach 192.168.1.20, so the BYE is sent over your existing connection.

If you have closed that connection, ElevenLabs opens a new TLS connection to the public IP address from which your INVITE originated, on the default port: 203.0.113.10:5061. Because the destination is an IP address, certificate verification requires Remote domains on your trunk. See Example 5.

Example 4: Record-Route with a domain name

Your INVITE arrives over TLS from 203.0.113.10:49152 with:

Record-Route: <sip:sbc.example.com:5061;transport=tls;lr>
Contact: <sip:+12065550123@192.168.1.20:5061;transport=tls>

The BYE is sent with Route: <sip:sbc.example.com:5061;transport=tls;lr> to the topmost Route, sbc.example.com.

A domain name never matches the IP address from which your INVITE originated, so your connection is not reused. ElevenLabs resolves sbc.example.com and opens a new TLS connection to it on port 5061, or reuses a pooled connection to it.

  • Your certificate MUST be valid for sbc.example.com.
  • You MUST accept this connection from sip1/2/3.rtc.elevenlabs.io.

Example 5: Record-Route with an IP address over TLS

Your INVITE arrives over TLS from 203.0.113.10:49152 with:

Record-Route: <sip:203.0.113.10:5061;transport=tls;lr>

The topmost Route contains the IP address from which your INVITE originated, so the BYE is sent over your existing connection.

If you have closed that connection, ElevenLabs opens a new TLS connection to 203.0.113.10:5061. Because the host is an IP address, your certificate is verified against the Remote domains of your trunk (for example, sbc.example.com). Without Remote domains, the new connection is refused and the BYE fails.

Example 6: Record-Route without a transport parameter

Your INVITE arrives over TCP from 203.0.113.10:49152 with:

Record-Route: <sip:203.0.113.10:5060;lr>

The topmost Route contains the IP address from which your INVITE originated, so the BYE is sent over your existing connection while it remains open.

If you have closed that connection, ElevenLabs opens a new TCP connection to 203.0.113.10:5060. The Route provides no transport information, so the transport over which your INVITE arrived is used. The result is the same with ;transport=udp in the Record-Route.

Example 7: In-dialog requests to a different host

Your INVITE arrives over TCP from your SBC at 203.0.113.10:49152, but in-dialog requests are to be delivered to another server:

Record-Route: <sip:198.51.100.7:5060;transport=tcp;lr>

The topmost Route contains a different IP address from the one from which your INVITE originated, so your connection is not reused. The BYE is sent over a new TCP connection to 198.51.100.7:5060 (or a pooled connection to it), from sip1/2/3.rtc.elevenlabs.io.

Outbound calls

INVITE sent by ElevenLabs

The INVITE originates from one of the ElevenLabs proxies (sip1/2/3.rtc.elevenlabs.io, see Signaling sources) over the transport configured on the trunk.

  • Request-URI: sip:<called number>@<your address>;transport=<transport>
  • From: "<caller number>" <sip:<caller number>@<ElevenLabs host or the trunk's From domain>>;tag=...
  • To: <sip:<called number>@<your address>>
  • SDP offer: G722, PCMU, PCMA, and telephone-event, or the codecs configured on the trunk. SRTP keys are included if media encryption is set to Allowed or Required.

Call handling

  • Authentication: If you answer with 401 or 407, ElevenLabs retries with the username and password configured on the trunk (digest authentication).
  • Ringing: ElevenLabs waits for an answer until the ringing timeout expires (configurable per call), and then sends CANCEL.
  • Answer: The 200 OK MUST contain an SDP answer with one of the offered audio codecs. Otherwise, ElevenLabs sends ACK followed by BYE, and the call fails with 488.
  • Routing: Your Contact and Record-Route in the 200 OK determine the next hop for the ACK, BYE, and REFER sent by ElevenLabs. The rules in Next hop selection apply.
  • TLS: Your certificate is verified against the host of the Request-URI, if it is a domain name, and against the Remote domains of the trunk. See TLS connections ElevenLabs opens to you. A trunk addressed by IP address over TLS requires Remote domains.
  • Failure responses: Your 4xx–6xx responses are reported to the agent or API with their status code. For 400, 404, 480, 486, and 488, the response body or an X-Twilio-Error header, if present, is used as the reason.

Media

SDP

  • ElevenLabs uses the first audio stream (m=audio) of the offer. Other streams (video, a second audio stream, T.38 m=image, and others) are ignored and rejected in the answer.
  • An offer without an audio stream is rejected with 488.
  • The answer contains one audio codec, plus telephone-event if it was offered.

Codecs

  • G722: Payload type 9. Wideband (16 kHz audio).
  • PCMU (G.711 µ-law): Payload type 0.
  • PCMA (G.711 A-law): Payload type 8.
  • G729: Payload type 18.
  • AMR: Dynamic payload type.
  • AMR-WB: Dynamic payload type. Wideband (16 kHz audio).
  • telephone-event: Dynamic payload type (/8000). DTMF, RFC 4733.

DTMF

  • DTMF MUST be sent as RTP events (RFC 4733 / RFC 2833, telephone-event/8000).
  • The offer MUST contain telephone-event for DTMF to function.
  • DTMF over SIP INFO is not supported.
  • In-band DTMF tones are not detected as DTMF.
  • ElevenLabs sends DTMF as RTP events as well.

See DTMF input for how agents receive keypad digits, and play keypad touch tone for how agents send DTMF.

Media addresses and NAT

  • ElevenLabs sends media to the IP address and port in your SDP (c= and m=audio lines).
  • If your SDP contains a private IP address (endpoint behind NAT), ElevenLabs sends media to the IP address from which your SIP request originated, and then switches to the address from which your first RTP packet arrives (symmetric RTP).
  • You SHOULD send RTP from the same IP address and port on which you receive it (symmetric RTP).
  • The ElevenLabs SDP contains a public IP address from 199.88.252.0/24 and a port from the range 10000–60000.

SRTP media encryption

ElevenLabs supports SDES-SRTP (RFC 4568: a=crypto lines in the SDP, RTP/SAVP profile). DTLS-SRTP and ZRTP are not supported.

Supported crypto suites, in order of preference:

  1. AES_CM_128_HMAC_SHA1_80
  2. AES_CM_128_HMAC_SHA1_32
  3. AES_256_CM_HMAC_SHA1_80
  4. AES_256_CM_HMAC_SHA1_32

The behavior is determined by the Media encryption setting of your SIP trunk:

  • Disabled (default)
    • Inbound calls: Plain RTP only. a=crypto lines in your offer are ignored, and the answer uses RTP/AVP. An endpoint that requires SRTP will reject this answer.
    • Outbound calls: ElevenLabs offers plain RTP (RTP/AVP).
  • Allowed
    • Inbound calls: If your offer contains a supported crypto suite, the answer uses SRTP; otherwise it uses plain RTP.
    • Outbound calls: ElevenLabs offers SRTP (RTP/SAVP with the suites above) and accepts a plain RTP answer.
  • Required
    • Inbound calls: An offer without a supported crypto suite is rejected with 488 SRTP Required. A re-INVITE without one is rejected with 488.
    • Outbound calls: ElevenLabs offers SRTP. If the answer does not use SRTP, ElevenLabs hangs up and the call fails with 488.

SRTP keys are always negotiated with the ElevenLabs media relay. Your keys are never passed through.

Custom headers

You MAY add the following custom headers to the INVITE.

  • X-*: Passed to the agent as a dynamic variable. See the naming rules below.
  • User-to-User (RFC 7433): Available as sip_uui_raw, and in decoded form (hex or ASCII encoding) as sip_uui_data. When the header has purpose=isdn-uui, the protocol discriminator octet is removed from the decoded value.
  • X-Caller-ID: Overrides the caller number taken from the From header.
  • X-Call-ID or X-Twilio-CallSid: Your own call identifier, stored with the call. If absent, the SIP Call-ID is stored.

Naming rules for X- headers

The header name is converted to a dynamic variable name as follows:

  1. The name is converted to lower case.
  2. The X- prefix is replaced with sip_.
  3. Each - is replaced with _, and each _ is replaced with __.

For example, X-Customer-Id: 42 becomes sip_customer_id, and X-customer_tier becomes sip_customer__tier.

If a header is repeated, the first occurrence is used.

Headers sent by ElevenLabs

ElevenLabs can add custom headers to the requests it sends:

  • INVITE of an outbound call
    • Headers: Static X-* headers.
    • Configured in: The headers field of the outbound trunk configuration.
  • BYE
    • Headers: Headers whose values are taken from dynamic variables, using the value at the end of the conversation.
    • Configured in: Attributes to headers (API only), on the inbound and the outbound trunk configuration.
  • REFER to a SIP URI
    • Headers: User-to-User, and any headers configured for the transfer.
    • Configured in: The uui setting of the transfer rule.

Call flows

Inbound call over TCP/TLS

You (trunk) sip.rtc.elevenlabs.io / sipN ElevenLabs
| | |
|--- INVITE (SDP offer) ----------------->| (connection 1) |
|<-- 100 Processing ----------------------| |
| [407 + INVITE with credentials if digest auth is configured] |
|<-- 180 Ringing (repeated) --------------| |
|<-- 200 OK (SDP answer, Record-Route) ---| |
|--- ACK -------------------------------->| |
|<============ RTP / SRTP (199.88.252.0/24) ===============================>|
| | |
|<-- REFER / BYE -------------------------| over connection 1 if still open |
| | and the next hop is the source |
| | IP, else a new connection from |
| | sip1/2/3 to the next hop |
  1. Send the INVITE to sip.rtc.elevenlabs.io or sip-static.rtc.elevenlabs.io.
  2. All responses (1xx, 200 OK) arrive over the same connection.
  3. Send in-dialog requests (ACK, BYE, and others) following the ElevenLabs Record-Route.
  4. In-dialog requests from ElevenLabs (REFER, BYE) arrive over the same connection, or over a new connection from one of the proxy addresses.

Inbound call over UDP

  1. Send the INVITE to sip-static.rtc.elevenlabs.io:5060.
  2. Responses originate from the address to which you sent the INVITE (the load balancer IP address, port 5060).
  3. Send in-dialog requests following the ElevenLabs Record-Route.
  4. In-dialog requests from ElevenLabs (REFER, BYE) are sent to your next hop over UDP, from the load balancer IP address.

Error responses

The following final responses may be returned for an inbound request.

  • 400 Missing From Tag: The From header has no tag.
  • 401 Unauthorized / Bad credentials: The digest credentials are incorrect.
  • 403 Not relaying: The Request-URI host is not an ElevenLabs hostname.
  • 403 Registration not allowed: REGISTER is not supported.
  • 403 (message varies): The source IP address or the number is not allowed for the trunk.
  • 404 Not Found / No agent assigned to the phone number: The called number (To user part) is not imported, or has no agent assigned.
  • 404 Not here: An in-dialog request (for example a re-INVITE or BYE) arrived without the ElevenLabs Route header. See re-INVITE.
  • 405 Method Not Allowed: INFO is not supported.
  • 407 Unauthorized: Digest challenge. Resend the request with credentials.
  • 408 Request Timeout: The call could not be set up in time.
  • 481 Call/Transaction Does Not Exist: An in-dialog request does not match a call known to ElevenLabs.
  • 483 Too Many Hops: Max-Forwards is 0.
  • 484 Address Incomplete: The Request-URI has no user part.
  • 486 Rejected: The call ended before it was answered.
  • 487 Request Terminated: You cancelled the call.
  • 488 Not Acceptable Here: The offer has no SDP, no audio stream, or no supported codec.
  • 488 SRTP Required: Media encryption is set to Required and the offer contains no supported crypto suite.
  • 502 Bad Gateway: Most likely, the conversation initiation client data could not be loaded from your webhook.
  • 503 Service Unavailable: Temporary error on the ElevenLabs side. Retry or fail over.

Trunk settings in ElevenLabs

The following settings of an imported phone number (SIP trunk) in ElevenLabs affect the behavior described on this page.

  • Transport type (inbound and outbound): The transport of the trunk: TCP (port 5060) or TLS (port 5061). TLS is recommended for production. See Transports.
  • Media encryption (inbound and outbound): Disabled, Allowed, or Required. See SRTP media encryption.
  • Address (outbound): The hostname or IP address to which the INVITE of an outbound call is sent. It is entered without the sip: prefix. See Outbound calls.
  • Username and password (inbound and outbound): Digest authentication credentials. See Authentication and Call handling.
  • Allowed addresses (inbound): IP allowlist for the source address of the INVITE. See Authentication.
  • Remote domains (inbound and outbound): The domain names accepted when ElevenLabs verifies your TLS certificate. Verification succeeds if the certificate is valid for at least one of them. Required when the next hop is an IP address. See TLS connections ElevenLabs opens to you.
  • Headers (outbound): Static X-* headers added to the INVITE. See Custom headers.
  • Attributes to headers (API only, inbound and outbound): Dynamic variables sent as headers in the BYE. See Custom headers.

Next steps