
WebRTC gateways are essentially bridges that connect WebRTC-enabled applications with traditional communication infrastructure. They allow for seamless communication between different networks and devices.
WebRTC gateways can be deployed in various environments, including on-premises, cloud, or hybrid models. This flexibility is particularly useful for businesses with diverse network setups.
One of the key benefits of WebRTC gateways is that they enable real-time communication between users, regardless of their location or device. This is made possible by the gateway's ability to handle WebRTC signaling and media processing.
WebRTC gateways can also be used to integrate WebRTC capabilities with existing communication systems, such as SIP or H.323 networks.
What Is a Gateway?
A WebRTC gateway is essentially a bridge between the Web and traditional telecom worlds. It sits at the intersection of a conventional IP-based communications network and the Internet, providing signaling interworking, media interworking and transcoding, and application interworking functions.
This bridge enables communication between WebRTC-enabled devices or applications and traditional communication technologies, such as the Public Switched Telephone Network (PSTN) or Voice over IP (VoIP) networks. WebRTC gateways facilitate communication between WebRTC-enabled devices or applications and the traditional PSTN or VoIP networks.
Here's an interesting read: Azure Local Network Gateway
They handle the conversion of signaling and media streams between WebRTC protocols and the protocols used in traditional telephony or VoIP systems. WebRTC gateways perform protocol conversion between WebRTC signaling protocols, such as Session Initiation Protocol (SIP) or WebSocket, and the signaling protocols used in PSTN or VoIP networks, such as ISDN, SIP, or H.323.
This allows for seamless communication and call control between WebRTC and traditional communication systems. WebRTC gateways can be delivered in the form of a turn-key appliance or a software-based solution that runs industry-standard servers (typically virtualized x86 platforms running some version of Linux).
Some of the key functions of a WebRTC gateway include:
- WebRTC and PSTN/VoIP Interoperability: facilitating communication between WebRTC-enabled devices or applications and traditional PSTN or VoIP networks
- Signaling Protocol Conversion: converting between WebRTC signaling protocols and traditional telephony or VoIP protocols
- Media Stream Interworking: converting between WebRTC codecs and traditional telephony or VoIP codecs
- Call Routing and Control: handling call setup, call termination, call hold, call transfer, and call forwarding
- Security and Network Address Translation (NAT) Traversal: providing security features and addressing NAT traversal challenges
- Scalability and Load Balancing: handling high volumes of WebRTC traffic and distributing traffic across multiple instances
- Integration with Value-Added Services: integrating with value-added services or applications, such as call recording or conferencing
Applications
WebRTC gateways open up a world of possibilities for various stakeholders, including enterprise IT organizations, service providers, system integrators, and software developers.
They enable mobile clients for enterprises, allowing businesses to extend corporate communications services to smartphone or tablet users as part of BYOD programs or fixed-mobile convergence initiatives.
Businesses can eliminate the expense and administrative complexity of proprietary UC clients by extending enterprise communications capabilities directly to the browser.
This can also reduce international mobile roaming fees and calling costs by enabling Wi-Fi calling.
Communications service providers can implement Rich Communication Services (RCS) clients and Over-the-Top (OTT) clients using WebRTC gateways.
RCS and OTT services can help communications service providers improve margins, combat competitive threats, extend service reach, and drive additional traffic onto home networks.
Businesses can add voice, video, or chat to customer-facing Web sites or mobile apps to improve customer interactions, reduce website abandonment, and increase customer loyalty and revenue.
Here are some examples of WebRTC-enabled applications:
- Mobile clients for enterprises
- Service provider RCS and OTT clients
- Communications-enabled Web apps
- On-line meetings and conferencing services
- Communications-enabled business processes
These applications can help enterprises and service providers streamline workflows, increase productivity, and improve decision making by integrating real-time communications capabilities directly into enterprise applications and business processes.
Protocols
When choosing or implementing a WebRTC implementation, you should ask yourself if you can avoid re-inventing the wheel.
You can take the Chrome stack and start from there, but I chose to write something new from scratch. There are several open source libraries you can re-use, such as openssl (C/C++) or BouncyCastle (Java) for DTLS-SRTP.
Libraries like libnice (C/C++), pjnath (C/C++), or ice4j (Java) can help with ICE/STUN/TURN, and libsrtp can help with SRTP.
Preparing yourself for every situation, like acting as a DTLS server or client, is crucial, and you'll need to interact with all compliant implementations according to the WebRTC specs.
Things get harder when it comes to SDP, as not all libraries support the attributes and features needed for WebRTC.
For Janus, I used Sofia-SDP as a stack for parsing session descriptions, while manually generating them instead of relying on a library.
Media
At the media level, you can do just about anything you want with the RTP/RTCP libraries you reuse.
You may want to record the frames a peer is sending, or reflect them around for a webinar or conference.
Transcoding them and sending them somewhere else is also an option.
You can even translate RTP and the transported media to and from a different protocol or format.
Receiving some media from an external source and sending it to a WebRTC endpoint is another possibility.
RTCP in particular needs special care, especially if you're bridging WebRTC peers through the gateway.
RTCP messages are tightly coupled with the RTP session they're related to, so you have to translate the messages going back and forth if you want them to keep their meaning.
Considering a gateway is a WebRTC-compliant endpoint, you may also want to take care of the RTCP messages yourself.
This could involve retransmitting RTP packets when you get a NACK, or adapting the bandwidth on reception of a REMB.
You may also need to keep the WebRTC peer up-to-date on the status of the connection by sending proper feedback.
On a similar theme: Media Gateway
Signalling
When designing a WebRTC gateway, you have the freedom to choose the signalling protocol that best fits your requirements.
WebRTC doesn't mandate a specific signalling protocol, so you can pick the one that works best for you. Several implementations rely on SIP, which is a natural choice when bridging to existing SIP infrastructures.
SIP is a popular choice for bridging to existing SIP infrastructures, but it's not the only option. Others make use of alternative protocols like XMPP/Jingle.
An ad-hoc protocol based on JSON or XML can also be a good choice, as it leaves you the greatest freedom when it comes to designing a bridge to other technologies.
Ultimately, the choice of signalling protocol depends on what you want your gateway to do and what you're most comfortable with.
Consider reading: SIP Trunking
Gateways and Integration
Gateways can be useful in extending the one-to-one/full-mesh paradigm among peers.
Existing legacy infrastructures, like SIP, can benefit from a WebRTC-enabled kind of access. Most legacy components don't support media encryption, but WebRTC mandates the use of DTLS for secure media connections.
Legacy infrastructures often rely on simpler approaches like Hosted Nat Traversal (HNT) in SBCs, separate even/odd ports for RTP and RTCP, and basic RFC3550 RTCP statistics and messages.
WebRTC endpoints use ICE for NAT traversal, RTCP feedback messages, and RTP/RTCP muxing, which can cause incompatibilities with existing infrastructures.
BUNDLE, Trickle ICE, new codecs, Data Channels, and WebSockets can add complexity and incompatibility with legacy components.
Existing infrastructures usually expect protocols like BFCP or MSRP to be transported on TCP and/or UDP, negotiated the old-fashioned way.
For your interest: Azure Nat Gateway
Importance and Basics
A WebRTC gateway is essentially a bridge that connects different networks and protocols, allowing for real-time communication between them. It enables users to communicate with each other across different networks and devices.
WebRTC gateways are designed to handle the complexities of real-time communication, including audio and video streaming, and data transfer. They can be deployed on-premises or in the cloud.
One of the key benefits of a WebRTC gateway is that it allows for secure and encrypted communication between users. This is achieved through the use of protocols such as DTLS and SRTP.
WebRTC gateways also provide a scalable solution for real-time communication, allowing businesses to handle a large number of users and connections. This makes them ideal for applications such as video conferencing and live streaming.
Featured Images: pexels.com


