WebRTC CPaaS ( Communication Platform as a Service )


A CPasS ( communication platform as a service ) is a cloud-based communication platform like B2B cloud communications platform that provides real-time communication capabilities. This should be easily integrable with any given external environment or application of the customer, without him worrying about building backend infrastructure or interfaces. Traditionally, with IP protected protocols, licensed codecs maintaining a signalling protocol stack, and network interfaces building a communication platform was a costly affair. Cisco, Facetime, and Skype were the only OTT ( over the top) players taking away from the telco’s call revenue. However, with the advent of standardised, open-source protocol and codecs plenty of CPaaS providers have crowded the market making more supply than there is demand. A customer wanting to quickly integrate real-time communications on his platform has many options to choose from. This article provides an insight into how CPaaS solutions are architectured and programmed.

SIP based Communication Platform as a Service

SIP and WebRTC are many a times closely knit together as protocl, and media plane techologies to build a communication platform such as CPaaS , UCC, B2b call agent , call centre applicatioinsso on. This integration expected to continue to evolve and improve in order to meet the growing demands of users for high-quality, low-latency communication.

Sample CPass Architecture build on open source technologies

Over all Archietcture of Real Time Comunication ecosystem with Media management, CDR , processing pielines , real time analytics.

Data Streams for realtime analytics and telemetrics

There are several assessment technologies that can be used for measuring the quality of WebRTC (Web Real-Time Communications) calls, including:

  1. Mean Opinion Score (MOS): A standardized method for measuring the quality of voice and video calls, based on human perception.
  2. Packet loss and jitter: Measures the amount of packet loss and variation in packet arrival times, which can impact the quality of a call.
  3. Round-trip time (RTT): Measures the time it takes for a packet to travel from the sender to the receiver and back, which can affect the delay in a call.
  4. Bitrate: Denotes the amount of data that is transmitted during a call, which can impact the quality of the audio and video.
  5. Codecs chosen can impact the quality and bandwidth requirements of the call.
  6. Network conditions
  7. Quality of Service (QoS): Measures the quality of the network connection and the ability of the network to support real-time communications.
  8. WebRTC specific metrics: such as video resolution, frames per seconds, audio level, and so on.
  9. PESQ (Perceptual Evaluation of Speech Quality)  predict subjective opinion scores of a degraded audio such as warping , varioioable delays
  10. PSR( Peak signal to noise ration)

These technologies can be used in combination to provide a comprehensive assessment of the quality of a WebRTC call and to identify any issues that may be impacting the call quality.

I have written an article before on Steps for building and deploying WebRTC solution , which includes standalone, cloud hosted and TURN based NAT handler systems .

A typical CPaaS solution provides

  • Call server + Media Server that can be interacted with via UA
  • Comm clients like sipphones , webrtc client , SDK ( software development kits ) or libraries for desktop , embedded and/or mobile platforms .
  • APIs that can trigger automated calls and perform preprogrammed routing.
  • Rich documentation and samples to build various apps such as call centre solutions , interactive auto-attendant using IVR , DTMF , conference solutions etc .
  • Some CPaaS providers also add features like transcribing ,transcoding, recording , playback etc to provide edge over other CPaaS providers

Self hosted Datacentre vs Cloud server

Self hosted in DatacentreCloud server
Cost(-) Self-hosted datacenters can be more expensive to set up and maintain, as they require the purchase of hardware and ongoing maintenance costs.
(+) no monthly recurring fees to cloud vendors
(+) pay as you go
Scalability(-) maintenance of racks and servers
(-) requires planning for high availability and geographical deployment for redundancy
(+) no stress on resource management like cooling, rack space , wiring etc
(+) easy to setup
Reliability(-) limited to a single location and can be affected by local issues such as power outages.Cloud providers typically have multiple data centers and will automatically route traffic.
(-) outages in cloud infrastructures datacentre could lead to service disruption
Control and Security(+) more controlled for security or access(-) not in premise, security can be provisonoed by not in control

Cloud-based infrastructure 

Cloud Services as Amazon Web service, Google Cloud, Microsoft Azure, IBM Cloud, Digital Ocean is great resources to host the multiple parts of a CPaaS system such as gateways, media servers, SIP Application servers, other servers for microservices including accounting, profile management, rest services etc. Often virtualized machines ( VMs) mounted on a larger physical remote datacentre are an ideal choice for VoIP and cloud communication providers.

Self hosted / inpremises Servers / private cloud

Marinating datacentre provides flexibility to extend and or develop tightly controlled use cases. It is often a requirement for secure communication platforms pertaining to government or banking communications such as turret phones.

Some approaches are to set up the server with Openstack to manage SDN ( software-defined network). Other approaches also involve VMWare to virtualize servers and then using docker container-managed via Kubernetes to dynamically spawn instances of server as load scaled up or down.

Using existing SDK vs building your own RTC platform from scratch

I have come across so many small size startups trying to build CPaaS solutions from scratch but only realising it after weeks of trying to build an MVP that they are stuck with firewall, NAT, media quality or interoperability issues. Since there are so many solutions already out in the market it is best to instead use them as an underlying layer and build applications services using it such as call centre or CRM services making custom wrappers.

Tech insights and experiences

Companies who have been catering to telco and communication domain make robust solutions based on industry best practices which beats novice solution build in a fortnight anyday.

Keeping up with emerging trends

Market trends like new codecs , rich communication services , multi tenancy, contextual communication , NLP, other ML based enhancements are provided by CPaaS company and would potentially try to abstrct away the implementation details from their SDK users or clients.

Auto Scaling, High Availability

A firm specializing in CPaaS solution has already thought of clustering and autoscaling to meet peak traffic requirements and backup/replication on standby servers to activate incase of failure

CAPEX and OPEX

Using a CPaaS saves on human resources, infrastructure, and time to market. It saves tremendously on underlying IT infrastructure and many a times provides flexible pricing models.

Call Rate charging and Accounting Services

Call Rates are very critical for billing and charging the users. Any updates from the customer or carriers or individuals need to propagate automatically and quickly to avoid discrepancies and negative margins.

CDR ( Call Detail Record ) processing pipeline

CDRs need to be processed sequentially and incrementally on a record-by-record basis or over sliding time windows.
CDR can also be used for a wide variety of analytics including correlations, aggregations, filtering, and sampling.

Updating rate sheet ( charges per call or per second )

The following setup is ideal to use the new input rate sheet values via web UI console or POST API and propagate it quickly to the main DB via a queuing system such as SQS. Serverless operations such as using AWS lambda can be used via a trigger-based system for any updates. This ensures that any new input rates are updated in realtime and maintain fallback values in separate storage as s3 bucket too

CDR (Call Detail Record ) managemenet, billing, dispute management

In current Voip scenarios a call may be passing thorugh various telco providers , ISP and cloud telephony serviIn current VoIP scenarios, a call may be passing through various telco providers, ISP and cloud telephony service providers where each system maintains its own call records and billing. This in my opinion is duplication and missing a single source of truth. A decentralized, reliable and consistent data store via blockchain coudl potentially maintain the call records making then immutable and non diputable. Some more details on the concept are in the article below.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.