Help Center
All integration guides

Connect Twilio to TelecomsXchange

Guide 8 of 284-minute readUpdated 23 October 2026

In short: Twilio isn't a switch you point at TelecomsXchange as a trunk. To buy, return TwiML <Dial><Sip> to sip:TECH_PREFIX%23NUMBER@sip01.telecomsxchange.com with the account's VoIP login and password as username and password. To receive TelecomsXchange phone numbers, create a Twilio SIP domain with an IP access control list for 174.136.44.213 and set it as the number's SIP endpoint.

Twilio to a purchased route
  1. Your Twilio appTwiML <Dial><Sip> with username and password
  2. then, 80039%23447700900123, TelecomsXchangesip01, UDP 5060, digest auth
  3. Seller's routeThe route you purchased
On this page
  1. Before you start
  2. How do I send calls to TelecomsXchange?
  3. How do I receive calls on numbers I bought?
  4. Can TelecomsXchange send calls to Twilio as a seller route?
  5. How do I test it?
  6. What if something goes wrong?
  7. References
  8. Common questions

Twilio is a CPaaS carrier, not a switch you configure as a trunk to TelecomsXchange. You can combine them in two ways: your Twilio application sends calls to a purchased TelecomsXchange route with <Dial><Sip>, and TelecomsXchange delivers phone numbers you bought into a Twilio SIP domain. For every TelecomsXchange value in one place, see Connect a SIP platform.

Warning

TelecomsXchange does not accept SIP REGISTER. Twilio reaches it with a plain INVITE and digest authentication on the INVITE, using the account's VoIP login and password. Don't authorise Twilio's shared IP ranges on your account.

Before you start#

  • A SIP account on TelecomsXchange with a VoIP login and password: Edit Account → Add SIP Digest Auth.
  • A purchased route and its tech prefix from My Interconnections, for example 80039#.
  • A Twilio account with a voice webhook (your own app, a TwiML Bin or a Studio flow) that can return TwiML.
  • For numbers: a phone number bought on TelecomsXchange.

How do I send calls to TelecomsXchange?#

Return TwiML that dials a SIP URI on sip01. Put the tech prefix in front of the E.164 number and write # as %23: a raw # isn't allowed in the user part of a SIP URI.

XML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial callerId="+14155550100" timeout="60">
    <!-- TECH_PREFIX 80039# written as 80039%23, then the E.164 number without + -->
    <Sip username="VOIP_LOGIN" password="VOIP_PASSWORD">sip:80039%23447700900123@sip01.telecomsxchange.com:5060;transport=udp</Sip>
  </Dial>
</Response>
  • VOIP_LOGIN and VOIP_PASSWORD are the VoIP Login and VoIP Password from Edit Account. Twilio answers TelecomsXchange's 401 or 407 challenge with them.
  • transport=udp is Twilio's default; keep it explicit. TelecomsXchange takes SIP over UDP on port 5060.
  • Twilio sends SIP from its North America (Virginia) edge unless you add a region parameter to the URI, such as ;region=ie1.
  • callerId is the caller ID the route receives.

In your webhook code, build the URI from the number your caller dialled: strip + or 00, then prepend TECH_PREFIX with # encoded as %23. Twilio bills its own leg of the call on top of the TelecomsXchange route price.

Tip

Dial a routing group prefix such as 444101%23 to let TelecomsXchange pick the route, so your TwiML doesn't need a prefix per destination.

How do I receive calls on numbers I bought?#

TelecomsXchange delivers each number to its SIP endpoint from 174.136.44.213. A Twilio SIP domain can accept those calls and run your voice webhook.

  1. In the Twilio Console, go to Voice → Manage → SIP domains and create a domain, for example yourco.sip.twilio.com.
  2. Under the domain's authentication, create an IP access control list with 174.136.44.213. Twilio requires a full address; there are no wildcards.
  3. Set the domain's voice A call comes in URL to the webhook or TwiML that should handle the call.
  4. On TelecomsXchange, open the number's DID Settings and set SIP Endpoint (Primary) to:
Text
sip:14165551234@yourco.sip.twilio.com:5060

