Asterisk PBXFEATUREDFreeSWITCHLatestOpenSIPSTOP STORIESVOIPWebRTC

TURN Servers: Ensuring Reliable WebRTC & VoIP Calls

A common reason WebRTC and VoIP calls fail is simple:
devices can’t reach each other through firewalls and NATs.

If you’ve ever experienced:

  • one-way audio
  • calls not connecting
  • video freezing
  • “connecting…” screens that never end
  • WebRTC softphones failing on certain networks

…you’ve run into NAT traversal issues.

And the most important — and least understood — component solving this problem is the TURN server.

In today’s article, we’ll explore what TURN servers are, why production WebRTC systems almost always need them, how they differ from STUN, and why businesses should be monitoring them closely.


⭐ What Exactly Is a TURN Server?

TURN stands for Traversal Using Relays around NAT — a protocol that allows audio, video, and data to pass through restrictive networks.

When two devices cannot establish a peer-to-peer connection (because of corporate firewalls, symmetric NAT, carrier restrictions, or blocked ports), a TURN server acts as a relay for media.

➡ STUN finds your public IP
➡ TURN actually relays the media when STUN isn’t enough

This means the TURN server becomes the path for:

  • full audio
  • full video
  • data channels
  • ICE candidates that fail directly

For a technical breakdown:
👉 https://webrtc.org/getting-started/turn-server
👉 https://datatracker.ietf.org/doc/html/rfc8656 (RFC 8656, the current TURN specification, which replaced RFC 5766)


⭐ TURN vs STUN: Why One Is Not Enough

Many beginners assume STUN and TURN are interchangeable. They are not.

STUN (Session Traversal Utilities for NAT)

  • Discovers your public IP
  • Works only when NAT/firewall rules are permissive
  • Lightweight and cheap to run

TURN

  • Relays actual media streams
  • Works in most restrictive corporate and carrier environments, especially over TCP/TLS on port 443
  • CPU and bandwidth intensive
  • Requires proper scaling and deployment

The share of calls that need TURN varies widely by audience and network, but it is a meaningful minority — typically users behind enterprise firewalls or some mobile carrier networks.
👉 https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Connectivity

Without TURN, some of your users will not be able to connect.


⭐ Why TURN Is Crucial for VoIP, PBX, and WebRTC Softphones

1. Corporate Networks Are Getting Stricter

Modern firewalls block:

  • UDP
  • non-standard ports
  • unknown RTP flows
  • cross-site communication

TURN enables connectivity in environments where direct media is impossible.

2. Mobile Networks Often Use Symmetric NAT

Many carriers break peer-to-peer paths entirely.

TURN gives WebRTC softphones and VoIP apps a reliable fallback.

3. It Prevents One-Way Audio & Failed Calls

Many one-way audio issues originate from NAT or firewalls blocking inbound packets.

TURN solves this by routing media through a stable, reachable relay.

4. Essential for Mixed SIP/WebRTC Environments

When connecting browsers to PBX systems like:

  • Asterisk
  • FreeSWITCH
  • FusionPBX
  • OpenSIPS / Kamailio

TURN ensures media can traverse both legacy and modern network conditions.


⭐ How TURN Works Inside the ICE Framework

WebRTC uses ICE (Interactive Connectivity Establishment) to test possible connection paths. The sequence looks like this:

  1. Gather host candidates (local network), STUN candidates (public address) and TURN relay candidates
  2. Exchange them with the other side through signalling
  3. Run connectivity checks on candidate pairs, preferring direct paths
  4. The best working pair becomes the media path; a relay is used only if no direct pair works

If no direct path works, the relay is the only option left.


⭐ Best Practices for TURN Deployment

Use Both UDP and TCP

UDP is ideal, but many enterprise networks block it.
TCP and TLS TURN (for example on port 443) improve reliability.

Always Enable Authentication

Anonymous TURN is a major security risk.

Scale for Bandwidth

TURN relays actual media — it consumes real bandwidth.

As a rough guide, an HD video call can use around 1–3 Mbps in each direction, depending on the codec and settings.

Deploy Multiple Geographic Nodes

Latency matters. Choose data centres near:

  • Africa (if targeting SA market)
  • Europe
  • US West / East
  • APAC

⭐ Open-Source TURN Servers to Know

Here are three open-source options, of which only the first is actively maintained:

Coturn (most popular & widely deployed)
👉 https://github.com/coturn/coturn

Restund (older, little recent development)
👉 https://github.com/creytiv/restund

rfc5766-turn-server (the predecessor of coturn, now superseded by it)
👉 https://github.com/coturn/rfc5766-turn-server

Coturn is the most widely deployed open-source TURN server, with support for TURN over TLS and several authentication mechanisms.


⭐ The Future of TURN: Smarter, Faster, More Secure

Possible directions for TURN deployments include:

  • exploration of QUIC-based relaying
  • stronger abuse and DDoS protection
  • smarter routing between relay regions
  • integration with cloud edge networks
  • built-in WebRTC analytics

TURN will remain a cornerstone of reliable communication for:

  • browser softphones
  • PBX extensions
  • mobile VoIP apps
  • embedded call widgets
  • enterprise WebRTC deployments

⭐ Final Thoughts

TURN servers may not be visible to end users, but they are essential to making WebRTC and VoIP work reliably in the real world — especially behind firewalls, on mobile networks, and in restrictive enterprise environments.

If your communication system depends on browser calling, mobile SIP clients, or cloud PBX functions, TURN is the safety net that keeps calls connected when direct paths fail.

For more articles like this, visit SoftpageCMS.

Leave a Reply

Your email address will not be published. Required fields are marked *