All integration guides
Connect FreePBX to TelecomsXchange
In short: 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
- Your FreePBXPJSIP trunk, Registration None
- then, 80039#447700900123, TelecomsXchangesip01, UDP 5060
- Seller's routeThe route you purchased
On this page
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; for the underlying Asterisk configuration, see Connect 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 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 guideVOIP_LOGINandVOIP_PASSWORDstand for them. - A purchased route and its tech prefix from My Interconnections, for example
80039#. In this guideTECH_PREFIXstands 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 with IP Address:Port set to FreePBX, for example
203.0.113.10:5060, and the values in Interconnect Info.
How do I send calls to TelecomsXchange?#
- Go to Connectivity → Trunks → Add Trunk → Add SIP (chan_pjsip) Trunk. On the General tab, set Trunk Name to
tcxcand, if you want, Maximum Channels to the concurrent calls you bought. - 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 |
- 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 |
- 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. - Go to Connectivity → Outbound Routes → Add Outbound Route. On Route Settings, name it
TCXCand puttcxcin 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 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.
- Allow
174.136.44.213through the firewall in front of FreePBX for UDP 5060 and your RTP range. If you use the FreePBX firewall, go to Connectivity → Firewall → Networks, add174.136.44.213/32and set it to Trusted. - The trunk's Match (Permit) maps that IP to the
tcxctrunk, so calls enterfrom-pstnand are routed by Inbound Routes. - 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. - 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 or 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?#
- On the FreePBX shell, open the Asterisk CLI with
asterisk -rvvvand turn on SIP logging:pjsip set logger on. Check the trunk withpjsip show endpoint tcxc. - Place a call from an extension to
00447700900123. - In the log, look for the INVITE to
80039#447700900123(or80039%23447700900123), any 401 or 407 challenge, and the reply.sngrep port 5060shows the same flow as a ladder. - 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#
Common questions
Can FreePBX register to TelecomsXchange?
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.
Which Authentication setting do I choose?
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.
Why does the trunk show as Unavailable?
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.
Where does the tech prefix go?
In the outbound route's Dial Patterns, in the prepend field: (80039#) + 00 | X. turns 00447700900123 into 80039#447700900123.
- Can FreePBX register to TelecomsXchange?
- 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.
- Which Authentication setting do I choose?
- 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.
- Why does the trunk show as Unavailable?
- 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.
- Where does the tech prefix go?
- In the outbound route's Dial Patterns, in the prepend field: (80039#) + 00 | X. turns 00447700900123 into 80039#447700900123.
Finished this guide?
This guide matches platform build 83b4ebc9. Markdown version.