Show HN: Bring phone calls into the browser (SIP-to-WebRTC)
github.com
github.com
It's a shame. Lots of people built their first things/got introduced to WebRTC via it.
https://www.sec.gov/Archives/edgar/data/1447669/000119312523...
mentioned in https://www.cnbc.com/2023/12/04/twilio-layoffs-company-to-cu...
If you are new to WebRTC and want to learn more about the protocol check out [0] (would love peoples feedback). It is used in lots of unexpected places like streaming (added to OBS)[1] and Embedded [2].
I am especially excited with new implementations popping up like [3] and [4].
[0] http://webrtcforthecurious.com
[1] https://github.com/Glimesh/broadcast-box
[2] https://github.com/sepfy/libpeer
This is really interesting! Any latency benchmarks comparing it to gstreamer UDP, P2P primarily?
This is me (Ohio) going to a Digital Ocean Droplet (NY) and back.
That’s really interesting, I must test it out sometime, 120ms is still pretty good. A previous test I did before was gstreamer (on an embedded nvidia jetson) sending to a laptop running OBS, latency as low as 40ms, but the problem is the need to use OBS on the viewer side (or gstreamer directly), but would love to integrate it within the webUI I made.
Then you can push+pull into Broadcast Box and use OBS on both sides!
In the 'Make your phone call' part of the readme, I think you might be missing the word 'see' between 'you will' and 'a log'.
I had been looking at https://github.com/livekit/sip the other day, so it hasn't been much of a surprise to now see this here. Cool integration!
This code was the prototype/how I learned SIP+WebRTC.
* Use Go's stdlib logger
* Support for DTLS Close
* Dynamic JitterBuffer in pion/interceptor
* Congestion Controller just for Simulcast flows (right now we just have GCC)
I will type up the list soon! I have been working more on OBS WebRTC recently, haven't given Pion the love it deserves :(
The interesting part is how the signalling is happening between the sipgo server and the browser. You copy your session description from the browser and paste it to the server! In a "real" application, you could send it over a custom API call or something, or you could use a standard protocol for initiating sessions (SIP!).
This is all to say, "bridging" between SIP and WebRTC is not nearly as magical as it is often made out to be. In some cases, the media can even be passed through without modification. (Although many SIP endpoints do not support e2ee and so a B2BUA is still needed to wrap/unwrap the encryption.) We were doing this a decade ago with SIP.js and OverSIP.
100% agree. That is what I have been trying to solve with Pion/WebRTC for the Curious. It is portrayed as being harder then it is. Why people do that I don't know. It causes lots of problems though.
* Developers are hesitant to get into WebRTC/VoIP because they think they couldn't figure it out
* Companies are pushing proprietary alternatives and saying 'existing protocols are impossible to use'
I am sure that some wonderful ideas never got built because the education/community just wasn't welcoming enough.
I am closely involved with Kamailio, and I believe its websocket module, meant to effectuate this functionality, was introduced somewhere in the 2011-13 time frame.
While of course the ecosystem can always stand to be richer, there's nothing new here.
Side note: "WebRTC to SIP" isn't an especially intelligible formulation, as WebRTC does not prescribe a signaling protocol. SIP can be used on the browser side, and often is (for interoperability benefits both real and imagined), but needn't be necessarily.
Instead of configuring a server you are given primitives (SIP and WebRTC in this case). I find this powerful when trying to implement use cases that go off the beaten path. I think a lot of the RTC software of this generation is a reaction to that.
----
> "WebRTC to SIP" isn't an especially intelligible formulation
This is the language I see most developers and customer use. What do you think a < 10 char name would be?
----
I don't think this attitude is healthy for the space. If I was a new developer looking at different spaces this would make me not want to be in VoIP/RTC. The goal of my example was to get people excited and try to make WebRTC and SIP more accessible. What did you hope to accomplish with saying "others having been doing this for a decade" and "isn't an especially intelligible formulation"?
The charitable interpretation is that the point is to let people know that there are several ways to do something similar, and there are off-the-shelf modules that can be used to accomplish it, if you don't want to use a browser. (The less charitable, but understandable interpretation probably runs along the lines of, "we've been doing this for a decade and it's frustrating that we haven't gotten enough recognition for it, to the point that the subject of this HN post seems to be striking people as quite unlike anything others have done before".)
> and "isn't an especially intelligible formulation"?
I think that's just typical nerd pedantry. As someone who has worked in this space (I co-built the WebRTC bits of Twilio's browser voice product back in 2012, including building a server-side implementation of WebRTC when none existed [at least not in a form we could use], and bridged that to our internal SIP-based voice infrastructure), I'm vaguely sympathetic to the desire for precision. It is correct to say that you can't bridge "WebRTC" to "SIP"; as I'm sure you know after the work you've done, WebRTC is a RTP-based media stack mated with STUN/TURN that happens to use SDP to describe voice/video sessions, while SIP is a signaling protocol that doesn't really specify anything about media.
I'm not sure I'd agree that most developers and customers use the language you assert, but admittedly I've been out of that space for a good 7 years at this point. Regardless, I think it's valuable to understand -- for perhaps the hypothetical someone new coming into the space that you bring up -- what WebRTC and SIP actually are, and that you can even use SIP to set up WebRTC sessions without any sort of bridging to other infrastructure.
I think that's a fair digestion of the force behind the tenor of my comment, which I would otherwise agree is perhaps a bit harsh.
> I think that's just typical nerd pedantry [...] It is correct to say that you can't bridge "WebRTC" to "SIP"
It's a bit ironic to me because I come from a humanities background, leading to amusing - and sometimes infuriating - cultural clashes with nerds and their pedantry, since I'm very comfortable gesturing at commonsensical understandings of things and being what programmers would consider "vague". I often grouse about needless nerd pedantry myself.
Nevertheless, telecom is about rigourous and labouriously articulated standards, and always has been. I think you correctly discern a note of displeasure in the way that people with this kind of metaphysic see the socialisation of RTC technology into the web economy. It's a bit like how Node is seen by classical systems programmers to be a psy-op meant to convince JS UI developers that they can write robust backend code. It does the job well enough, but sometimes you have to actually know things.
Yes, in short, I think that conflating "WebRTC" and "SIP" in this manner, and popularising this crude understanding of the various parts and where they fit, does not so much further productive adoption and public understanding as hinder it. In the case of RTC in particular, where tolerances are lower and robustness is paramount, taking the shortest path to democratisation of the most general QuickStart Guide may not be the best thing to do. We see the consequences of this every day on the mailing lists of the various open-source building blocks previously mentioned, as well as others, like JsSIP and SIP.js.
If I get a number via Twillio/$X is the receiver of the call able to tell? I haven't spent a lot of time with SIP and POTS stuff. All my time has been WebRTC and got into SIP for work.
I hate that the fraudsters make it so that we Can't Have Nice Things, but I also see why and if anything we need more ways to add costs (calibrated to be manageable to spend once, but costly if you get banned daily) for account creation in a lot of places.
To get a little deeper into it, Twilio (in Canada at least) doesn’t often own the NPA-NXX block either. Around where I am, the blocks are generally owned by IrisTel, who is a SIP provider in their own right. An old client of mine that had a data residency/privacy issue (their client required all of their data to be processed in Canada) ended up provisioning some numbers directly with IrisTel and doing that integration using FreeSWITCH.
The provider information isn't encoded in the calls themselves, there's essentially a (number of) centralized databases that can be queried to get provider information, out of band.
Now, there's more regulatory teeth to go after the shady providers allowing this traffic.
Unfortunately, yes. After I ported my number from at&t to google voice, a lot of services refused to accept it. Requiring SMS 2FA with an non-VOIP number seems to be a common anti-spam measure these days. It's often required for new accounts
SMS is woefully insecure for multi-factor authentication, when we have TOTP and other open standards that work with local-only password managers.
It's because it's super cheap and simple, though, and that's about it.
``` Asterisk -> Bridge -> WebRTC Service ```
You could do it all in Asterisk you will just have to write a fair amount of C code! It's been years since I have done that though. Reach out on https://pion.ly/slack and would love to help :)
We use Kamailio's WebRTC implementation heavily in Kazoo along with our libwebphone client. The transport is abstracted so Kazoo deals with the device and its configs; the Kamailio instance the browser connects to does the TLS termination for WebRTC. FreeSWITCH has the smarts for the SDP DTLS bits. And it all just works real nice together.
Or could add the logic from mobile browsers to recognize phone numbers and make them into links.
Now anyone is able to use that SIP server to relay messages to you so long as you listen on the right ports. This could be useful for highly restrictive NATs like symmetric NATs that only reuse external mappings if an inbound connection uses the same IP and port (more applicable for UDP.) If you can get one, just ONE message to a peer then you can use it to exchange information on strategies to connect directly to them. E.g. TCP hole punching.
There are a metric crap load of SIP servers out there and any one of them would effectively enable you to exchange information with a symmetric NAT and certain firewalls. I think I did basic tests for this ages ago between multiple Internet connections and it seemed to work. So I think this has potential in p2p networking and decentralized apps.