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

# Custom SIP Connection

> Set up your own SIP trunks and phone numbers.

With the **custom SIP connection**, customers with the SIP feature enabled can connect their existing telephony infrastructure to Miyon AI. Incoming calls are forwarded from your own SIP provider to Miyon AI, and your own phone numbers can be assigned to a voice agent.

![SIP setup in the phone numbers area](https://mintcdn.com/miyon/EGFHXcCQRLDJeWBU/images/byos-sip-overview.jpeg?fit=max\&auto=format\&n=EGFHXcCQRLDJeWBU\&q=85\&s=f2b5cb69cf38d6f1dd1f3f350c68f8cb)

> [!NOTE]
>
> This feature is primarily intended for standalone customers who use their own SIP provider or SIP trunk. Miyon customers can also request and have the feature enabled if needed. Managed phone numbers from the Miyon inventory remain in the **Phone numbers** area.

## Overview

The SIP setup consists of three parts:

* **Custom SIP trunk**: the connection your SIP provider uses to forward inbound calls, either to your SIP address or to our gateway in the supported IP mode.
* **Custom phone numbers**: phone numbers or SIP identifiers that come in via your own trunk and are assigned to a voice agent.
* **Outbound connection**: your provider's SIP destination and authentication for outbound calls and warm transfers.

If only the inbound trunk is active, inbound BYOS calls can be processed. If only the outbound trunk is active, outbound calls and warm transfers can run via your own provider. Both directions can be activated independently of each other. The selected IP authentication applies to both directions of the same connection.

## Set up your provider

Use this overview to set up your SIP connection and phone numbers. For the steps in your telephony provider's portal or phone system, follow the relevant guide:

> **[Twilio](/docs/en/twilio)**
>
> Elastic SIP trunk, origination, termination, and SIP REFER.

> **[NFON](/docs/en/nfon)**
>
> IP authentication, number routing, and warm transfer.

> **[3CX](/docs/en/3cx)**
>
> SIP trunk, outbound rules, and forwarding to the voice agent.

## SIP address

Every enabled account receives its own SIP address. This address is shown in the **SIP** area and can be copied directly.

```text theme={null}
sip:in-abc1234567890abcdef1234.aisip.miyon.ai
```

For a connection using your personal SIP address, enter it at your SIP provider as the destination for incoming calls. With providers like Twilio, this typically corresponds to the **Origination URI** of the SIP trunk.

> [!WARNING]
>
> Use the SIP address only for the associated account. The address contains an account-specific token and should not be shared between customers or tenants.

## Activating the inbound SIP trunk

Open **Phone numbers → SIP** and select the inbound connection in the **SIP connections** area.

![Inbound SIP settings](https://mintcdn.com/miyon/k1W2EMCYe3WDkNuH/images/byos-sip-inbound-settings.png?fit=max\&auto=format\&n=k1W2EMCYe3WDkNuH\&q=85\&s=2439849e8302e1660a3211aae7b8fb02)

For inbound calls through your personal SIP address, you can optionally enter fixed source IP addresses of your SIP provider under **Allowed Source IPs / CIDRs**. If this field is set, Miyon AI only accepts inbound SIP calls from these IP addresses.

Examples:

```text theme={null}
35.156.191.128/32
35.156.191.128/32, 35.156.191.129/32
```

For a connection using your personal SIP address, you can leave this field empty if your provider does not offer fixed source IP addresses. In **Receive calls via IP** mode, the list is required instead; see the [NFON setup](/docs/en/nfon#4-set-up-inbound-calls-in-the-platform).

## Adding a custom phone number

A custom phone number describes which called number or SIP identifier is routed via your own trunk to which voice agent.

![Adding a custom phone number](https://mintcdn.com/miyon/k1W2EMCYe3WDkNuH/images/byos-sip-phone-number-dialog.png?fit=max\&auto=format\&n=k1W2EMCYe3WDkNuH\&q=85\&s=f6c60c930c02168258fce3db6ec0bb2d)

1. Open **Phone numbers → SIP**.
2. Click **Add phone number**.
3. Enter the phone number in international format, for example `+491234567890`.
4. Optionally, assign a label.
5. Select the voice agent that should answer calls on this number.
6. Save the phone number.

You can also save custom phone numbers without immediately assigning them to a voice agent. Without an assignment, the phone number is not actively routed to an agent.

## Setting up the outbound connection

For outbound BYOS calls and warm transfers, Miyon AI needs your provider's SIP destination and the appropriate authentication. In the usual mode, you use a username and password. These credentials are not required for the [NFON connection over IP](/docs/en/nfon#5-set-up-outbound-calls).

![Outbound SIP settings](https://mintcdn.com/miyon/k1W2EMCYe3WDkNuH/images/byos-sip-outbound-settings.png?fit=max\&auto=format\&n=k1W2EMCYe3WDkNuH\&q=85\&s=e700cbd6207958a6c07fc080c28e4a39)

The most important fields are:

* **Termination URL**: your provider's SIP domain or IP address, for example `example.pstn.sip-provider.com`.
* **Username** and **Password**: SIP credentials, if your provider uses credential-based authentication.
* **IP authentication (no password)**: for the NFON connection documented here. This setting also applies to Inbound.
* **Advanced → User-Agent (optional)**: only change it if your provider requires a specific value. For NFON, see the [stored User-Agent association](/docs/en/nfon#set-the-user-agent-before-the-first-call).

> [!NOTE]
>
> The inbound SIP address and the outbound termination URL are different things. The inbound SIP address points to Miyon AI. The termination URL points to your SIP provider.

## Outbound calls with your own phone number

If you want to start outbound calls via your own SIP provider, first set up the **outbound connection** and then add the phone number that should be shown to the person being called.

1. Activate the outbound SIP connection.
2. Enter your provider's SIP destination and, if required, SIP credentials.
3. Add the phone number under **Custom phone numbers**.
4. Assign this phone number to the voice agent that should handle the outbound calls.
5. Start the call under **Outbound Calls** with that exact voice agent.

For outbound BYOS calls, the voice agent uses the custom phone number assigned to it under **Custom phone numbers**. In this case, you do not need to enter a separate caller number.

## Understanding the status

* **Inbound active**: inbound calls through the configured SIP connection can be processed.
* **Inbound inactive or not set up**: custom phone numbers remain saved, but inbound BYOS calls are not processed through this connection. Existing Miyon phone numbers and standard telephony paths are not affected.
* **Outbound active**: outbound calls and warm transfers can run via your own SIP provider.
* **Outbound not set up**: outbound BYOS calls are not active. Existing Miyon phone numbers and standard telephony paths are not affected.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.