> ## 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.

# 3CX

> Forward calls from your 3CX phone system to a voice agent through your custom SIP connection.

3CX is a supported BYOS setup. The following steps show how to route calls from a **3CX** phone system to Miyon AI. Inbound calls travel from your provider through 3CX to Miyon AI, where a voice agent answers.

```text theme={null}
Caller → your provider → 3CX → Miyon AI → Voice Agent
```

## Requirements

You need administrator access to the 3CX Admin Console and the SIP feature enabled in Miyon AI. In the platform, set up the [inbound SIP trunk](/docs/en/sip-trunk#activating-the-inbound-sip-trunk) and a [custom phone number assigned to an agent](/docs/en/sip-trunk#adding-a-custom-phone-number). Have your personal [SIP address](/docs/en/sip-trunk#sip-address) ready for the trunk configuration.

> [!NOTE]
>
> These steps use an example phone number `+499999999999`, an internal 3CX prefix `999`, and the resulting dial string `999+499999999999`. Replace them with your own values.

## 1. Create a SIP trunk

In the 3CX Admin console, open **Trunks & Chat**, click **+ Trunk**, and choose **Generic SIP Trunk (IP Based)**.

![Creating a generic SIP trunk in 3CX](https://mintcdn.com/miyon/mDX1kWLOqbz7HG5C/images/3cx-trunk-create.png?fit=max\&auto=format\&n=mDX1kWLOqbz7HG5C\&q=85\&s=99e91b8faea954a5261bbe9a0fdb0391)

## 2. Enter the trunk data

* **Main trunk number**: your phone number from Miyon AI, for example `+499999999999`.
* **Authentication type**: **None – IP based**.
* **Registrar/Server**: your personal [SIP address from Miyon AI](/docs/en/sip-trunk#sip-address), **without** the `sip:` prefix:

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

> [!WARNING]
>
> Do not include the `sip:` prefix in the Registrar/Server field. Otherwise Miyon AI responds with `400 Bad Request`.

## 3. Allow calls back to 3CX

In the trunk configuration:

* Enable **Inbound calls** and **Outbound calls**.
* Enable **PBX delivers audio**.
* Enable **Allow carrier-side forwarding (SIP REFER)** if you use transfers.

![Enabling inbound, outbound and SIP REFER on the 3CX trunk](https://mintcdn.com/miyon/E2JYJGxln41OdSpY/images/3cx-trunk-forwarding.png?fit=max\&auto=format\&n=E2JYJGxln41OdSpY\&q=85\&s=0878f3903418187a1d7a37269309d39c)

## 4. Create an outbound rule

Create an outbound rule that sends the internal prefix to the Miyon AI trunk:

1. Set the prefix to `999`.
2. Set **Route 1** to the Miyon AI trunk.
3. Under **Strip digits**, remove the first 3 digits.

![Creating the outbound rule in 3CX](https://mintcdn.com/miyon/mDX1kWLOqbz7HG5C/images/3cx-outbound-rule.png?fit=max\&auto=format\&n=mDX1kWLOqbz7HG5C\&q=85\&s=d155df16e891e38cb480005afd5cde7f)

## 5. Forward the inbound number to Miyon AI

Open the existing 3CX trunk that receives your real phone number.

1. Set the **default route** to **Forward to external number**.
2. Set the external number to `999+499999999999` — the internal prefix followed by your number.

![Forwarding the inbound number via the internal prefix](https://mintcdn.com/miyon/E2JYJGxln41OdSpY/images/3cx-inbound-route.png?fit=max\&auto=format\&n=E2JYJGxln41OdSpY\&q=85\&s=90a353e7c43d33a0ef8143de483c28ec)

## 6. Make a test call

Call the phone number that arrives via 3CX. The call should reach Miyon AI on the assigned voice agent. If it does not, check first:

* Does the outbound rule use prefix `999`, strip `3` digits, and Route 1 to the Miyon AI trunk?
* Does the **Registrar/Server** field contain the SIP address **without** the `sip:` prefix? A `sip:` prefix causes `400 Bad Request`.
* Is the default route of the existing 3CX trunk set to forward to `999+499999999999`? Otherwise the call may land in the 3CX mailbox.
* If 3CX reports *"Call forbidden by administrator"*, allow the country code under **Admin → Advanced → Allowed Country Codes**.
* If **Allowed Source IPs / CIDRs** is set in Miyon AI, allow the public IP address of your 3CX system.
* For transfers to colleagues, use a 3CX extension or ring group as the target first.


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