Tag Archives: JavaScript

WebRTC SIP / IMS solution

We started in winters on 2012 with Webrtc . At time time it just looked like a new tech jargon that might fade away when new ones comes . In many many WebRTC’s buzz has died down since its massive adoption. But i nevertheless still see a lot of potential and development around it.

What really is WebRTC ? I made an entry on it  here .

Around nov – dec 2012 , team and I spend the time learning the nitty-grities of HTML5 based media operation and Javascript sip stack of SIPML. I remember toward the end of the year ie before Christmas , We were done with the explanation and education aspects of WebRTC , a technology that will revolutionise communication in ages to come , at-least so says the numerous other blogs ,  and documents i read so far .


Usecases for WebRTC range across a wide variety , of them the most revenue generating ones are around video conferencing with realtime HD audio-video-data streams ,

To bridge the flow between a webrtc client to a PSTN endpoint via IMS , interworking between webrtc media standards and codecs with that of gateways in IMS is critical . For instance WebRTC mandates secure RTP ( SRTP) the media engine / gateway should be able to support and connect with RTP from PSTN endpoints.

client BOB -> webrtc2sip Gateway -> SIP server -> client Alice

can be  understood with the callflow of a simple SIP Invite initiated from one html page towards another which passes through the configuration of gateway to IMS world ,  SIP Telecom Application server , Database , nodes of IMS environment etc.

For the purpose of a simple Explanation a simplified call flow ca be depicted as ,

webrtccallflow

A very high level architecture of solution deployment in IMS world could be

solution arch2

As the solution matures into a full fleshed project . The alpha version has been released with the following feature set . The WebRTC platform Suite offers a easily deploy-able solution to enable communication

Alpha Release WebRTC platform Suite

Single Sign On
Login with id and password to access all services
Audio / Video Call
Call Hold / Call Transfer
Messaging:
SIP Instant Messaging
Message to Facebook Messenger
Message delivered as Email
Chatroom :
group chat between multiple users . Room is created for set of users .
Video Conferencing :
video chat between multiple parties . Room is created for set of users .
File Transfer :
Sharing of files from local to remote , in peer-to-peer and broadcasting fashion .
Third party Webservices :
Widgets like calendar , weather , stocks , twitter are embedded.
Visual Voice Mail :
Record and deliver voice message to recipients voice mail inbox which can be accessed/ played from web client .
Phonebook :
cloud integration
add new entries
add photos to contacts identity
import contacts from google account
Click to Call :
Drop down list of contacts form mail call console
2 step Click to call from Phonebook
Presence :
Publish online / offline status
Use Subscribe / notify requests of SIP
WS to SIP Gateway :
Conversion between the signal coming from the WebRTC and SIP client to the IMS core
Conversion of “voice/video ” media between sRTP and RTP
Conversion of other media (data channel) towards MSRP and Transcoding.
Support of ICE procedure .
Implementation of a STUN server.
QoS Support

Beta Release WEBRTC PLATFORM SUITE

Logs :
calls logs
Message logs
User Profile :
user details like address , email and social networking accounts
Phonenumber for GSM integration through SMS
User’s Media storage like Pictures , profile picture , Audio , video
File sharing documents storage for future access in the same format
Real Time and Offline Analytics
service usage with graphical and tabular history trends
Session Management :
Single Sign-on
Forgot password regeneration using secure question
Registration of new user account
Logout and clearance of session parameters
Security :
No redirection to any page through url entry without valid session
No going back to home page after logout by back button on browser
No data vulnerability
Multiple login through different devices handled
OAuth :
Login via IMAP / token through facebook and Google
Phonebook with Presence functionality inbuild .
Directory Service based on country / region
Geolocation of approximate location detection of device logged in and visibility to others

webrtc solution
WebRTC client deployment view , accessible devices , network elements
WebRTC deploymenet overview and inetraction with other network elemets such as gateway , cloud storage ,  sipserver , IMS
WebRTC deploymenet overview and inetraction with other network elemets such as gateway , cloud storage , sipserver , IMS

Commercial release features specs for WebRTC over IMS

