WebRTC

Modified on Fri, 5 Sep at 10:30 AM

Web Real-Time Communications (WebRTC) — is an open-source technology for voice, text, and video communication in real-time through browsers over an IP network.

How it Works

  • WebRTC is built into all modern browsers (Chrome, Firefox, Safari, Edge) and provides JavaScript APIs for developers.
  • To establish a direct peer-to-peer (P2P) connection, especially between devices behind firewalls (NAT), it uses special servers:
    • STUN: Helps a device discover its public IP address.
    • TURN: Relays traffic if a direct P2P connection fails (using the ICE protocol).
  1. Client selection — Use any WebRTC-compatible client.

    ClientPlatformFeatures
    JsSIPBrowserNo installation required, works in browser
    LinphoneWindows, macOS, Linux, iOS, AndroidMulti-platform, open source
    Jitsi MeetAll platformsFor conferences and video calls
    SiperbiOSOptimized for iPhone/iPad
     
  2. Data is available in the KOMPaaS Account in the ‘Telephony’ section → 'SIP settings' tab:

    • Login and Password.

    • Server: webrtc.kompaas.tech

    • Port (WebRTC WSS): 35060 

  3. As a result, the connection string will look like this:
    wss://webrtc.kompaas.tech:35060
    


Example with JsSIP (open-source WebRTC softphone for browser).

import JsSIP from 'jssip';

// Specify WebRTC socket
const socket = new JsSIP.WebSocketInterface('wss://webrtc.kompaas.tech:35060');

// SIP account configuration
const configuration = {
  sockets  : [ socket ],
  uri      : 'sip:36XXXXXXXXX@webrtc.kompaas.tech', // login from personal account
  password : 'your_SIP_password'
};

// Create SIP agent
const ua = new JsSIP.UA(configuration);

// Start
ua.start();

// Register events
ua.on('connected', () => console.log('Connected to KOMPaaS'));
ua.on('registered', () => console.log('SIP registration successful'));
ua.on('newRTCSession', (data) => {
  console.log('New call:', data);
});



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article