# FreePBX Version 15 PJSIP Trunk Configuration

**Category:** PBX Setup Guides
**URL:** https://www.simtex.com.au/support/kb/pbx-setup-guides/freepbx-version-15-pjsip-trunk-configuration
**Published:** 2020-10-29

Our guide assumes you have already set the server up, and have the web-based GUI ready to go.  If not, grab an ISO image of FreePBX14 from here: FreePBX Distro

## Simtex SIP Trunks from $4.99/month

Business-grade SIP trunking with geo-redundant infrastructure, crystal-clear audio, and Australian-based support. Pay-as-you-go or unlimited plans available.

- [View SIP Trunk Plans](/products/sip-trunks)
- [Contact Sales](/contact)

## Overview

This is a step-by-step guide to configuring a Simtex SIP trunk on **FreePBX 15** using the **PJSIP** (chan_pjsip) channel driver. FreePBX is a widely used, feature-rich graphical interface for Asterisk — [freepbx.org](https://www.freepbx.org/)

This guide assumes you already have FreePBX installed with the web GUI accessible. If not, download the latest 64-bit ISO from the [FreePBX Downloads](https://www.freepbx.org/downloads/) page.

### What you'll need

- Your Simtex account number (e.g. `214XXXXXXX`)
- Your Simtex SIP password
- FreePBX 15 installed and accessible

> **Info:**
> **SIP Servers:**
> - **West Coast (AU):** `siptcp.simtex.com.au`
> - **East Coast (AU):** `siptcpeast.simtex.com.au`
> 
> Choose the server closest to your location. FreePBX supports SRV record resolution — set the port to `0` and it will automatically discover our geo-redundant infrastructure.

> **Warning:**
> **Do not deploy FreePBX with an external IP address.**
> In 99.9% of cases you do not require any ports forwarded on your router or firewall. If you are unsure, [speak to us](/contact) first.

## Step 1 — Enable TCP Transport

Before creating the trunk, you need to enable TCP transport in FreePBX.
1. Go to **Settings &rarr; Asterisk SIP Settings &rarr; SIP Settings [chan_pjsip]** tab
2. Scroll down to **Transports**
3. Click **Yes** on **TCP**
4. Submit and Apply Config

![FreePBX enable TCP transport](https://www.simtex.com.au/uploads/turn_on_tcp_3ffcd34d9f.png)

## Step 2 — Create the SIP Trunk
1. Open the **Connectivity** menu and select **Trunks**

![FreePBX Connectivity menu - select Trunks](https://www.simtex.com.au/uploads/trunk_1_2557fa062d.png)
1. Select **Add SIP (chan_pjsip) Trunk**

![FreePBX Add SIP trunk dropdown](https://www.simtex.com.au/uploads/trunk_2_8bffb60d36.png)
1. Label your SIP trunk and specify the number of channels

![FreePBX SIP trunk general settings](https://www.simtex.com.au/uploads/trunk_3_bb66a8315c.png)

> **Tip:**
> For security, limit the channel count to the number you'll actually need day-to-day. This prevents potential abuse if your system is compromised.

## Step 3 — PJSIP Settings

Click the **PJSIP Settings** tab and configure:

![FreePBX PJSIP Settings tab](https://www.simtex.com.au/uploads/trunk_4_b3b2427ef2.png)

```
`Username:        214XXXXXXX
Secret:          XXXXXXXX
SIP Server:      siptcp.simtex.com.au
SIP Server Port: 0
Transport:       0.0.0.0-tcp`
```

> **Tip:**
> **Port 0 = automatic discovery.** FreePBX's PJSIP driver resolves SRV records when the port is set to `0`, giving you automatic failover across our geo-redundant server farms. Do not set port `5062` here — let SRV handle it.

> **Note:**
> **East Coast?** Replace `siptcp.simtex.com.au` with `siptcpeast.simtex.com.au` in the SIP Server field if your server is located on the East Coast of Australia.

## Step 4 — Advanced Settings

Click the **Advanced** tab and configure:

![FreePBX PJSIP trunk advanced settings](https://www.simtex.com.au/uploads/PJSIP_trunk_advanced_settings_4ed37b20b1.png)

```
`Contact User:    214XXXXXXX (same as username)
From User:       214XXXXXXX (same as username)
Trust RPID/PAI:  Yes
Send RPID/PAI:   Both`
```

![FreePBX PJSIP advanced settings - RPID/PAI](https://www.simtex.com.au/uploads/PJSIP_trunk_advanced_settings2_cfd3f94029.png)

### Codec Settings

Click the **Codec** tab and reorder codecs to have **alaw** first and **ulaw** second:

![FreePBX codec priority settings](https://www.simtex.com.au/uploads/trunk_codec_a6c863e804.png)

## Step 5 — Outbound Routes

Outbound routes tell FreePBX what numbers it's allowed to dial externally and which trunk to use.

> **Info:**
> **Prefix tip:** Configure a prefix (e.g. `0`) for all external calls. This ensures internal extension numbers never overlap with external destinations — a standard practice in Australia.

> **Tip:**
> If you do not wish to make international calls, leave out the `0011` route pattern to prevent unauthorised international dialling.

1. Navigate to **Connectivity &rarr; Outbound Routes &rarr; Add Outbound Route**

![FreePBX Outbound Routes menu](https://www.simtex.com.au/uploads/Outbound_Routes_1_5136843d9c.png)
1. Label your route and select the SIP trunk you created

![FreePBX Outbound Route - trunk selection](https://www.simtex.com.au/uploads/Outbound_Routes_2_bf4733791d.png)
1. Click **Dial Patterns** and configure your routes. The example below accepts a leading `0`, strips it off, then sends the remaining digits to the Simtex trunk.

## Step 6 — Inbound Routes

Inbound routes direct incoming calls to your allocated DIDs. You can route individual numbers to different extensions, ring groups, IVR menus, etc.
1. Navigate to **Connectivity &rarr; Inbound Routes &rarr; Add Incoming Route**

![FreePBX Inbound Routes menu](https://www.simtex.com.au/uploads/Inbound_Routes_1_f2a605a106.png)
1. Create a **catch-all** route first — this handles any DID sent to your system that doesn't have a specific route. Most users point this at a receptionist or main hunt group.

![FreePBX catch-all inbound route](https://www.simtex.com.au/uploads/Inbound_Routes_2_5dd47e06d0.png)
1. Add entries for individual numbers or blocks of numbers. You can use wildcard patterns such as `_618921133XX`

![FreePBX DID-specific inbound route](https://www.simtex.com.au/uploads/Inbound_Routes_3_55ffd421db.png)

> **Note:**
> **When using wildcard patterns, you must prefix with an underscore:** `_618921133XX`

## Step 7 — Disable SIP Guest

As a security hardening step, disable SIP guest access to prevent unauthorised calls:
1. Go to **Settings &rarr; Asterisk SIP Settings**
2. Under **General SIP Settings**, find **Allow SIP Guests**
3. Set to **No**

![FreePBX disable SIP guest access](https://www.simtex.com.au/uploads/disable_sip_guest_1ed175f9a6.png)

> **Warning:**
> **Always disable SIP Guests on production systems.** Leaving this enabled is one of the most common causes of toll fraud on FreePBX installations.

**Tags:** freepbx, pjsip, sip, trunk

## Related

- Article: https://www.simtex.com.au/support/kb/pbx-setup-guides/freepbx-version-15-pjsip-trunk-configuration
- Category: https://www.simtex.com.au/support/kb/pbx-setup-guides
- Knowledge Base: https://www.simtex.com.au/support/kb
- Full AI reference: https://www.simtex.com.au/llms-full.txt
