---
title: Connect FreeSWITCH to TelecomsXchange
url: https://help.telecomsxchange.com/integrations/freeswitch/
audience: Integrations
summary: Add a Sofia gateway on the external profile with proxy sip01.telecomsxchange.com:5060
  and register=false, then bridge to sofia/gateway/tcxc/TECH_PREFIX followed by the
  E.164 number. Authorise FreeSWITCH's public IP on the account, or put the VoIP login
  and password on the gateway; accept inbound calls only from 174.136.44.213.
updated: '2026-10-23'
verified_commit: 83b4ebc96d0081a25213776d5a8871bd04941125
---

# Connect FreeSWITCH to TelecomsXchange

> Add a Sofia gateway on the external profile with proxy sip01.telecomsxchange.com:5060 and register=false, then bridge to sofia/gateway/tcxc/TECH_PREFIX followed by the E.164 number. Authorise FreeSWITCH's public IP on the account, or put the VoIP login and password on the gateway; accept inbound calls only from 174.136.44.213.

## FreeSWITCH to a purchased route

1. **Your FreeSWITCH**: Sofia gateway, register=false
2. **TelecomsXchange** (via `80039#447700900123`): sip01, UDP 5060
3. **Seller's route**: The route you purchased

This guide connects FreeSWITCH to TelecomsXchange with a Sofia gateway for outbound calls and an ACL for inbound calls on routes you sell or numbers you bought. For every TelecomsXchange value in one place, see [Connect a SIP platform](https://help.telecomsxchange.com/integrations/connect-sip-platforms/).

!!! warning
    TelecomsXchange does not accept SIP REGISTER. Set `register` to `false` on the gateway. FreeSWITCH 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 FreeSWITCH's public IP, for example `203.0.113.10`, or a VoIP login and password from **Edit Account → Add SIP Digest Auth**.
- A [purchased route](https://help.telecomsxchange.com/buyers/find-and-buy-routes/) and its tech prefix from **My Interconnections**, for example `80039#`.
- The external Sofia profile running with `ext-sip-ip` and `ext-rtp-ip` set to your public IP if you are behind NAT.
- To sell: a [route](https://help.telecomsxchange.com/sellers/add-your-first-route/) with **IP Address:Port** pointing at FreeSWITCH, for example `203.0.113.10:5080`, and the values in [Interconnect Info](https://help.telecomsxchange.com/sellers/interconnect-info/).

## How do I send calls to TelecomsXchange?

1. Create the gateway file:

```xml
<!-- conf/sip_profiles/external/tcxc.xml -->
<include>
  <gateway name="tcxc">
    <param name="proxy" value="sip01.telecomsxchange.com:5060"/>
    <param name="register" value="false"/>          <!-- TCXC is peering only -->
    <param name="register-transport" value="udp"/>
    <param name="caller-id-in-from" value="true"/>  <!-- put the caller ID in From -->
    <!-- IP authentication: username and password are not checked;
         digest authentication: the account's VoIP Login and VoIP Password -->
    <param name="username" value="VOIP_LOGIN"/>
    <param name="password" value="VOIP_PASSWORD"/>
  </gateway>
</include>
```

With IP authentication, leave any placeholder values in `username` and `password`; TelecomsXchange recognises FreeSWITCH by its source IP. With digest authentication, use the real **VoIP Login** and **VoIP Password**: FreeSWITCH answers the 401 or 407 challenge with them without registering.

2. Load it: in `fs_cli`, run `sofia profile external rescan`, then `sofia status gateway tcxc`.

3. Add a dialplan extension that strips `+` or `00` and puts the tech prefix in front. `TECH_PREFIX` is the route's prefix from **My Interconnections**:

```xml
<!-- conf/dialplan/default/90_tcxc.xml -->
<include>
  <extension name="to-tcxc">
    <condition field="destination_number" expression="^(?:\+|00)?([1-9]\d{6,14})$">
      <action application="set" data="tcxc_prefix=80039#"/>  <!-- TECH_PREFIX -->
      <action application="set" data="hangup_after_bridge=true"/>
      <action application="bridge" data="sofia/gateway/tcxc/${tcxc_prefix}$1"/>
    </condition>
  </extension>
</include>
```

Run `reloadxml`. Put the extension in the context your users or customers dial from, after any local extensions it would otherwise catch.

!!! tip
    For several routes, set a different `tcxc_prefix` per destination pattern, or dial a [routing group](https://help.telecomsxchange.com/buyers/routing-groups-and-route-testing/) prefix such as `444101#` and let TelecomsXchange choose the route.

## 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` on your firewall for SIP to the profile's port, and open your RTP range (by default 16384 to 32768).
2. Add an ACL list:

```xml
<!-- conf/autoload_configs/acl.conf.xml, inside <network-lists> -->
<list name="tcxc" default="deny">
  <node type="allow" cidr="174.136.44.213/32"/>
</list>
```

3. Apply it to the profile that receives the calls, then run `reloadacl` and restart that profile (`sofia profile external restart`):

```xml
<!-- conf/sip_profiles/external.xml, in <settings> -->
<param name="apply-inbound-acl" value="tcxc"/>
```

If the profile already applies an inbound ACL, add the node to that list instead.

4. Calls on the external profile enter the `public` context. Route only TelecomsXchange calls onward:

```xml
<!-- conf/dialplan/public/10_from_tcxc.xml -->
<include>
  <extension name="from-tcxc">
    <condition field="network_addr" expression="^174\.136\.44\.213$"/>
    <condition field="destination_number" expression="^(\d+)$">
      <action application="transfer" data="$1 XML from-tcxc"/>
    </condition>
  </extension>
</include>
```

In the `from-tcxc` context, bridge each number to an extension, or for a seller route to your upstream gateway. If your route has an **Outgoing Prefix** or strips digits, match the number in that format.

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

Set the number's **SIP Endpoint (Primary)** in **DID Settings** to FreeSWITCH, for example `sip:14165551234@203.0.113.10:5080` for the external profile. The call arrives from `174.136.44.213`, passes the ACL, and the `from-tcxc` extension above transfers it by `destination_number`.

## How do I test it?

1. In `fs_cli`, run `sofia global siptrace on` (and `sofia loglevel all 9` for more detail), or capture with `sngrep port 5060 or port 5080`.
2. Place a call: `originate sofia/gateway/tcxc/80039#447700900123 &echo`.
3. Check the INVITE's Request-URI starts with the tech prefix, and read the reply code.
4. In the portal, watch the call in **Live Calls** and find its SIP code in **Logs → CDR (Voice)**. Turn tracing off with `sofia global siptrace off`.

## What if something goes wrong?

| You see | What to do |
|---|---|
| 401 or 407, then the call fails | The gateway's `username` or `password` don't match **Edit Account**. Correct them and run `sofia profile external killgw tcxc` then `rescan`. |
| 403 Forbidden | FreeSWITCH's public IP isn't authorised and no valid credentials were sent. Check the source IP in the trace against **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 `tcxc_prefix` and the Request-URI in the trace. |
| 408 Request Timeout | No reply from sip01. Check outbound UDP 5060 on the firewall and DNS on the server. |
| 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 `ext-rtp-ip` and `ext-sip-ip` on the profile to your public IP and open the RTP range. |
| No inbound calls | `174.136.44.213` isn't allowed on the firewall or in the ACL, or the route or number points at the wrong port. Check with `sofia status profile external` and a trace. |
| Inbound call lands in public and is dropped | No extension in `public` matched. Check the `from-tcxc` extension and the number format. |

## References

- [FreeSWITCH gateways configuration](https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Configuration/Sofia-SIP-Stack/Gateways-Configuration_7144069)
- [Sofia gateway authentication parameters](https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Configuration/Sofia-SIP-Stack/Sofia-Gateway-Authentication-Params_7143510)
- [FreeSWITCH access control lists](https://developer.signalwire.com/freeswitch/integration/acls/)
- [mod_sofia](https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Modules/mod_sofia_1048707/)

## Frequently asked questions

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

A: No. TelecomsXchange is peering only and does not accept REGISTER. Set register=false on the gateway; FreeSWITCH still answers a digest challenge with the gateway's username and password.

**Q: Which profile should the gateway go on?**

A: The external profile (port 5080 in the default configuration) or any profile bound to your public IP. Calls from TelecomsXchange arrive on the profile that listens on the port in your route or number, usually 5060 or 5080.

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

A: In the bridge string, before the number: sofia/gateway/tcxc/80039#447700900123. Each purchased route has its own prefix in My Interconnections.

**Q: Does TelecomsXchange transcode?**

A: No. Codecs pass through, so make sure the profile's codec preferences include what the route or caller uses, such as PCMA, PCMU or G729.
