VoIP & Infrastructure

How to Set Up a SIP Trunk:
Step-by-Step Configuration Guide (2026)

By My Call Connect • 8 min read

SIP trunking connects your phone system to the public switched telephone network (PSTN) over the internet, replacing traditional physical phone lines. Setting up a SIP trunk involves configuring your IP-PBX or cloud phone platform to register with your carrier, authenticate, and correctly route inbound and outbound calls. This guide walks through every step — from prerequisites to testing — along with the most common issues and how to fix them.

Note: specific menu paths and interface details vary by platform. Use this guide as a framework, then consult your platform's documentation for exact steps.

Before You Start: What You Need

Before configuring anything, confirm you have the following in place:

  • A compatible IP-PBX or phone system. SIP trunking works with any platform that supports the SIP protocol: Asterisk, FreePBX, 3CX, Cisco CUCM, hosted UCaaS platforms, and most modern cloud phone systems. Older analogue or TDM PBX systems require an Analogue Telephone Adapter (ATA) or gateway.
  • A stable internet connection. SIP trunking is sensitive to latency and packet loss. As a rough guideline, allow approximately 85 kbps of bandwidth per concurrent call when using the G.711 codec (uncompressed). Factor this into your connection capacity — a 10-concurrent-call deployment needs roughly 850 kbps reserved for voice traffic in each direction.
  • A SIP trunk provider account. You'll need an active account with a SIP trunk carrier and the credentials they issue (server address, username, password, or IP authentication details).
  • DID numbers assigned to the trunk. Your carrier will assign Direct Inward Dial (DID) numbers to your account. These are the numbers callers will dial to reach your system. Confirm which DIDs are assigned before configuring inbound routes.
  • Firewall and NAT access. The majority of SIP setup problems are caused by firewalls blocking SIP or RTP traffic, or NAT translating addresses incorrectly. You'll need access to your firewall configuration to open the required ports. The key ports are UDP 5060 for SIP signalling and the RTP port range (typically UDP 10000–20000) for audio. If your PBX sits behind NAT, your platform needs to be configured to handle NAT correctly — most modern platforms have a NAT settings section for this purpose.

Step 1: Choose a SIP Trunk Provider

Not all SIP trunk providers are equivalent. When evaluating providers, consider:

  • Registered OCN (Operating Company Number). An OCN is required for STIR/SHAKEN attestation level A — the highest level, which signals to receiving carriers that the calling number has been verified. Providers without a registered OCN can only achieve attestation levels B or C, which may cause calls to be flagged as potential spam on modern carrier networks.
  • Codec support. Confirm the provider supports the codecs your platform uses. G.711 (ulaw/alaw) is the standard uncompressed codec and is universally supported. G.729 is a compressed codec that reduces bandwidth per call but requires a licence on some platforms. Confirm codec compatibility before provisioning.
  • Authentication method. Some providers support IP authentication only (your public IP is whitelisted); others support username/password (SIP digest) authentication; some support both. If your connection uses a dynamic IP address, you need a provider that supports username/password authentication.
  • Channel limits. SIP trunks have a maximum number of simultaneous calls (channels). Confirm the channel limit covers your peak concurrent call volume, and that the provider's process for increasing channels is straightforward.
  • Geographic coverage. If you need DID numbers in specific cities, states, or countries, confirm the provider has inventory in those locations before signing up.

MCC's wholesale voice service provides SIP trunking with STIR/SHAKEN support. See: Wholesale Voice.

Step 2: Gather Your SIP Credentials

Once your provider account is active and DIDs are assigned, collect the following information from your provider's portal or welcome documentation before touching your PBX:

  • SIP server hostname or IP address. This is the address your PBX will register with or send calls to — for example, sip.yourprovider.com or a specific IP address.
  • SIP port. Default is 5060 for UDP or TCP transport. If your provider uses TLS encryption, the port is typically 5061. Confirm which transport your provider requires.
  • Username and password (for digest authentication), or IP authentication whitelist instructions (for IP-based authentication). Note: some providers call the username the "trunk username", "SIP user", or "account ID" — check their documentation for the correct label.
  • Assigned DID numbers. You'll need these when configuring inbound routes.
  • Codec preference. Confirm whether the provider requires G.711 or accepts G.729, and whether ulaw or alaw is preferred (ulaw is standard in North America; alaw is standard in Europe).
  • DTMF mode. RFC 2833 is the recommended DTMF mode for SIP trunks and is supported by virtually all modern carriers. Confirm this with your provider — a mismatch between your PBX's DTMF mode and the carrier's will cause IVR keypresses to fail.

Step 3: Configure Your IP-PBX or Phone System

