What is WebRTC with Asterisk?
WebRTC (Web Real-Time Communication) allows voice and video calls directly in a web browser without any plugins. When combined with Asterisk, users can make and receive phone calls from a webpage, softphone app, or mobile web app.
Required Components:
| Component | Purpose | Asterisk Requirement |
|---|---|---|
| WebSocket (WSS) | SIP signaling transport (replaces UDP/TCP) | PJSIP with protocol=wss |
| DTLS-SRTP | Media encryption (browsers require it) | media_encryption=dtls |
| ICE / STUN / TURN | NAT traversal for media | STUN/TURN server addresses |
| Opus Codec | Audio codec (required by browsers) | allow=opus |
| Valid TLS Certificate | Browsers reject self-signed certs for WSS | Let's Encrypt or commercial cert |
Critical: WebRTC requires encryption. Browsers will not allow unencrypted WebSocket (ws://) or unencrypted media. You must use WSS (WebSocket Secure) with valid TLS certificates and DTLS-SRTP for media.