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
On this page
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.
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
- Sign in to the Enfonica Console, and open your project.
- Go to Cloud SIP, and select New SIP domain.
- For Type, select Standard.
- 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 likeacme-3cx.sip.enfonica.com. - Under Termination settings, set Call termination mode to PSTN Trunk, so that outgoing calls go to the phone network.
- Under IP access control list, select Add IP range, and enter your 3CX's public IP address with
/32on the end, for example203.0.113.10/32. - 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.
- 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".
- In 3CX, select Add Trunk, and then select Generic SIP Trunk (IP Based).
- 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. - Leave Outbound Proxy empty.
- 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.
- If you created a user, enter its username and password as the Authentication ID and Authentication password. If you didn't, leave both empty.
- Set Main Trunk No to your main Enfonica number in +E.164 (full international format with a plus), for example
+61255501234. - 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.
- On the DIDs tab, add every Enfonica number that should ring this 3CX, in +E.164, for example
+61255501234. - Save the trunk.
- 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.
- 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. - Go to Outbound Rules, and add a rule that sends calls to the Enfonica trunk.
- 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. - Add a rule above it for international calls. Set its prefix to
0011, strip 4 digits, and prepend+. A call to0011 64 9 xxx xxxxthen 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?
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.19734.87.254.143 | 5060 (UDP), 5061 (TLS) |
| Media (call audio) | 35.189.19.10635.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:
- In 3CX, under Security, open the IP Blacklist. If either signaling address is listed, remove it.
- 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.
- In the Console, go to Cloud SIP, and open your SIP domain.
- Under Load balancers, select Add load balancer, and enter an Alias ID, such as
3cx. - Select Add endpoint.
- In Endpoint URI, after the
sip:that's already shown, enter your 3CX's hostname, for exampleexample.3cx.com.au. Calls go to UDP port 5060 unless you add another port. - Select Add, select Save, and then select Save Changes.
- Go to Phone Numbers > My numbers, and open a number.
- Under Call settings, in Incoming call handlers, select Add, and then select SIP.
- Select Load balancer, and then select your load balancer, listed as
3cx@acme-3cx.sip.enfonica.com. - Select Save Changes.
Repeat steps 6 to 9 for each number.
Check that it worked
- Call a mobile from a 3CX extension. The mobile rings and shows that user's outbound caller ID.
- Call one of your Enfonica numbers from a mobile. It rings in 3CX, and you can hear each other both ways.
- 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. To learn what each code means, see Outbound calls aren't going through.
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.
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.
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.
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.
Our support team are telco specialists, backed by the engineers who run the network.
Related
Was this helpful?
What was the problem?
Thanks for telling us.