The generic configuration steps below apply to most SIP-capable platforms. Exact menu paths differ by platform — Asterisk/FreePBX uses Connectivity → Trunks → Add SIP (chan_pjsip) Trunk; 3CX uses SIP Trunks → Add SIP Trunk → Generic; hosted UCaaS platforms typically have a Trunks or Carriers section in the admin portal.

  1. Create a new SIP trunk. In your platform's admin interface, navigate to the trunks or carriers section and create a new SIP trunk entry.
  2. Enter the SIP server hostname or IP. Use the value from your provider credentials. If your provider supplied a hostname (e.g. sip.provider.com), use the hostname rather than resolving it to an IP — this allows DNS-based failover to work correctly.
  3. Enter authentication credentials. For username/password authentication, enter the SIP username and password exactly as provided. For IP authentication, ensure your PBX's public IP address matches what you registered with your provider, and set the trunk to send calls without authentication headers.
  4. Set codecs in order of preference. Place your preferred codec first. If G.711 ulaw is preferred, put ulaw first, followed by alaw and any other supported codecs. Remove codecs your provider does not support from the list.
  5. Set DTMF mode to RFC 2833. This should be the default on most modern platforms, but verify it in the trunk settings.
  6. Configure an inbound route. Create an inbound route that maps each DID number to a destination — an extension, ring group, call queue, or auto attendant. The DID number should match exactly what appears in your provider's portal (including or excluding country code, depending on how your platform expects it — check your platform's documentation).
  7. Configure an outbound route. Create an outbound route with a dial pattern that covers the numbers your users will dial (e.g. 10-digit numbers, 11-digit numbers with leading 1, international numbers). Assign the SIP trunk as the route's trunk in order of priority. If you have multiple trunks, configure failover order here.

For detailed platform-specific instructions: What Is SIP Trunking? and SIP Trunking vs PRI.

Step 4: Test Inbound and Outbound Calls

After saving your configuration, test every call path before routing live traffic:

  • Outbound call test. Dial an external number from an extension on your system. Verify the call connects and that audio is clear in both directions. Check that your outbound caller ID displays as expected on the receiving end.
  • Inbound call test. Call one of your DID numbers from an external mobile or landline. Verify the call routes to the correct destination (extension, queue, or auto attendant) and that audio is clear.
  • DTMF test. If you have an IVR or auto attendant, call in and test keypad input. Press digits and verify they register correctly. DTMF failures at this stage typically indicate a mode mismatch between your PBX and the carrier.
  • Failover test. If you have configured multiple trunks for failover, simulate a primary trunk failure (by temporarily disabling it) and verify calls route over the secondary trunk.

Test from a network outside your office as well as from inside — NAT issues sometimes only appear when calling from an external network.

Troubleshooting Common SIP Setup Issues

The table below covers the most frequent issues encountered during SIP trunk setup:

Problem Likely Cause Fix
No registration / trunk offline Incorrect credentials, wrong SIP server address, or firewall blocking UDP 5060 Verify credentials and server address exactly as provided. Confirm UDP 5060 is open outbound and inbound in your firewall.
One-way audio Firewall or NAT blocking RTP media traffic Open the RTP port range (typically UDP 10000–20000) in your firewall. Enable NAT traversal settings in your PBX (e.g. externip/externhost in Asterisk, External IP in 3CX).
Calls drop after ~30 seconds Missing SIP re-INVITE or OPTIONS keep-alive; NAT session timeout expiring Enable SIP keep-alives or qualify options in your trunk configuration. Increase NAT session timeout on your firewall for SIP (many firewalls default to 30 seconds for UDP).
DTMF not working DTMF mode mismatch between PBX and carrier Set DTMF mode to RFC 2833 on both the trunk and extensions. Avoid in-band DTMF with compressed codecs.

If you're still experiencing issues after working through the table above, capture a SIP trace from your PBX (Asterisk: pjsip set logger on; FreePBX: Admin → Asterisk Logfiles; 3CX: Support → SIP Trace) and review the SIP response codes — 401/407 indicates an authentication failure, 403 indicates a permissions issue, 408/503 indicates the server is unreachable.

Frequently Asked Questions

What is needed to set up a SIP trunk?

You need an IP-PBX, UCaaS platform, or softswitch that supports SIP trunking (such as Asterisk, FreePBX, 3CX, or a hosted cloud platform), a stable internet connection, a SIP trunk provider account with credentials, DID numbers assigned to the trunk, and correctly configured firewall and NAT settings. Most SIP issues stem from firewall rules blocking the required UDP ports.

What port does SIP trunking use?

SIP signalling typically uses port 5060 for UDP or TCP transport and port 5061 for TLS (encrypted) connections. Media (RTP audio) uses a separate port range — typically UDP 10000–20000, though the exact range varies by platform. Both the SIP signalling port and the RTP port range must be open in your firewall for calls to work correctly.

Why is my SIP trunk not registering?

The most common causes are incorrect credentials (SIP username or password), the SIP server hostname or IP entered incorrectly, or a firewall blocking outbound UDP 5060. Check the credentials exactly as provided by your carrier, verify the SIP server address, and confirm your firewall permits outbound UDP 5060 and that responses are allowed back in.

Can I use SIP trunking with any phone system?

SIP trunking works with any IP-PBX or phone system that supports the SIP protocol, which includes most modern systems — Asterisk, FreePBX, 3CX, Cisco CUCM, Avaya, and many hosted UCaaS platforms. Older TDM or analogue PBX systems require an Analogue Telephone Adapter (ATA) or gateway to connect to a SIP trunk.

What is the difference between SIP trunk authentication methods?

The two primary methods are IP authentication and username/password (digest) authentication. With IP authentication, your carrier whitelists your public IP address — no credentials are sent with each registration, which simplifies configuration but requires a static public IP. With username/password authentication, your PBX registers with the SIP server using a username and password, which works with dynamic IP addresses. Some carriers support both; check with your provider which method they recommend.