Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How Matrix is better then SIP?


The Matrix team spent 15 years building SIP stacks before we gave up and created Matrix, so I can answer this with some confidence:

Superficially, Matrix looks a bit like SIP: for 1:1 calls, you send an m.call.invite (like a SIP INVITE) to someone; they answer with an m.call.answer (like a SIP 200 OK); eventually someone hangs up with an m.call.hangup (like a SIP BYE). However, the differences are:

* As a transport, everything goes over normal Matrix signalling (by default HTTPS+JSON) rather than SIP's mix of UDP and TLS sockets. As a result, no need for SIP's three-way handshakes inherited from its UDP transport

* As a result, you inherit Matrix's end-to-end-encryption and decentralisation for free (so no special Routes, Vias, Record-Routes, branch parameters etc from SIP - it uses the Matrix client-server and server-server APIs over HTTPS instead)

* Everything is trickle ICE by default for rapid call setup, no need to wait until you have all the ICE candidates to proceed with the call

* No offerful/offerless invites: everything is offerful.

* Matrix piggybacks on WebRTC for its media protocol, so you don't have the fragmentation of different media transports that SIP has inherited

* Matrix (as of https://github.com/matrix-org/matrix-spec-proposals/blob/mat...) now supports multiparty native VoIP calls in the same conversation: effectively letting you signal full-mesh, SFU and MCU style multiway video/voip using the same mechanism as you'd use for a 1:1 call. This is probably the biggest difference in the end: with Matrix's VoIP you can jump straight in and have interoperable Zoom/Teams/Jitsi style conferences (as shown in the OP at https://youtu.be/eUPJ9zFV5IE?t=1513) - Matrix isn't just for boring old PSTN/PBX-style 1:1 calls, but for the conferences folks actually expect to use today.

You can play with it at https://call.element.io, and if you really want to compare with SIP, go to the developer tools in options and turn on callflow mode, which will draw little mermaid sequence diagrams of the call signalling for the calls, so you can see precisely what's going on :)


I'd be curious to hear what would be something that SIP is actually better than Matrix at, any ideas? :)


SIP has been here since 1999, telecommunications also adopted it, lots of stable software, smooth cooperation, lots of suppliers.

Some thought that by introducing a new protocol they could generate better business/profit. I see no other advantage in Matrix.

There's nothing important in Matrix that can't be done in SIP, and there's nothing in Matrix that's much more deserving of a new protocol. There are many standard extensions for SIP, and if you're still missing something, it's easy to add.

Disclaimer: I am a SIP fan and I hate reinwenting the wheel




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: