How-to guide

Connect your PBX to Cloud SIP

Short answer

Create a SIP domain in the Enfonica Console, and secure it with your PBX's public IP address, a username and password, or both. Point your PBX's trunk at the domain, with registration off and caller IDs in +E.164. Allow Enfonica through your firewall, and then send your numbers to the PBX through a load balancer.

Applies to
Cloud SIP, Phone Numbers
Works with
Any SIP PBX or SBC
Who can do this
Whoever manages your PBX and your Enfonica project
On this page
  1. Before you start
  2. Is there a guide for your phone system?
  3. How Cloud SIP connects to your PBX
  4. Create your SIP domain
  5. Secure your SIP domain
  6. Allow Enfonica through your firewall
  7. Point your PBX's trunk at Cloud SIP
  8. Send incoming calls to your PBX
  9. Check that it worked
  10. Questions
  11. What to send us
  12. Related

Before you start

  • An Enfonica project with the phone numbers your PBX will use.
  • A PBX or SBC that can use a SIP trunk without registering, often called an IP-based or peer trunk.
  • A static public IP address for your PBX, or a dynamic DNS hostname that always points to it.
  • Access to the firewall in front of your PBX, or the person who manages it.

Is there a guide for your phone system?

These systems have their own guide, with every field named the way that system names it:

For any other SIP PBX (phone system) or SBC (session border controller), use this guide.

How Cloud SIP connects to your PBX

Cloud SIP is a SIP trunk without registration. Your PBX sends outgoing calls to your SIP domain. Cloud SIP recognizes them by the domain in each call, your PBX's public IP address, and, if you add one, a username and password.

Because your PBX doesn't register, Cloud SIP can't learn where it is. You tell it once, with a load balancer. Incoming calls to your numbers then go to that address.

Create your SIP domain

A SIP domain is your trunk. It's ready instantly when you create it, with its own name in the format <name>.sip.enfonica.com.

  1. Sign in to the Enfonica Console, 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, and complete the steps to create the SIP domain.
  5. Under Termination settings, set Call termination mode to PSTN Trunk, so that outgoing calls go to the phone network.

Secure your SIP domain

Choose how Cloud SIP knows that a call really comes from your PBX. You can use either method, or both:

  • IP access control list. Under IP access control list, select Add IP range, and enter your PBX's public IP address in CIDR notation, for example 203.0.113.10/32. Only devices in the networks you list can make calls.
  • Users. Under Users, select Add user, and create a username and password. Every call must then authenticate with them.

Changes take up to a minute to apply after you select Save Changes.

Using both is the most secure setup. A call must then come from a listed network and also carry the password. If the system that sends calls is a cloud platform whose IP addresses change, use a user only. A call from an unlisted address is refused before its password is checked.

A SIP domain with no IP access control list and no users can't make outgoing calls. The calls fail with 403 Forbidden. For more information, see SIP 403 Forbidden on outbound calls.

Allow Enfonica through your firewall

Your firewall must accept call signaling and call audio from Enfonica's Sydney edge. They come from different addresses, so allow all four addresses in both directions.

TrafficIP addressesPorts
Signaling34.87.239.197
34.87.254.143
5060 (UDP), 5061 (TLS)
Media (call audio)35.189.19.106
35.189.6.179
All UDP ports

If you use UDP, also allow fragmented UDP packets, if your firewall can. Long SIP messages are split into fragments, and only the first fragment carries the port number. A port-based rule can drop the rest.

Many PBXs also block addresses automatically when they see a lot of SIP traffic or failed authentication. Add both signaling addresses to your PBX's allow list or whitelist, so that they're never blocked.

Point your PBX's trunk at Cloud SIP