Integration with new age CSP deployments like VoLTE, ViLTE, VoWiFi
Multi vendor support
Interactive webrtc services
Media Services
Automated Natural language Speech recognition
Semantic processing via ML
Enhanced incall services replacing IVR ( touch -tone)
VQE (voice Quality Enhancements)
Encoding and Decoding – Multiple Codec Support ,
Transcoding ,
Silence Suppression ,
Security via TLS , encryption and AAA
Http , NFS caching
NAT
Recording , playback and media file compression
active frame selection
DTMF
Audio
mixing ,
announcements ,
filters ,
gain control ,
speakers notification ,
Narrowband, Wideband, and Super Wideband ,
dynamic sample rate
Video
continuous presence ,
floor control ,
video lipsync ,
speaker tile selection
VQE
Acoustic Echo Cancelation ,
noise reduction,
noise line detection,
noise gating ,
Packet Loss concealment
Call analyics
progress analysis
MOS , R-factor ( derived from latency , jitter , packet loss )
CDR (Call detail records ) and accounting
Lawful interception

Updating this article 2019

There was a long journey from traditional telecom architectures to NFV cloud based architectures ( like openstack). supported over web , 4G , LTE or other upcoming networks. Many OTT providers prefer using the public cloud over a NFV data centre.

Multinode / Multiedge computing platforms like Media Resource Function are expected to meet the need for quick delivery with additional features like hardware accelerated media , algorithms for optimised data flow (packetization, decongesting , security ) etc . With th decomposed architecture they can better utilise the

  • CPU – contains couple of cores optimised for sequential serial processing such as   graphics or video processing
  • GPU – contains many smaller cores to accelerate creation of images for computer display . Can include texture mapping, image rotation, translation, shading or more enhanced features like motion compensation, calculation of inverse DCT, etc. for accelerated video decoding.
  • DSP- processing data representing analog signals

Although IMS based solutions are more suited to telephony applications and CSPs ( Communication service providers like telecom companies ) but similar or same architectures are widely finding their into newer developed cloud communications solutions supporting tens of millions of subscribers and hyper scale deployment . It could be around applications such as

  • HD (High Definition ) calls
  • UCC ( conf , draw-board, speech recognition , realtime streaming)
  • immersive experiences ( Augmented reality , virtual reality , face recognition , tracking )
  • contextual communication ( transcription etc)
  • video content delivery with deep media analytics

Demand these says is for a decentralised system of pool of servers ( media and signalling ) that can scale independently to match up to peak traffic at any moment , with ofcourse carrier class performance . Not only these flexible solutions reduce complexity but also OpEX .

Ref:

what is WebRTC ?

webrtc draft

What is WebRTC ?

  • API definition

