WebRTC enables real-time audio and video in the browser but does not define how calls are signaled or controlled. SIP over WebSockets fills that gap by allowing browser applications to act as full SIP clients using a secure WebSocket connection. This approach lets developers build browser-based calling experiences that integrate with traditional SIP systems and the public switched telephone network (PSTN) while keeping media transport handled by WebRTC.
WebRTC with SIP Over WebSockets: Browser Calling and Telephony Integration
Real-time communications are increasingly expected to work seamlessly inside web applications. WebRTC (Web Real-Time Communication) lets browsers send and receive audio, video, and data streams without plugins or downloads, but it doesn’t define a signaling protocol. That’s where SIP over WebSockets comes in. By using SIP (Session Initiation Protocol) over WebSockets, web apps can register and place calls just like traditional VoIP clients while still running inside a browser. SignalWire supports this standard-based integration, so you can connect browser users to traditional telephony networks, SIP endpoints, and PSTN numbers.
What is WebRTC?
WebRTC (Web Real-Time Communication) is an open web standard maintained by the World Wide Web Consortium (W3C) that enables browsers and mobile clients to establish real-time audio, video, and data connections directly between endpoints without plugins. WebRTC handles media capture, encryption, and peer-to-peer transport, but does not mandate a specific signaling protocol for session setup.
Why use SIP over WebSockets with WebRTC?
Browsers need a signaling channel
WebRTC doesn’t specify how peers discover each other or negotiate calls — that’s left to the application. Industry-standard SIP is a mature, widely supported signaling protocol for initiating, modifying, and terminating communication sessions. However, browsers can’t speak raw SIP over traditional SIP transports (UDP/TCP). Instead, SIP runs over WebSockets (wss://), which browsers support natively. This combination — SIP over WebSockets — lets web applications act as full SIP clients capable of placing and receiving calls without extra plugins.
Full telephony integration
Using SIP over WebSockets means your web app can:
Register browser endpoints as SIP devices
Make and receive voice/audio calls in the browser
Bridge calls between browsers and SIP or PSTN networks
Integrate with familiar SIP libraries like JsSIP or others that speak SIP over WebSockets
SignalWire supports this model natively — you can create SIP endpoints in your SignalWire Space and connect them via WebSockets from the browser.
How SignalWire supports WebRTC SIP over WebSockets
SignalWire’s platform enables WebRTC with SIP over WebSockets so you can test and deploy browser-based calling using off-the-shelf JavaScript SIP libraries (e.g., JsSIP). The basic steps are:
Create SIP endpoints in your SignalWire Space or via REST APIs.
Configure the SIP endpoint’s authentication credentials in your browser app.
Connect to the SIP endpoint using a secure WebSocket (
wss://…) address.Register and place calls between browser SIP endpoints or to/from telephony networks (PSTN).
This creates a flexible, industry-standard bridge between browser communications and traditional telephony infrastructure.
Example: Browser SIP testing with JsSIP
One popular way to experiment with SIP over WebSockets is JsSIP, a JavaScript SIP stack that runs in modern browsers and speaks SIP over WebSockets. Once you point JsSIP at your target SIP endpoint’s WebSocket URI (for example, wss://your-space.sip.signalwire.com), the browser can:
Register as a full SIP client
Handle incoming WebRTC calls over SIP
Initiate outbound calls to SIP or PSTN destinations
The general architecture looks like this:
Browser (WebRTC + SIP/WebSockets) → SignalWire SIP Endpoint → PSTN or SIP Networks
When to use SIP over WebSockets
You should consider SIP over WebSockets for:
Browser calling interfaces that connect users in real time
Softphone applications running inside web dashboards
Web conferencing platforms that need SIP network interoperability
Service integration where browser users need access to telephony infrastructure
This model makes your web app behave like a traditional SIP phone while still leveraging WebRTC’s real-time media capabilities.
Have questions? Join our developer community on Discord!
Frequently asked questions
What is SIP over WebSockets?
SIP over WebSockets is a method of transporting the Session Initiation Protocol (SIP) over secure WebSocket connections so that web browsers can participate in SIP-based call signaling.
Why is SIP needed when using WebRTC?
WebRTC handles real-time media but does not specify a signaling protocol. SIP provides standardized call setup, teardown, and session control, making it a common choice for signaling WebRTC calls.
Why can’t browsers use SIP over UDP or TCP directly?
Browsers do not allow direct access to raw UDP or TCP sockets for security reasons. WebSockets are the only persistent, bidirectional transport browsers support for custom protocols like SIP.
How does SIP over WebSockets connect WebRTC to PSTN calls?
By registering browser clients as SIP endpoints, SIP over WebSockets allows calls to be routed through a SIP server or platform like SignalWire, which can bridge WebRTC media to PSTN or other SIP destinations.
Is SIP over WebSockets part of the WebRTC standard?
No. WebRTC intentionally does not mandate a signaling protocol. SIP over WebSockets is a widely adopted, standards-based approach defined in RFC 7118.