AiPBX
Product Features Integrations
Install Mobile
Resources Docs FAQ & Tech Why PHP? Videos
Try Contact Sponsor on GitHub UpCloud ($250 Free Credit) YouTube GitHub

WebRTC, DTLS-SRTP, ICE & Ephemeral coturn Credentials

End-to-end encrypted Opus audio over DTLS-SRTP, TURNS relaying on Port 443, solving loopback media drops with relay-ip and ice_host_candidates, disabling stunaddr (~6 s call-setup stall fix), and HMAC-SHA1 auto-renewing TURN tokens.

Home / FAQ & Tech / WebRTC, DTLS-SRTP, ICE & Ephemeral coturn Credentials
PRODUCTION · MEDIA RELAY

Three Real-World NAT Pitfalls We Fixed

1) Without explicit relay-ip in coturn, Port 443 edge forwarding looks like 127.0.0.1 traffic and relays media back to loopback instead of Asterisk — causing silent calls. 2) When an external IP is configured, AiPBX writes [ice_host_candidates] (private => public, include_local_address=yes) in rtp.conf. 3) Asterisk stunaddr was intentionally turned off because STUN resolution stalled every WebRTC call setup by ~6 seconds.

HMAC-SHA1 Ephemeral Credentials

Static long-term TURN passwords are never shipped in client bundles. The web softphone refreshes session-scoped HMAC-SHA1 TURN credentials in-place every 30 minutes via /api/sip_credentials.php so all-day agent shifts never hit token expiry.

Every WebRTC audio and video stream negotiates DTLS-SRTP encryption so network hops between client and PBX see only ciphertext.
WebRTC, NAT & TURN Guide Why PHP? (Architecture) All Technologies