---
title: Connect FreePBX to TelecomsXchange
url: https://help.telecomsxchange.com/integrations/freepbx/
audience: Integrations
summary: In FreePBX 17, add a chan_pjsip trunk to sip01.telecomsxchange.com port 5060
  with Registration set to None and Authentication set to None (IP) or Outbound (VoIP
  login and password), and Match (Permit) 174.136.44.213. Add an outbound route that
  prepends the tech prefix, so calls leave as 80039#447700900123, and inbound routes
  for your E.164 numbers.
updated: '2026-10-23'
verified_commit: 83b4ebc96d0081a25213776d5a8871bd04941125
---

# Connect FreePBX to TelecomsXchange

> In FreePBX 17, add a chan_pjsip trunk to sip01.telecomsxchange.com port 5060 with Registration set to None and Authentication set to None (IP) or Outbound (VoIP login and password), and Match (Permit) 174.136.44.213. Add an outbound route that prepends the tech prefix, so calls leave as 80039#447700900123, and inbound routes for your E.164 numbers.

## FreePBX to a purchased route

1. **Your FreePBX**: PJSIP trunk, Registration None
2. **TelecomsXchange** (via `80039#447700900123`): sip01, UDP 5060
3. **Seller's route**: The route you purchased

This guide connects FreePBX 17 to TelecomsXchange with a PJSIP trunk: outbound calls to a purchased route, and inbound calls on numbers you bought or routes you sell. FreePBX writes the Asterisk configuration for you, so every setting here is in the web GUI. For the full list of TelecomsXchange values, see [Connect a SIP platform](https://help.telecomsxchange.com/integrations/connect-sip-platforms/); for the underlying Asterisk configuration, see [Connect Asterisk](https://help.telecomsxchange.com/integrations/asterisk/).

!!! warning
    TelecomsXchange does not accept SIP REGISTER. Set **Registration** to **None** on the trunk. FreePBX is recognised by its **source IP** or by **digest authentication on the INVITE**.

## Before you start

- A [SIP account](https://help.telecomsxchange.com/buyers/create-your-first-account/) with FreePBX's public IP, for example `203.0.113.10`, or a VoIP login and password from **Edit Account → Add SIP Digest Auth**. In this guide `VOIP_LOGIN` and `VOIP_PASSWORD` stand for them.
- A [purchased route](https://help.telecomsxchange.com/buyers/find-and-buy-routes/) and its tech prefix from **My Interconnections**, for example `80039#`. In this guide `TECH_PREFIX` stands for that value.
- FreePBX 17 with the PJSIP driver on UDP port 5060 (**Settings → Asterisk SIP Settings → SIP Settings [chan_pjsip]**).
- To sell: a [route](https://help.telecomsxchange.com/sellers/add-your-first-route/) with **IP Address:Port** set to FreePBX, for example `203.0.113.10:5060`, and the values in [Interconnect Info](https://help.telecomsxchange.com/sellers/interconnect-info/).

## How do I send calls to TelecomsXchange?

1. Go to **Connectivity → Trunks → Add Trunk → Add SIP (chan_pjsip) Trunk**. On the **General** tab, set **Trunk Name** to `tcxc` and, if you want, **Maximum Channels** to the concurrent calls you bought.
2. On **pjsip Settings → General**, enter:

| Field | IP authentication | Digest authentication |
|---|---|---|
| Username | Leave empty | `VOIP_LOGIN` |
| Auth username | Leave empty | `VOIP_LOGIN` |
| Secret | Leave empty | `VOIP_PASSWORD` |
| Authentication | **None** | **Outbound** |
| Registration | **None** | **None** |
| SIP Server | `sip01.telecomsxchange.com` | Same |
| SIP Server Port | `5060` | Same |
| Context | `from-pstn` | Same |
| Transport | `0.0.0.0-udp` | Same |

3. On **pjsip Settings → Advanced**, set:

| Field | Value | Why |
|---|---|---|
| Qualify Frequency | `0` | TelecomsXchange answers OPTIONS only within a call |
| Match (Permit) | `174.136.44.213/32` | Maps inbound calls from TelecomsXchange to this trunk |
| Direct Media | No | Keeps RTP through FreePBX |
| Rewrite Contact | Yes | Helps behind NAT |
| RTP Symmetric | Yes | Sends RTP back where it came from |
| Force rport | Yes | Replies to the port the request came from |

4. On **pjsip Settings → Codecs**, enable the codecs your route supports (`g729`, `ulaw`, `alaw`, as listed in the Purchased Route Confirmation email). TelecomsXchange doesn't transcode. Click **Submit**.
5. Go to **Connectivity → Outbound Routes → Add Outbound Route**. On **Route Settings**, name it `TCXC` and put `tcxc` in **Trunk Sequence for Matched Routes**. On **Dial Patterns**, add one row per way users dial an international number:

| prepend | prefix | match pattern | Dialled | Sent to TelecomsXchange |
|---|---|---|---|---|
| `80039#` | `00` | `X.` | `00447700900123` | `80039#447700900123` |
| `80039#` | `+` | `X.` | `+447700900123` | `80039#447700900123` |

FreePBX checks the prefix and match pattern, removes the prefix, then adds the prepend. Click **Submit**, then **Apply Config**.

!!! tip
    To pick routes per destination, create one outbound route per destination (for example prefix `0044`) with that route's tech prefix, ordered above a catch-all route. Or prepend a [routing group](https://help.telecomsxchange.com/buyers/routing-groups-and-route-testing/) prefix such as `444101#` and let TelecomsXchange choose.

**Digest variant.** If FreePBX sends from an IP that isn't on the account, use the digest column in step 2. With **Authentication** set to **Outbound** and **Registration** set to **None**, FreePBX sends no REGISTER and answers TelecomsXchange's 401 or 407 challenge on each INVITE with `VOIP_LOGIN` and `VOIP_PASSWORD`. The challenge realm is `174.136.44.213`.

**NAT.** If FreePBX is behind NAT, go to **Settings → Asterisk SIP Settings → General SIP Settings** and set **External Address** to your public IP (`203.0.113.10`) and **Local Networks** to your private range (for example `10.0.0.0/8`). The **RTP Settings** on the same page show the RTP port range to forward (by default 10000 to 20000).

## How do I receive calls from TelecomsXchange?

Calls on routes you sell, and on numbers you bought, come from `174.136.44.213` over UDP, from source ports 5060 to 5072, with the number in E.164 format such as `14165551234`.

1. Allow `174.136.44.213` through the firewall in front of FreePBX for UDP 5060 and your RTP range. If you use the FreePBX firewall, go to **Connectivity → Firewall → Networks**, add `174.136.44.213/32` and set it to **Trusted**.
2. The trunk's **Match (Permit)** maps that IP to the `tcxc` trunk, so calls enter `from-pstn` and are routed by **Inbound Routes**.
3. Go to **Connectivity → Inbound Routes → Add Inbound Route**. Set **DID Number** to the number as it arrives, for example `14165551234`, and **Set Destination** to an extension, ring group, queue or IVR. Click **Submit** and **Apply Config**.
4. If your route has an **Outgoing Prefix** or strips digits (**Edit Route → Outgoing Number Translation Parameters**), enter the DID Number in that format.

!!! warning
    Without **Match (Permit)**, FreePBX doesn't recognise calls from `174.136.44.213` and challenges them with 401. TelecomsXchange doesn't answer that challenge, so the call fails.

FreePBX is a PBX. As a seller, it can terminate calls to its own extensions and numbers; to carry wholesale transit traffic on to another carrier, use a softswitch such as [Asterisk](https://help.telecomsxchange.com/integrations/asterisk/) or [FreeSWITCH](https://help.telecomsxchange.com/integrations/freeswitch/) configured directly.

## How do I receive calls on numbers I bought?

Set the number's **SIP Endpoint (Primary)** in **DID Settings** to FreePBX, for example `sip:14165551234@203.0.113.10:5060`. TelecomsXchange sends the INVITE from `174.136.44.213`, the trunk matches it, and the inbound route for `14165551234` sends it on.

## How do I test it?

1. On the FreePBX shell, open the Asterisk CLI with `asterisk -rvvv` and turn on SIP logging: `pjsip set logger on`. Check the trunk with `pjsip show endpoint tcxc`.
2. Place a call from an extension to `00447700900123`.
3. In the log, look for the INVITE to `80039#447700900123` (or `80039%23447700900123`), any 401 or 407 challenge, and the reply. `sngrep port 5060` shows the same flow as a ladder.
4. In FreePBX, check **Reports → CDR Reports**. In the TelecomsXchange portal, watch the call in **Live Calls** and find its SIP code in **Logs → CDR (Voice)**.

## What if something goes wrong?

| You see | What to do |
|---|---|
| 401 or 407 repeated, then the call fails | FreePBX isn't answering the challenge. Set **Authentication** to **Outbound** and check **Username**, **Auth username** and **Secret** against the VoIP login and password on **Edit Account**. |
| 403 Forbidden | FreePBX's public IP isn't authorised and no credentials were sent. Compare the IP in `pjsip set logger` with the account's **IP Address** and **Additional Allowed IPs**; check the account isn't blocked or out of balance. |
| 404 Not Found | Missing or wrong tech prefix, or `+`/`00` left in the number. Check the outbound route's **prepend** and **prefix** and the Request-URI in the log. |
| 408 Request Timeout | No reply from sip01. Check outbound UDP 5060 on your firewall and that FreePBX resolves `sip01.telecomsxchange.com`. |
| 503 Service Unavailable | The route is blocked or failed on the seller's side. Check **My Interconnections**; try another route or a routing group. |
| One-way or no audio | Set **External Address** and **Local Networks** in **Asterisk SIP Settings**, keep **RTP Symmetric** on, and forward the RTP range. |
| Inbound calls rejected with 401 or 403 | **Match (Permit)** is missing or wrong, or the FreePBX firewall blocks `174.136.44.213`. Check with `pjsip show identifies`. |
| Inbound call arrives but goes nowhere | No inbound route matches the number as it arrives; check the **DID Number** format and any Outgoing Prefix on your route. |

## References

- [Sangoma: PBX GUI Trunks Module user guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439)
- [Sangoma: PBX GUI Trunks Module](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25723188/PBX+GUI+-+Trunks+Module)
- [FreePBX community: PJSIP trunk with no registration or authentication](https://community.freepbx.org/t/freepbx-pjsip-trunk-with-no-reg-or-auth/105124)
- [Asterisk: Configuring res_pjsip to work through NAT](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Configuring-res_pjsip-to-work-through-NAT/)

## Frequently asked questions

**Q: Can FreePBX register to TelecomsXchange?**

A: No. TelecomsXchange is peering only and does not accept REGISTER. Set Registration to None on the trunk. FreePBX is recognised by its source IP, or by answering the digest challenge when Authentication is Outbound.

**Q: Which Authentication setting do I choose?**

A: None if TelecomsXchange recognises FreePBX by its IP address. Outbound if you use the account's VoIP login and password; FreePBX then answers TelecomsXchange's 401 or 407 challenge without registering.

**Q: Why does the trunk show as Unavailable?**

A: With Qualify Frequency set to 0, FreePBX doesn't ping the trunk, so its status can't be checked; that's expected. TelecomsXchange answers OPTIONS only within a call, so leave qualify off.

**Q: Where does the tech prefix go?**

A: In the outbound route's Dial Patterns, in the prepend field: (80039#) + 00 | X. turns 00447700900123 into 80039#447700900123.
