---
title: "Connect 3CX to Cloud SIP"
url: "https://enfonica.com/help/3cx/connect-3cx-cloud-sip"
summary: "Add Enfonica in 3CX as a Generic SIP Trunk (IP Based), with your SIP domain as the registrar and authentication set to \"Do not require - IP based\". Enter your DIDs and caller IDs in +E.164. Then send your numbers to 3CX through a load balancer in the Enfonica Console."
type: how-to
audience: everyone
products: ["Cloud SIP", "Phone Numbers"]
works_with: ["3CX v20"]
who_can_do_this: "Whoever manages your 3CX and your Enfonica project"
---

# Connect 3CX to Cloud SIP

**Short answer:** Add Enfonica in 3CX as a Generic SIP Trunk (IP Based), with your SIP domain as the registrar and authentication set to "Do not require - IP based". Enter your DIDs and caller IDs in +E.164. Then send your numbers to 3CX through a load balancer in the Enfonica Console.

**Applies to:** Cloud SIP, Phone Numbers  
**Works with:** 3CX v20  
**Who can do this:** Whoever manages your 3CX and your Enfonica project

## Before you start

- An Enfonica project with the phone numbers you want 3CX to use.
- Admin access to your 3CX system.
- Your 3CX system's public IP address and its hostname, for example example.3cx.com.au.
- Access to the firewall in front of 3CX, or the person who manages it.

## How 3CX connects to Cloud SIP

You set up 3CX in two places:

- **The Enfonica Console**. You create a SIP domain, which is your SIP trunk, and tell your phone numbers where 3CX is.
- **3CX**. You add that SIP domain as a trunk, and set the numbers it sends.

3CX doesn't register to Cloud SIP. Cloud SIP recognizes your calls by the SIP domain in each call, your 3CX's IP address, and, if you add one, a username and password.

> **Note:** If Enfonica hosts your 3CX, we connect the trunk when we set up your system, so you don't need to do anything here. To change a trunk setting, contact support. If 3CX, a cloud provider, or your MSP hosts it, the steps in this guide are the same. Whoever manages its firewall makes the firewall change.

## Create your SIP domain

