When to use STUN/TURN
Use STUN/TURN servers when the SIP client is:- Behind a firewall or NAT gateway
- On a private network without public IP addresses
- Unable to receive inbound connections directly
- Experiencing one-way audio issues
Telnyx STUN/TURN endpoints
Telnyx provides the following public endpoints for NAT traversal:| Type | Endpoint | Port | Protocol |
|---|---|---|---|
| STUN | stun.telnyx.com | 3478 | UDP |
| TURN | turn.telnyx.com | 3478 | UDP/TCP |
Configuration
Standard STUN configuration
Configure the SIP client to use Telnyx STUN servers for NAT traversal:TURN with authentication
TURN requires credentials. Contact Telnyx support to obtain TURN server credentials for the account.Alternative STUN servers
While Telnyx provides its own STUN infrastructure, third-party STUN servers may also be used:Network requirements
Ensure the firewall allows outbound traffic:| Service | Port | Protocol | Direction |
|---|---|---|---|
| STUN | 3478 | UDP | Outbound |
| TURN | 3478 | UDP/TCP | Outbound |
| RTP media | 16384-32768 | UDP | Bidirectional |
ICE candidate types
When using STUN/TURN, the client will gather different types of ICE candidates:- host: Local network addresses (cannot traverse NAT)
- srflx: Server reflexive addresses (via STUN)
- relay: Relayed addresses (via TURN)
- prflx: Peer reflexive addresses (discovered during connectivity checks)
srflx(server reflexive via STUN)relay(relayed via TURN)prflx(peer reflexive)
Troubleshooting
One-way audio
If one-way audio occurs:- Verify STUN server is reachable:
stun.telnyx.com:3478 - Check that UDP port 3478 is allowed outbound
- Ensure RTP media ports (16384-32768) are open bidirectionally
Connection failures
If calls fail to connect:- Verify firewall rules allow outbound UDP to port 3478
- Check that the SIP client supports STUN/TURN
- Confirm TURN credentials are correct (if using TURN)
- Review ICE candidate gathering logs in the client
Restrictive networks
In highly restrictive networks that block UDP traffic:- Use TURN over TCP:
turn.telnyx.com:3478(TCP) - Consider using TLS for SIP signaling: port 5061
- Contact support for additional configuration options
See also
- IP Whitelisting - Firewall configuration for SIP signaling
- WebRTC Troubleshooting - ICE candidate debugging