In your PBX, add a SIP trunk with these settings. Some systems call it a SIP provider, peer, or gateway. The caller ID step matters most, because an invalid caller ID is the most common reason that a new trunk's calls are refused.

  1. Set the host, server, or registrar to your SIP domain, for example acme.sip.enfonica.com. Use the name rather than an IP address. Leave any outbound proxy setting empty.
  2. Use UDP on port 5060, or TLS on port 5061. Plain TCP isn't supported. UDP is the simplest place to start.
  3. Turn registration off. If your PBX asks, choose a trunk type that makes calls without registering.
  4. If you created a user, enter its username and password as the trunk's authentication. Enter the username on its own, such as pbx1, not pbx1@acme.sip.enfonica.com.
  5. Allow G.711 A-law (PCMA), G.711 u-law (PCMU), or G.729, the codecs that Cloud SIP supports. Leave wideband codecs, such as Opus or G.722, off the trunk. They only make the PBX convert the audio of every call.
  6. Set each extension's outbound caller ID, or the trunk's default caller ID, to a number in your Enfonica project in +E.164 (full international format with a plus), for example +61255501234. A name, a username, or a number missing its area code is refused with 484 Address Incomplete.
  7. Send the numbers your users dial in +E.164, for example +61491570156. National format, such as 0491570156, also works, because Cloud SIP converts it using Australia as your home country. Never send the 0011 international prefix.

For every format that Cloud SIP accepts, with examples, including 13, 1300, and 1800 numbers, see Which number format should my PBX use?

Send incoming calls to your PBX

Create a load balancer that knows your PBX's address, 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 pbx.
  3. Select Add endpoint.
  4. In Endpoint URI, after the sip: that's already shown, enter your PBX's public hostname or IPv4 address, for example pbx.example.com. IPv6 addresses aren't supported. Calls use UDP on port 5060 unless you add a port. For TLS on port 5061, add ;transport=tls.
  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 pbx@acme.sip.enfonica.com.
  9. Select Save Changes.
  10. Repeat steps 6 to 9 for each number.
  11. In your PBX, add each number as a DID (direct inward dialing number) or inbound route in +E.164, for example +61255501234, exactly as Cloud SIP sends it.

If your PBX can't accept a plus sign, set the number that Cloud SIP sends instead. For the number's handler, select SIP URI rather than Load balancer, and add a to header, for example sip:pbx@acme.sip.enfonica.com?to=0255501234.

To share calls across several PBXs or sites, with failover, see Send incoming calls to more than one PBX or site.

Check that it worked

  1. Call a mobile from an extension on your PBX. The mobile rings and shows the caller ID your PBX sent.
  2. Call one of your Enfonica numbers from a mobile. It rings on your PBX, 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 learn what each code means, see Outbound calls aren't going through. For incoming calls, see Calls aren't reaching your PBX.

Questions

Can my PBX, phones, or ATA register to Cloud SIP?

No. Cloud SIP is a SIP trunk, not a registrar. SIP REGISTER isn't supported on any SIP domain, and is answered with 405 Method not allowed. There's no setting to turn it on. Adding a username and password doesn't change this. The trunk stays IP-based and still uses a load balancer for incoming calls.

Desk phones, softphones, and ATAs (analog telephone adapters) register to a PBX, and the PBX connects to Cloud SIP. The PBX can be cloud-hosted. For more information, see SIP 405 Method Not Allowed.

Do call transfers work?

Yes, when your PBX makes the transfer itself, which most PBXs do. Cloud SIP doesn't accept SIP REFER, so a PBX or platform that asks the trunk to transfer a call gets 405 Method not allowed. Choose a transfer type that bridges the two calls in your own system, such as a conference transfer.

My PBX has a dynamic IP address or sits behind NAT. Will it work?

Outgoing calls work with a username and password and no IP access control list, even when the IP address changes. Incoming calls need an address that always reaches your PBX from the internet. Give the load balancer a dynamic DNS hostname that follows your IP address.

If you can, host the PBX in the cloud with a static IP address, and let your phones connect to it. It's simpler to run.

Does Cloud SIP support encrypted calls?

Yes. Cloud SIP supports SIP over TLS on port 5061, and SRTP for encrypted call audio, either optional or required.

Where is Cloud SIP available?

Cloud SIP is available in Australia and New Zealand, through Enfonica's Sydney edge.

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

Our support team are telco specialists, backed by the engineers who run the network.