WebRTC (Web Real-Time Communication) is an API definition drafted by the World Wide Web Consortium (W3C) that supportsbrowser-to-browser applications for voice calling, video chat, and P2P file sharing without the need of either internal or externalplugins.[

  • Enables browser to browser applications for voice calling, video chat and P2P file sharing without plugins.
  • Awaiting standardization , on a API level at the W3C and at the protocol level at the IETF.
  • Enables web browsers with Real-Time Communications (RTC) capabilities
  • Free, open project
 The following is the browser side stack for webrtc media .
 WebRTC media stack Solution Architecture

Core technologies:

  •  WEBM codecs 
  • Javascript functions  to access and process the browser media stack
  • HTML5  to embed the video and audio elements .
  • Signalling 

Why is Web RTC importatnt ?

Significantly better video quality WebRTC video quality is noticeably better than Flash.
Up to 6x faster connection times Using JavaScript WebSockets, also an HTML5 standard, improves session connection times and accelerates delivery of other OpenTok events.
Reduced audio/video latency WebRTC offers significant improvements in latency through WebRTC, enabling more natural and effortless conversations.
Freedom from Flash With WebRTC and JavaScript WebSockets, you no longer need to rely on Flash for browser-based RTC.
Native HTML5 elements Customize the look and feel and work with video like you would any other element on a web page with the new video tag in HTML5.

The major players behind conception and advancement of WebRTC standards and libraries are  :webrtc players icon

IETF , w3C , Java community , GSMA .
The idea is to develop a Light -weight browser based call console , to make SIP calls from Web page .This was successfully achieved using fundamental technologies as Javascript , html5 , web-sockts  and TCP /UDP , open source sip server.It is good to note that there is no extra extension, plugin or gateway required , such as flash support  .Also it bears cross platform support ,  including Mozilla , chrome so on .

 Peer to peer Communication

 WebRTC forms a p2p communication channel between all the peers . that means as the participant count grows  , it converts to  a mesh networking topology with incoming and outgoing stream towards direction of each of its peers .

Two party call p2p

two party call

Multiparty Call and mesh network

Multiparty party call
In special case of broadcasting or  large number of viewers ( without outgoing media stream ) it is recommended to setup a Media Control Unit ( MCU) which will replay the incoming stream to large number of users without putting traffic load on the clients from where the stream is actually originating .
Important note :  
1.It should be notes that these diagrams do not depict the ICE and NAT traversal and have been simplifies for better understanding. In real world scenarios there is almost all the time a STUN and TURN server involved .

More on TURN Servers is given here : NAT traversal using STUN and TURN

2.Also the webrtc mandates the use of secure origin ( https ) on the webpage which invoke getusermedia to capture user media devices like audio , video and location .

Read more in the layers of webrtc  and their functionalities here :  WebRTC layers

webrtc_development_logowebrtcdevelopment
Open Source WebRTC SDK and its implementation steps https://github.com/altanai/webrtc

WebRTC layers

WebRTC stands for Web Real-Time Communications and  introduces  a real-time media framework in the browser core alongside associated JavaScript APIs for controlling the media frame and HTML5 tags for displaying.

From a technical point of view, WebRTC will hide all the complexity of real-time media behind a very simple JavaScript API . 

WebRTC simplified :

In simple words its a phenomenal thing , that will revolutionize internet telephony .  Also it will emerge to be platform independent ( ie any browser , any desktop operating system any mobile Operating system ) .

WebRTC allows anybody to introduce real-time communication to their web page as simply as introducing a table.

Codec Confusion :

Audiio Codecs

Currently VP8 is the codec of choice since it is royalty free. In mobility today, the codec of choice is h264. H264 is not royalty free. But it is native in most mobile handsets due to its high performance.

Voice Codecs

Opus is a lossy audio compression format developed by the Internet Engineering Task Force (IETF) targeting a broad range of interactive real-time applications over the Internet, from speech to music. As an open format standardized through RFC
6716, a reference implementation is provided under the 3-clause BSD license. All known software patents Which cover Opus are licensed under royalty-free terms.
G.711 is an ITU (International Telecommunications Union) standard for  audio compression. It is primarily used in telephony. The standard was released in 1972. It is the required standard in many voice-based systems  and technologies, for example in H.320 and H.323 specifications.
Speex is a patent-free audio compression format designed for speech and also  a free software speech codec that is used in VoIP applications and podcasts. Some consider Speex obsolete, with Opus as its official successor, but since
significant content is out there using Speex, it will not disappear anytime soon.
G.722 is an ITU standard 7 kHz Wideband audio codec operating at 48, 56 and 64 kbit/s. It was approved by ITU-T in 1988. G722 provides improved speech quality due to a wider speech bandwidth of up to 50-7000 Hz compared to G.711 of 300–3400 Hz.

AMR-WB Adaptive Multi-rate Wideband is a patented wideband speech coding standard that provides improved speech quality due to a wider speech bandwidth of 50–7000 Hz. Its data rate is between 6-12 kbit/s, and the codec is generally available on mobile phones.

Architecture :

WebRTC offers web application developers the ability to write rich, realtime multimedia applications (think video chat) on the web, without requiring plugins, downloads or installs. It’s purpose is to help build a strong RTC platform that works across multiple web browsers, across multiple platforms.

WebRTCpublicdiagramforwebsite

Web API – An API to be used by third party developers for developing web based videochat-like applications.

WebRTC Native C++ API – An API layer that enables browser makers to easily implement the Web API proposal.

Transport / Session

The session components are built by re-using components from libjingle, without using or requiring the xmpp/jingle protocol.

RTP Stack – A network stack for RTP, the Real Time Protocol.

STUN/ICE – A component allowing calls to use the STUN and ICE mechanisms to establish connections across various types of networks.

Session Management

An abstracted session layer, allowing for call setup and management layer. This leaves the protocol implementation decision to the application developer.

VoiceEngine

VoiceEngine is a framework for the audio media chain, from sound card to the network.

iSAC / iLBC / Opus

iSAC: A wideband and super wideband audio codec for VoIP and streaming audio. iSAC uses 16 kHz or 32 kHz sampling frequency with an adaptive and variable bit rate of 12 to 52 kbps.

iLBC: A narrowband speech codec for VoIP and streaming audio. Uses 8 kHz sampling frequency with a bitrate of 15.2 kbps for 20ms frames and 13.33 kbps for 30ms frames. Defined by IETF RFCs 3951 and 3952.

Opus: Supports constant and variable bitrate encoding from 6 kbit/s to 510 kbit/s, frame sizes from 2.5 ms to 60 ms, and various sampling rates from 8 kHz (with 4 kHz bandwidth) to 48 kHz (with 20 kHz bandwidth, where the entire hearing range of the human auditory system can be reproduced). Defined by IETF RFC 6176.

NetEQ for Voice– A dynamic jitter buffer and error concealment algorithm used for concealing the negative effects of network jitter and packet loss. Keeps latency as low as possible while maintaining the highest voice quality.

Acoustic Echo Canceler (AEC) – The Acoustic Echo Canceler is a software based signal processing component that removes, in real time, the acoustic echo resulting from the voice being played out coming into the active microphone.

Noise Reduction (NR) -The Noise Reduction component is a software based signal processing component that removes certain types of background noise usually associated with VoIP. (Hiss, fan noise, etc…)

VideoEngine 

VideoEngine is a framework video media chain for video, from camera to the network, and from network to the screen.

VP8 –Video codec from the WebM Project. Well suited for RTC as it is designed for low latency.
Video Jitter Buffer – Dynamic Jitter Buffer for video. Helps conceal the effects of jitter and packet loss on overall video quality.
Image enhancements -For example, removes video noise from the image capture by the webcam.


w3c

—Media Stream Functions

—API for connecting processing functions to media devices and network connections, including media manipulation functions.

—Audio Stream Functions

—An extension of the Media Stream Functions to process audio streams (e.g. automatic gain control, mute functions and echo cancellation).

—Video Stream Functions

—An extension of the Media Stream Functions to process video streams (e.g. bandwidth limiting, image manipulation or “video mute“).

Functional Component Functions

—API to query presence of WebRTC components in an implementation, instantiate them, and connect them to media streams.

—P2P Connection Functions

—API functions to support establishing signalling protocol agnostic peer-to-peer connections between Web browsers

  • API specification Availability

WebRTC 1.0: Real-time Communication Between Browsers –  Draft 3 June 2013 available

  • -Implementation Library: WebRTC Native APIs

Media Capture and Streams – Draft 16 May 2013

  • Supported by Chrome , Firefox , Opera in desktop of all OS ( Linux , Windows , Mac )
  • Supported by Chrome , Firefox  in Mobile browsers ( android )

ietf

  • —Communication model
  • —Security model
  • —Firewall and NAT traversal
  • —Media functions
  • —Functionality such as media codecs, security algorithms, etc.,
  • —Media formats
  • —Transport of non media data between clients
  • —Input to W3C for APIs development
  • Interworking with legacy VoIP equipment

WG RFC   Date

  • draft-ietf-rtcweb-audio-02      2013-08-02
  • draft-ietf-rtcweb-data-channel-05      2013-07-15
  • draft-ietf-rtcweb-data-protocol-00      2013-07-15
  • draft-ietf-rtcweb-jsep-03      2013-02-27
  • draft-ietf-rtcweb-overview-07      2013-08-14
  • draft-ietf-rtcweb-rtp-usage-07     2013-07-15
  • draft-ietf-rtcweb-security-05      2013-07-15
  • draft-ietf-rtcweb-security-arch-07      2013-07-15
  • draft-ietf-rtcweb-transports-00      2013-08-19
  • draft-ietf-rtcweb-use-cases-and-reqs-11      2013-06-27
  • Plus over 20 discussion RFC drafts

Next -> webRTC business benefits