Your webhook receives the user part (14165551234) in the To parameter.

Warning

174.136.44.213 is TelecomsXchange's shared platform IP, and Twilio itself warns that IP authentication alone doesn't separate tenants of a multi-tenant carrier. In your webhook, accept only the numbers you own and reject everything else.

A Twilio BYOC trunk with the same IP access control list also works if you prefer to manage the numbers as BYOC numbers. Either way, TelecomsXchange passes codecs through, and Twilio accepts G.711.

Can TelecomsXchange send calls to Twilio as a seller route?#

Not covered here. Twilio isn't a destination you sell on TelecomsXchange: an Elastic SIP Trunk terminates your own traffic, and reselling it as a wholesale route depends on Twilio's terms.

How do I test it?#

  1. Call your Twilio number, or create a call with the REST API, so the webhook returns the <Dial><Sip>.
  2. In the Twilio Console, open Monitor → Logs → Calls, select the call and check the SIP leg's response code and the SIP URI dialled.
  3. On TelecomsXchange, watch the call in Live Calls and find its SIP code in Logs → CDR (Voice).
  4. For numbers, call the TelecomsXchange number and check the Twilio call log for the SIP domain call.

What if something goes wrong?#

You see What to do
401 or 407 in the Twilio log Wrong username or password on <Sip>, or digest auth isn't enabled on the account. Copy them again from Edit Account.
403 Forbidden No valid credentials, or the account is blocked or out of balance. Twilio's source IP is never authorised on its own.
404 Not Found Missing or wrong tech prefix, a raw # in the URI, or + left in the number. Use 80039%23 followed by the E.164 number.
408 Request Timeout, or no answer Twilio couldn't reach sip01. Check the URI host and port, and transport=udp.
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 Codec mismatch: TelecomsXchange doesn't transcode, so the route must accept G.711 from Twilio.
Number calls never reach Twilio 174.136.44.213 isn't in the SIP domain's IP access control list, or the number's SIP endpoint has a typo in the domain.
Number calls reach Twilio but play an error The SIP domain has no voice URL, or the webhook rejects the To number.

References#

Common questions

Can Twilio register to TelecomsXchange?

No. TelecomsXchange is peering only and does not accept REGISTER. Twilio's <Sip> noun sends the INVITE and answers TelecomsXchange's digest challenge with the username and password you give it.

Why not authorise Twilio's IP addresses on my account?

Twilio's SIP signalling addresses are shared by all Twilio customers. Authorising them would let any Twilio user send calls on your account. Use digest credentials instead.

Can I use a Twilio BYOC trunk to send calls to TelecomsXchange?

Not well. Twilio doesn't authenticate to the carrier with credentials on BYOC origination, so you'd have to authorise Twilio's shared IPs, and BYOC dials E.164 numbers, which leaves no place for the tech prefix. Use <Dial><Sip>.

Can I sell Twilio termination on TelecomsXchange?

This guide doesn't cover it. Pointing a TelecomsXchange seller route at a Twilio Elastic SIP Trunk is technically possible, but check Twilio's terms for wholesale resale first.

Can Twilio register to TelecomsXchange?
No. TelecomsXchange is peering only and does not accept REGISTER. Twilio's <Sip> noun sends the INVITE and answers TelecomsXchange's digest challenge with the username and password you give it.
Why not authorise Twilio's IP addresses on my account?
Twilio's SIP signalling addresses are shared by all Twilio customers. Authorising them would let any Twilio user send calls on your account. Use digest credentials instead.
Can I use a Twilio BYOC trunk to send calls to TelecomsXchange?
Not well. Twilio doesn't authenticate to the carrier with credentials on BYOC origination, so you'd have to authorise Twilio's shared IPs, and BYOC dials E.164 numbers, which leaves no place for the tech prefix. Use <Dial><Sip>.
Can I sell Twilio termination on TelecomsXchange?
This guide doesn't cover it. Pointing a TelecomsXchange seller route at a Twilio Elastic SIP Trunk is technically possible, but check Twilio's terms for wholesale resale first.