Question
Does Twilio supports SIP over Websocket protocol to conduct calls using SIP.js or jsSIP library?
Product
SIP Domain, WebRTC, Twilio Programmable Voice
Answer
No, Twilio does not support SIP over WebSocket (WS/WSS) transport, which is required by browser-based SIP libraries like SIP.js and JsSIP. Twilio SIP Domains only support SIP over UDP, TCP, or TLS.
SIP.js and JsSIP require a SIP server that supports SIP over WebSocket. Twilio’s SIP Domains do not provide a WebSocket endpoint for SIP signaling.
Supported transports for Twilio SIP Domains are UDP, TCP, and TLS. You can use SIP devices that support these transports.
Browser-based calling with Twilio should use the Twilio Voice JavaScript SDK, which uses WebRTC for signaling and media. This SDK allows you to make and receive calls from the browser to PSTN, SIP endpoints, or other Twilio clients.
Media Streams API: Twilio allows you to stream audio from a call to your own WebSocket server, but this is for media (audio) streaming only—not for SIP signaling or call control.
To establish SIP Domain calls, you will need to use a softphone like Linphone or Zoiper which use TCP/UDP/ TLS for transport.
Additional Information
- Twilio’s Voice JavaScript SDK is the recommended way to make or receive calls via a web browser. The destination can be a PSTN number, SIP endpoint, or another client identifier.
- Twilio does not currently provide a SIP over WebSocket endpoint for browser-based SIP libraries.
- Media Streams API is for audio streaming only and does not provide SIP signaling capabilities.