> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Bring your own SIP trunk

> Connect inbound and outbound SIP with separate settings and gateway failover.

Use **Bring your own SIP** when your provider uses different inbound source IPs and outbound destinations, or when you need multiple outbound gateways. Inbound and outbound directions have separate settings and credentials.

## Before you begin

You need the workspace permissions and SIP availability described in [Connect with Voiceflow SIP](/docs/documentation/deploy/phone/connect-with-sip#before-you-begin), an agent to assign, and your provider’s trunk configuration.

Collect the public IPv4 source ranges for inbound calls. For outbound calls, collect the destination hostname or public IPv4 address, protocol, optional custom port and Caller ID. Obtain outbound digest credentials only if the provider requires them.

## Connect your trunk

### 1. Choose Bring your own SIP

Open **Phone numbers → Create number → SIP → Bring your own SIP**. Enter a **Name** and enable **Inbound calls**, **Outbound calls and transfers**, or both. At least one direction must remain enabled.

### 2. Configure calls into Voiceflow

Under **Inbound calls**, choose **IPs**, **Credentials** or **Both**. Enter the provider’s public IPv4 addresses or ranges, and its SIP username and password when using digest authentication. Inbound hostname and IPv6 gateway addresses are not accepted. With **Both**, the source address and credentials must both match.

For an outbound-only trunk, turn **Inbound calls** off; do not add inbound addresses just to complete the form.

Native Bring your own SIP inbound authentication settings — Configure the enabled inbound direction with your phone system’s source addresses.

### 3. Configure calls to your provider

Under **Outbound calls and transfers**, add an **Address** for each destination, in failover order. Each row has **Port** and **Protocol**. Use a public IPv4 address or hostname, without a SIP scheme, path or embedded port. An empty Port saves as `5060` for UDP/TCP or `5061` for TLS.

Enter the outbound **Username** and **Password** together if your provider requires digest authentication. Otherwise leave both empty and configure the provider’s source-IP allowlist. Enter an E.164 **Caller ID** such as `+14165550123`.

The connection allows **10 addresses in total**, counting both inbound IP rows and outbound destination rows. See [gateway failover](/docs/api-reference/agent-runtime/voice/sip/settings#gateway-failover) for the conditions that advance to another destination.

### 4. Enable encrypted audio when supported

Turn on **Encrypted audio (SRTP)** to require SRTP audio. The form switches outbound addresses to TLS and holds them there while encryption is on. Your provider must call Voiceflow over TLS on `5061` with SRTP. A TLS destination needs a certificate chain trusted by a public certificate authority.

### 5. Create, assign and route

Click **Create**, copy the **SIP address**, and assign the agent. Select its Environment and version in the connection settings, or use **All environments** for traffic-split routing.

For inbound calls, route the provider’s numbers to `sip:<dialled-number>@<connection-sip-address>` without SIP registration. All numbers on this connection use its assigned agent; they do not create per-number agent routes.

## Verify the result

Test each enabled direction. For inbound, confirm the assigned agent answers and you hear audio both ways. For outbound, use the [outbound API](/docs/api-reference/agent-runtime/voice/sip/outbound) with a number or PBX extension you control and confirm that it rings and connects.

If you configured failover, use a controlled test destination to check a gateway-unavailable case. A busy or declined call intentionally does not advance to another gateway. Check the provider’s SIP logs and [Transcripts](/docs/documentation/measure/transcripts).

## Update the trunk

Open the connection to edit its addresses and credentials. Turning a direction off removes its saved configuration. A blank password field in an existing editor keeps the stored password; enter a new value to replace it. See [connection maintenance](/docs/api-reference/agent-runtime/voice/sip/settings#editing-and-removing-connections).
