๐ง How to Setup SIP Trunk in 3CX: Step-by-Step Guide
Summary: Setting up a SIP trunk in 3CX is straightforward when you follow the right steps. This comprehensive guide walks you through the entire process โ from preparing your provider details and adding the trunk, to configuring inbound/outbound rules and troubleshooting common issues. Whether you're using a supported provider or a generic SIP carrier, you'll have your 3CX system making and receiving calls in no time.
๐ Table of Contents
๐ Prerequisites & Preparation
Before you begin setting up your SIP trunk in 3CX, make sure you have the following:
โ What You Need
- 3CX PBX installed and running (on-premises or cloud)
- Administrative access to the 3CX Management Console
- A SIP trunk account from a provider (e.g., NetviaVoice, Telnyx, Twilio)
- Provider credentials (hostname, username, password) or IP whitelist
- At least one DID (Direct Inward Dialing) number assigned to your trunk
- Firewall ports open: UDP/TCP 5060 (SIP), UDP 9000-10999 (RTP)
- Static public IP or dynamic DNS (if using IP-based authentication)
๐ Important Checks
- Firewall: Ensure your firewall allows SIP and RTP traffic. 3CX's firewall checker (under Dashboard) can help.
- NAT: If your PBX is behind NAT, configure STUN or set the external IP correctly.
- Provider Compatibility: Check if your provider is in 3CX's supported list. If not, use the "Generic VoIP Provider" option.
- DID Numbers: Have your DID(s) ready โ you'll need them for inbound routing.
๐ Gather Your SIP Provider Details
Your SIP provider will give you the following information. Keep these handy:
| Parameter | Description | Example |
|---|---|---|
| Provider Name | The name of your SIP trunk provider | NetviaVoice, Telnyx, Twilio |
| Hostname / Domain | The SIP server address for registration | sip.netviavoice.com |
| Username | Your account username (for registration-based trunks) | user12345 |
| Password | Your account password (for registration-based trunks) | โขโขโขโขโขโขโขโข |
| Authentication Type | Registration-based or IP-based | Register / IP Auth |
| DID Numbers | Your assigned Direct Inward Dialing numbers | +1 212 555 1234 |
๐ก Pro Tip: If you're using NetviaVoice as your provider, we provide all these details in your welcome email. For IP-based authentication, you'll need to whitelist your 3CX server's public IP address.
โ Step 1: Add SIP Trunk in 3CX
Follow these steps to add your SIP trunk to the 3CX Management Console:
- 1 Log in to the 3CX Management Console as an administrator.
- 2 Navigate to Voice & Chat โ SIP Trunks.
- 3 Click the "Add SIP Trunk" button.
- 4 Under the "Select Country" dropdown, choose your country. Then select your provider from the list. If your provider isn't listed, choose "Generic VoIP Provider".
- 5 In the "General" tab:
- Trunk Name: Enter a descriptive name (e.g., "NetviaVoice SIP Trunk").
- DID Numbers: Enter your assigned DID(s), one per line.
- Provider Hostname / IP: Enter the SIP server address from your provider.
- 6 In the "Authentication" tab:
- Type: Choose "Register" if you have a username/password, or "IP Based" if your provider whitelists your IP.
- For "Register" mode: enter your Username and Password.
- For "IP Based" mode: no credentials needed.
- 7 Click "OK" to save the trunk. 3CX will attempt to register with your provider.
๐ก Quick Tip: After adding the trunk, check the status in the SIP Trunks list. A green checkmark indicates successful registration. If you see an error, check the Activity Log for details.
๐ Step 2: Configure Inbound Rules
Inbound rules tell 3CX what to do when a call comes in on your DID number. Here's how to set them up:
- 1 Go to Voice & Chat โ Inbound Rules.
- 2 Click "Add Inbound Rule".
- 3 In the "General" section:
- Rule Name: Give it a descriptive name (e.g., "Main Line").
- DID / DDI: Enter the DID number that this rule applies to.
- Trunk: Select the SIP trunk you just added.
- 4 In the "Destination" section:
- Destination Type: Choose where to route the call โ Extension, Ring Group, IVR, Queue, or Voicemail.
- Destination: Select the specific extension, group, or queue.
- 5 Click "OK" to save the rule.
๐น Example Inbound Rule
- Rule Name: Sales Line
- DID: +1 212 555 1000
- Trunk: NetviaVoice SIP Trunk
- Destination: Sales Ring Group (extensions 101, 102, 103)
๐น Multiple DIDs
If you have multiple DIDs, create a separate inbound rule for each one. This allows you to route calls from different numbers to different departments or extensions.
๐ค Step 3: Configure Outbound Rules
Outbound rules define how calls made from internal extensions are routed to the outside world via your SIP trunk.
- 1 Go to Voice & Chat โ Outbound Rules.
- 2 Click "Add Outbound Rule".
- 3 In the "General" section:
- Rule Name: Give it a name (e.g., "Local Calls").
- Dial Patterns: Define the number patterns this rule applies to (e.g., "1" for US/Canada numbers, "0" for international).
- Trunk: Select your SIP trunk.
- 4 In the "Options" section, you can set:
- Strip Digits: Remove digits before sending (e.g., strip the "9" if users dial 9 to get an outside line).
- Prepend Digits: Add digits to the number before sending.
- 5 Click "OK" to save the rule.
| Dial Pattern | Description | Example |
|---|---|---|
| 1 (NXX) NXX XXXX | US/Canada 10-digit numbers (area code + 7 digits) | 1 212 555 1234 |
| 011 (X) | International calls (011 + country code + number) | 011 44 20 1234 5678 |
| 9 (1XXXXXXXXXX) | User dials 9 first to get a line, then US number | 9 1 212 555 1234 |
๐งช Step 4: Test Your SIP Trunk
After configuring your trunk and rules, it's time to test:
๐ Inbound Test
- Dial your DID number from an external phone (mobile or landline).
- Check if the call reaches the destination you set in the inbound rule.
- Verify caller ID display and audio quality.
๐ค Outbound Test
- Dial an external number from any extension in your 3CX system.
- Confirm the call connects and audio works both ways.
- Check that the correct outbound rule is applied.
โ ๏ธ Note: If you're testing with a provider that charges per minute, be mindful of test call durations to avoid unexpected charges.
๐ง Common Issues & Troubleshooting
| Issue | Possible Cause | Solution |
|---|---|---|
| Trunk not registering | Incorrect username/password, firewall blocking SIP, wrong hostname | Double-check credentials. Run 3CX Firewall Checker. Verify hostname is correct. |
| Inbound calls not reaching extensions | DID not configured correctly, inbound rule missing or misconfigured | Verify DID number in trunk and inbound rule. Check that the trunk is assigned to the rule. |
| Outbound calls fail | Dial pattern mismatch, outbound rule not assigned to correct trunk | Review dial patterns. Ensure trunk is selected in the outbound rule. |
| Audio issues (one-way or no audio) | Firewall blocking RTP ports, NAT issues | Open RTP ports (9000-10999). Configure STUN or set external IP. |
| Call quality problems | Bandwidth issues, codec mismatch | Check internet speed. Ensure codec preferences align with provider. |
๐ก Quick Troubleshooting: Always check the Activity Log in 3CX (under Dashboard โ Activity Log) for detailed error messages. This is the best place to start when diagnosing issues.
โ๏ธ SIP Trunk Setup Options Comparison
| Feature | Registration-Based | IP-Based |
|---|---|---|
| Authentication | Username + Password | IP Address Whitelist |
| Provider Requirement | SIP registrar server | Static public IP needed |
| Setup Complexity | Simple โ just enter credentials | Requires IP configuration |
| Security | Password-based | IP-based (more secure) |
| Best For | Dynamic IP environments, most users | Static IP, enterprise deployments |
๐ Need Help Setting Up Your SIP Trunk? NetviaVoice Has You Covered
Our team of experts can help you configure your 3CX SIP trunk, troubleshoot issues, and optimize your phone system for crystal-clear voice quality.
Visit NetviaVoiceโ Frequently Asked Questions
In the 3CX Management Console, go to Voice & Chat โ SIP Trunks. Click 'Add SIP Trunk', select your country and provider (or Generic VoIP Provider), then fill in the authentication details provided by your carrier (hostname, username, password, and DID numbers). Click 'OK' to save.
3CX supports a wide range of providers including Telnyx, Twilio, Flowroute, Bandwidth, and many local providers. You can also use the 'Generic VoIP Provider' option for any SIP carrier that supports standard SIP registration or IP-based authentication.
Registration-based trunks require a username and password to authenticate with the provider's SIP server. IP-based trunks authenticate using your public IP address โ the provider whitelists your IP, and you don't need credentials. 3CX supports both.
After adding the trunk, go to Voice & Chat โ Inbound Rules. Create a new rule, set the DID/DDI number (the incoming number), and select the destination โ extension, ring group, IVR, or queue. Save the rule and test by calling your DID number.
Common causes: incorrect username/password, wrong SIP port (default is 5060), firewall blocking SIP traffic, or IP address not whitelisted by provider. Check the 3CX Activity Log for error messages. Also verify that your PBX can reach the provider's SIP server via ping or traceroute.
๐ Related Articles & Resources (NetviaVoice)
Explore more guides to optimize your business communication:
โจ For personalized assistance with 3CX setup, SIP trunk configuration, or any VoIP needs, visit our Services page or contact our team directly.
๐ข Ready to set up your SIP trunk in 3CX? Let NetviaVoice help you get started today.