1. Sign in to the [Enfonica Console](https://console.enfonica.com/), and open your project.
2. Go to **Cloud SIP**, and select **New SIP domain**.
3. For **Type**, select **Standard**.
4. Enter a **SIP domain ID**, such as `acme-3cx`, and complete the steps to create the SIP domain. It's ready instantly, with a name like `acme-3cx.sip.enfonica.com`.
5. Under **Termination settings**, set **Call termination mode** to **PSTN Trunk**, so that outgoing calls go to the phone network.
6. Under **IP access control list**, select **Add IP range**, and enter your 3CX's public IP address with `/32` on the end, for example `203.0.113.10/32`.
7. To also use a password on the trunk, under **Users**, select **Add user**, and create a username and password. Every call must then come from your IP address and carry the password.
8. Select **Save Changes**. Changes take up to a minute to apply.

Your SIP domain's name is shown at the top of its page, next to **SIP domain**, with a copy button. You'll enter it in 3CX next.

## Add the trunk in 3CX

Add the trunk by hand rather than importing a provider template file. 3CX changes its import format between releases, so a template that worked last year can fail with "Incorrect Structure".

1. In 3CX, select **Add Trunk**, and then select **Generic SIP Trunk (IP Based)**.
2. Set **Registrar/Server** to your SIP domain, for example `acme-3cx.sip.enfonica.com`. Use the name rather than an IP address, because Cloud SIP identifies your trunk by the domain in each call.
3. Leave **Outbound Proxy** empty.
4. Set **Type of authentication** to **Do not require - IP based**. Despite the name, 3CX still sends a username and password when Cloud SIP asks for one.
5. If you created a user, enter its username and password as the **Authentication ID** and **Authentication password**. If you didn't, leave both empty.
6. Set **Main Trunk No** to your main Enfonica number in +E.164 (full international format with a plus), for example `+61255501234`.
7. In the trunk's codec list, remove everything except **PCMA** (G.711 A-law). Cloud SIP also accepts PCMU and G.729, but not wideband codecs, such as Opus or G.722. Listing wideband codecs on the trunk only makes 3CX convert the audio of every call, which adds load to the PBX.
8. On the **DIDs** tab, add every Enfonica number that should ring this 3CX, in +E.164, for example `+61255501234`.
9. Save the trunk.
10. Create an inbound rule for each DID, so that 3CX knows which extension, queue, or menu it rings.

The plus matters on DIDs. Cloud SIP sends the number that was called in +E.164, and 3CX matches it exactly. A DID entered as `0255501234` doesn't match, and 3CX rejects the call with 404 Not Found.

## Set caller IDs and outbound rules

These two settings decide whether Cloud SIP accepts your outbound calls. Each call needs a real number you hold as its caller ID, and a dialed number that Cloud SIP can read.

1. Go to **Users**, and select each user in turn. Set their **Outbound Caller ID** to a number in your Enfonica project, in +E.164, for example `+61255501234`. A number missing its area code, or a name, is refused with 484 Address Incomplete.
2. Go to **Outbound Rules**, and add a rule that sends calls to the Enfonica trunk.
3. Set **Calls to numbers starting with prefix** to `0-9,+`, so that the rule matches every number. Leave it stripping no digits and prepending nothing.
4. Add a rule above it for international calls. Set its prefix to `0011`, strip 4 digits, and prepend `+`. A call to `0011 64 9 xxx xxxx` then leaves as `+649xxxxxxx`. 3CX uses the first rule that matches, so keep this rule at the top.

Cloud SIP converts Australian numbers dialed the usual way, such as `0255501234` or a 1300 number, to +E.164 itself. Your rules don't need to rewrite them. If your rules do rewrite them, check them against this table. It lists the rewrites that we see go wrong most often.

| What the rule does | What reaches Cloud SIP | What happens |
| --- | --- | --- |
| Prepends `+61` without stripping the leading 0 | `+610491570156` | Refused with 484 Address Incomplete |
| Strips the first digit and prepends `+61` on 13, 1300, or 1800 numbers | `+61300975707` | The wrong number is dialed, and the call fails |
| Passes `0011` through on international calls | `0011649xxxxxxx` | Refused with 484 Address Incomplete |

A rule that prepends `+61` must strip exactly one digit, the leading 0. No rule should strip the 1 from the start of 13, 1300, and 1800 numbers. For every format, with examples, see [Which number format should my PBX use?](https://enfonica.com/help/sip-trunking/number-formats)

## Allow Enfonica through your firewall and 3CX's blacklist

Cloud SIP sends call signaling and call audio from different addresses. In the firewall in front of 3CX, allow all four addresses in both directions.

| Traffic | IP addresses | Ports |
| --- | --- | --- |
| Signaling | `34.87.239.197`<br>`34.87.254.143` | 5060 (UDP), 5061 (TLS) |
| Media (call audio) | `35.189.19.106`<br>`35.189.6.179` | All UDP ports |

3CX also keeps its own IP blacklist. It adds addresses automatically when it sees what looks like failed authentication or a flood of SIP traffic. If it blocks Enfonica, incoming calls stop arriving and outgoing calls hang, even though nobody changed anything.

To keep Enfonica off the blacklist:

1. In 3CX, under **Security**, open the **IP Blacklist**. If either signaling address is listed, remove it.
2. Add both signaling addresses to 3CX's IP whitelist, so that they're never blocked again.

## Send incoming calls to 3CX

Because 3CX doesn't register, you need to tell Cloud SIP where 3CX is. Create a load balancer once, and then point each number at it.

1. In the Console, go to **Cloud SIP**, and open your SIP domain.
2. Under **Load balancers**, select **Add load balancer**, and enter an **Alias ID**, such as `3cx`.
3. Select **Add endpoint**.
4. In **Endpoint URI**, after the `sip:` that's already shown, enter your 3CX's hostname, for example `example.3cx.com.au`. Calls go to UDP port 5060 unless you add another port.
5. Select **Add**, select **Save**, and then select **Save Changes**.
6. Go to **Phone Numbers > My numbers**, and open a number.
7. Under **Call settings**, in **Incoming call handlers**, select **Add**, and then select **SIP**.
8. Select **Load balancer**, and then select your load balancer, listed as `3cx@acme-3cx.sip.enfonica.com`.
9. Select **Save Changes**.

Repeat steps 6 to 9 for each number.

## Check that it worked

1. Call a mobile from a 3CX extension. The mobile rings and shows that user's outbound caller ID.
2. Call one of your Enfonica numbers from a mobile. It rings in 3CX, and you can hear each other both ways.
3. In the Console, go to **Cloud Voice > Calls**. Both test calls are listed there with their SIP traces.

If a test call fails, its SIP response code points to the cause. To find the code, see [Find a call and read its SIP trace](https://enfonica.com/help/call-troubleshooting/find-call-sip-trace). To learn what each code means, see [Outbound calls aren't going through](https://enfonica.com/help/call-troubleshooting/outbound-calls-fail).

## Questions

### Why does 3CX say registration failed, or 405 Method not allowed?

The trunk's **Type of authentication** is set to a registration option, so 3CX is trying to register. Cloud SIP doesn't support SIP registration, and answers with `405 Method not allowed`. Set **Type of authentication** to **Do not require - IP based**, and keep the username and password in place. Calls are still authenticated.

### Why do outbound calls fail with 403 Forbidden?

Cloud SIP didn't recognize the call as yours. It's almost always the **Registrar/Server** value, a public IP address missing from the IP access control list, or the username and password. For each cause and its fix, see [SIP 403 Forbidden on outbound calls](https://enfonica.com/help/sip-errors/403-forbidden).

### Can 3CX make private (withheld) calls?

Yes, with your real number as the caller ID. The phone network always carries a number, even on a private call, and marks it as private. 3CX sends your number with the header `Privacy: id`, and the person you call sees a private number. If you set the caller ID to "anonymous" in 3CX, the call is refused with 484 Address Incomplete instead. To learn about the options, see [Caller ID problems](https://enfonica.com/help/caller-id/caller-id-problems#private-calls).

### Can one 3CX use trunks from two Enfonica projects?

Yes. Add each project's SIP domain as its own trunk in 3CX. Calls are billed to the project whose trunk they go out on. To send each company's calls out its own trunk, use outbound rules, for example by extension group. You don't need a username and password for this, because each SIP domain has its own name.

### Can I send and receive SMS in 3CX?

Yes, with an Enfonica mobile number. To learn how to set it up, see [Send and receive SMS in 3CX](https://enfonica.com/help/sms/sms-in-3cx).

## What to send us

Include these and we can find the call straight away.

- The number that made the call and the number it called, in full international format (for example +61255501234).
- The date and time of the call, with your timezone.
- Whether the call was inbound or outbound.
- The call ID, if the Console shows the call.
- What happened: an error message, silence, a busy tone or a dropped call.

[Contact support](https://enfonica.com/contact-support?article=%2Fhelp%2F3cx%2Fconnect-3cx-cloud-sip&topic=call-fault)

## Related

- [Send and receive SMS in 3CX](https://enfonica.com/help/sms/sms-in-3cx.md)
- [Which number format should my PBX use?](https://enfonica.com/help/sip-trunking/number-formats.md)
- [Caller ID problems: wrong number, private calls, rejected, or spam](https://enfonica.com/help/caller-id/caller-id-problems.md)
- [Calls aren't reaching your PBX](https://enfonica.com/help/call-troubleshooting/inbound-calls-not-arriving.md)
- [Outbound calls aren't going through](https://enfonica.com/help/call-troubleshooting/outbound-calls-fail.md)
- [Firewall configuration for Cloud SIP (docs)](https://enfonica.com/docs/cloud-sip/firewall-configuration/)

---

Web version: https://enfonica.com/help/3cx/connect-3cx-cloud-sip
