SlideShare a Scribd company logo
FreeSWITCH as a
Microservice
vs.
What we are: an MVNO/MVNE running on
the Sprint Network
What we do: rapid development cycles and
constant iteration to be a different kind of
consumer cellular company.
Quickly: What is a microservices architecture?
Quickly: What is a microservices architecture?
• Monolithic
• Simpler architecture
• Generally confined to a single language
or framework
• Scaling Inefficient
• Depth of Knowledge Required (DOKR)
can lead to substantially increased
technical debt
• Microservices
• More complex
• Decoupled services allow for more rapid
development
• Increased scalability and fault tolerance
• Knowledge need not span multiple services
• Deployment is more complex but… simpler?
That Brings Us To…
Doesn’t Live in A Bubble
Doesn’t Live in A Bubble
• Billing
• Fraud Management
• Call Tracking & Analytics
• Performance Monitoring
• Call Quality Analysis
• Failover
• Realtime Multimodal Interaction (PSTN->WebRTC…)
Very different domains requiring very different processing
backends, language requirements, and service architectures
Simple Example
User Registration: mod_xml_curl
• Queries a remote API for registration information
• API uses business logic to decide which registrations
permissions to bestow
<binding name="directory">
<param name="gateway-url" value="https://dev.ringplus.net/endpoints" bindings="directory"/>
<param name="gateway-credentials" value="journey:foreigner" />
<param name="auth-scheme" value="basic"/>
</binding>
Works for dialplan, configuration, and phrases
Decouples SIP endpoint information
Easy migration to a mid-registrar like Kamailio
Registration
Microservice
Data
Store
HTTP
HTTP
(XML)
??? ???
if create_sip_endpoint
render :registration, status: :ok, formats: [:xml]
else
render xml: @sip_endpoint.errors, status: :unprocessable_entity
end
XML
RUBY
How About Something More
Fun
Here’s a little something.
Setting Preprocessor values: exec-set
<X-PRE-PROCESS cmd="exec-set" data="local_ip_v4 = ip addr show eth0 | awk '/inet /{print $2}' | head -n 1 | cut -d '/' -f 1"/>
Scenario: You’re starting a container and don’t know the IP
<X-PRE-PROCESS cmd="exec-set" data="internal_sip_port = echo $INTERNAL_SIP_PORT"/>
Scenario: You’re big into 12-Factor and are using lots of ENV variables
<X-PRE-PROCESS cmd="exec-set" data="rtp_start_port = /etc/freeswitch/rtp_ports_based_on_env
Scenario: It’s complicated, man. I need some real logic processing.
Go routine that queries a service to retrieve the public RTP ports for this container.
That service also opens/maps firewall and NAT ports correctly, or can really do anything.
Talking To FreeSWITCH Is Easy
Many choices of built-in modules and 3rd party libraries
• Ruby: Adhearsion (https://github.com/adhearsion/adhearsion)
• JavaScript: https://github.com/shimaore/esl
• Go: https://github.com/0x19/goesl
• Python: Python ESL
• mod_xml_rpc
• mod_verto
• etc…
What About Push?
This Sounds Complex.
Can we make this easier?
Let’s Talk About One Way To Go
• You may have heard me talk about this last year. I’m still talking about it.
• Containers should be single-process, no durable storage, ephemeral little
creatures
• Lightweight and distributable containers
• Scalability due to built in resilience and orchestration layers
• Higher packing density than virtual machines due to shared libs
Docker
DOCKER NETWORKING….
IT’S GOTTEN BETTER!
Docker Networking
• Docker 1.12 (June) allows for easy, multi-hostVXLAN routing
• Easily scale containers across nodes
• Built in state reconciliation for resilient deployments
• Orchestration is built into Docker Engine
• Includes auto-load balancing of inbound requests to multiple containers utilizing in-
kernel Linux IPVS, automaticTLS generation, and a free basket of kittens
Note: Docker is still a moving target.

• Documentation
• Best Practices
• Service Integration/Discovery
Practical Use Case
Scaling The Business Logic
Using Adhearsion for your dialplan.
- We use it for ease and rapidity of development
- Can leverage the Ruby ecosystem for gems
Problem: Ruby MRI is locked to a single CPU, so can become CPU bound
Solution: JRuby(?)
Problem Redux: Call volume on a particular node is exceeding CPU capacity due to
amazingly wonderful consumer adoption (Pokémon Go Syndrome)
Solution: Scale nodes
• FreeSWITCH is rarely the blocker but can consume enough CPU to max out
• Adhearsion communicates with mod_rayo via XMPP - many clients, one server.
CPU BOUND
Save money on the weekends ya’ll!
Scaling The Business Logic
Using Adhearsion for your dialplan.
- We use it for ease and rapidity of development
- Can leverage the Ruby ecosystem for gems
Problem: Ruby MRI is locked to a single CPU, so can become CPU bound
Solution: JRuby
Problem Redux: Call volume on a particular node is exceeding CPU capacity due to
amazingly wonderful consumer adoption (Pokémon Go Syndrome)
Solution: Scale nodes
• FreeSWITCH is rarely the blocker but can consume enough CPU to max out
• Adhearsion communicates with mod_rayo via XMPP - many clients, one server.
root@adhearsion-swarm-01:~# docker service ls
ID            NAME   REPLICAS  IMAGE                      COMMAND
ec23ck911hgc  adhearsion    20/20   ringplus/adhearsion:latest
28ght39gvfce  freeswitch   1/1       ringplus/freeswitch_v1.6:latest
root@adhearsion-swarm-01:~# docker service scale adhearsion=20
adhesion scaled to 20
FreeSWITCH
Adhearsion
NYC Datacenter
Adhearsion + FreeSWITCH
Spike Condition with DockerAdhearsion
DigitalOcean
NYC-1
NYC Datacenter
Kamailio
• Host monitoring detects low-CPU condition on Node 1
• collectd container
• Active call monitoring
• Calls Ansible to spin up a new DO container
• Adhearsion images pulled from Docker repo
• Start containers with overlay network and information on parent
FS container
• Quiesce Adhearsion on affected system
• Gracefully shutdown
• Update Kamailio MySQL DB with new dispatcher information if
FreeSWITCH scaling is necessary.
FreeSWITCH Joins
A Bunch of Microservices
FreeSWITCH
Static Assets
Voicemails
IVR
AdhearsionKafka
ELK
S3 / Gluster
Fraud API
Kafka Consumer
Billing API
Redis
Logs
WAL-E Backups
Postgres
HTTP/S, HTTPS, XMPP, XML, Go, Ruby, Elixer
RBT
Selection API
User API
NO MAGIC PILL YET.

STILL REQUIRES DEV, OPS, DEVOPS, MANAGEMENT

COMPLEXITY
Finals Thoughts & Bon Mots
• If you can help it, don’t start with microservices unless you have a team willing and able.
• Do build your monolithic app with an eye toward breaking it apart.
• Consider that you’ll eventually need to scale one part, but not others.
• Follow a Services or Operations pattern to development - make them as independent
as possible to facilitate eventual decoupling.
• Do think of your FreeSWITCH andVoIP infrastructure as smaller services.
• Consider your business case: Instead of running one 10k channel FreeSWITCH, why not
run 100 100-channel FreeSWITCH instances?
Evan McGee
@startledmarmot 

evan@ringplus.net
Ad

More Related Content

What's hot (20)

Scaling FreeSWITCH Performance
Scaling FreeSWITCH PerformanceScaling FreeSWITCH Performance
Scaling FreeSWITCH Performance
Moises Silva
 
FreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBCFreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBC
Moises Silva
 
SIP Testing with FreeSWITCH
SIP Testing with FreeSWITCHSIP Testing with FreeSWITCH
SIP Testing with FreeSWITCH
Moises Silva
 
FreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8sFreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8s
Chien Cheng Wu
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
建澄 吳
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and Kubernetes
Paolo Visintin
 
Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick Introduction
Olle E Johansson
 
Media Handling in FreeSWITCH
Media Handling in FreeSWITCHMedia Handling in FreeSWITCH
Media Handling in FreeSWITCH
Moises Silva
 
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH DeploymentThree Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Fred Posner
 
SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)
Fred Posner
 
Kamailio on Docker
Kamailio on DockerKamailio on Docker
Kamailio on Docker
Chien Cheng Wu
 
Sipwise rtpengine
Sipwise rtpengineSipwise rtpengine
Sipwise rtpengine
Andreas Granig
 
Kamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load BalancersKamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load Balancers
Daniel-Constantin Mierla
 
Kamailio - API Based SIP Routing
Kamailio - API Based SIP RoutingKamailio - API Based SIP Routing
Kamailio - API Based SIP Routing
Daniel-Constantin Mierla
 
rtpengine - Media Relaying and Beyond
rtpengine - Media Relaying and Beyondrtpengine - Media Relaying and Beyond
rtpengine - Media Relaying and Beyond
Andreas Granig
 
Understand your system like never before with OpenTelemetry, Grafana, and Pro...
Understand your system like never before with OpenTelemetry, Grafana, and Pro...Understand your system like never before with OpenTelemetry, Grafana, and Pro...
Understand your system like never before with OpenTelemetry, Grafana, and Pro...
LibbySchulze
 
Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017
Giacomo Vacca
 
rtpengine and kamailio - or how to simulate calls at scale
rtpengine and kamailio - or how to simulate calls at scalertpengine and kamailio - or how to simulate calls at scale
rtpengine and kamailio - or how to simulate calls at scale
Andreas Granig
 
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. SaxIntroducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Databricks
 
Introduction to Kamailio (TADSummit 2020 Asia)
Introduction to Kamailio (TADSummit 2020 Asia)Introduction to Kamailio (TADSummit 2020 Asia)
Introduction to Kamailio (TADSummit 2020 Asia)
Fred Posner
 
Scaling FreeSWITCH Performance
Scaling FreeSWITCH PerformanceScaling FreeSWITCH Performance
Scaling FreeSWITCH Performance
Moises Silva
 
FreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBCFreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBC
Moises Silva
 
SIP Testing with FreeSWITCH
SIP Testing with FreeSWITCHSIP Testing with FreeSWITCH
SIP Testing with FreeSWITCH
Moises Silva
 
FreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8sFreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8s
Chien Cheng Wu
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
建澄 吳
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and Kubernetes
Paolo Visintin
 
Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick Introduction
Olle E Johansson
 
Media Handling in FreeSWITCH
Media Handling in FreeSWITCHMedia Handling in FreeSWITCH
Media Handling in FreeSWITCH
Moises Silva
 
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH DeploymentThree Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Fred Posner
 
SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)
Fred Posner
 
rtpengine - Media Relaying and Beyond
rtpengine - Media Relaying and Beyondrtpengine - Media Relaying and Beyond
rtpengine - Media Relaying and Beyond
Andreas Granig
 
Understand your system like never before with OpenTelemetry, Grafana, and Pro...
Understand your system like never before with OpenTelemetry, Grafana, and Pro...Understand your system like never before with OpenTelemetry, Grafana, and Pro...
Understand your system like never before with OpenTelemetry, Grafana, and Pro...
LibbySchulze
 
Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017Homer - Workshop at Kamailio World 2017
Homer - Workshop at Kamailio World 2017
Giacomo Vacca
 
rtpengine and kamailio - or how to simulate calls at scale
rtpengine and kamailio - or how to simulate calls at scalertpengine and kamailio - or how to simulate calls at scale
rtpengine and kamailio - or how to simulate calls at scale
Andreas Granig
 
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. SaxIntroducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Databricks
 
Introduction to Kamailio (TADSummit 2020 Asia)
Introduction to Kamailio (TADSummit 2020 Asia)Introduction to Kamailio (TADSummit 2020 Asia)
Introduction to Kamailio (TADSummit 2020 Asia)
Fred Posner
 

Similar to FreeSWITCH as a Microservice (20)

Zoo keeper in the wild
Zoo keeper in the wildZoo keeper in the wild
Zoo keeper in the wild
datamantra
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
Ron Perlmuter
 
Understanding and deploying Network Virtualization
Understanding and deploying Network VirtualizationUnderstanding and deploying Network Virtualization
Understanding and deploying Network Virtualization
SDN Hub
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
Federico Michele Facca
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE
 
How to run a bank on Apache CloudStack
How to run a bank on Apache CloudStackHow to run a bank on Apache CloudStack
How to run a bank on Apache CloudStack
gjdevos
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
Frank Munz
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications
OpenEBS
 
Introduction to Apache Mesos and DC/OS
Introduction to Apache Mesos and DC/OSIntroduction to Apache Mesos and DC/OS
Introduction to Apache Mesos and DC/OS
Steve Wong
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
Docker, Inc.
 
Neutron scaling
Neutron scalingNeutron scaling
Neutron scaling
Vinay Bannai
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Jeffrey Ellin
 
Practice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China MobilePractice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China Mobile
DataWorks Summit
 
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
QAware GmbH
 
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ... The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
Josef Adersberger
 
Cont0519
Cont0519Cont0519
Cont0519
Samuel Dratwa
 
Dragonflow Austin Summit Talk
Dragonflow Austin Summit Talk Dragonflow Austin Summit Talk
Dragonflow Austin Summit Talk
Eran Gampel
 
Planning to Fail #phpuk13
Planning to Fail #phpuk13Planning to Fail #phpuk13
Planning to Fail #phpuk13
Dave Gardner
 
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDNTech Tutorial by Vikram Dham: Let's build MPLS router using SDN
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
nvirters
 
Docker and-daily-devops
Docker and-daily-devopsDocker and-daily-devops
Docker and-daily-devops
Satria Ady Pradana
 
Zoo keeper in the wild
Zoo keeper in the wildZoo keeper in the wild
Zoo keeper in the wild
datamantra
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
Ron Perlmuter
 
Understanding and deploying Network Virtualization
Understanding and deploying Network VirtualizationUnderstanding and deploying Network Virtualization
Understanding and deploying Network Virtualization
SDN Hub
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
Federico Michele Facca
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE
 
How to run a bank on Apache CloudStack
How to run a bank on Apache CloudStackHow to run a bank on Apache CloudStack
How to run a bank on Apache CloudStack
gjdevos
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
Frank Munz
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications
OpenEBS
 
Introduction to Apache Mesos and DC/OS
Introduction to Apache Mesos and DC/OSIntroduction to Apache Mesos and DC/OS
Introduction to Apache Mesos and DC/OS
Steve Wong
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
Docker, Inc.
 
Practice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China MobilePractice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China Mobile
DataWorks Summit
 
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
QAware GmbH
 
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ... The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
Josef Adersberger
 
Dragonflow Austin Summit Talk
Dragonflow Austin Summit Talk Dragonflow Austin Summit Talk
Dragonflow Austin Summit Talk
Eran Gampel
 
Planning to Fail #phpuk13
Planning to Fail #phpuk13Planning to Fail #phpuk13
Planning to Fail #phpuk13
Dave Gardner
 
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDNTech Tutorial by Vikram Dham: Let's build MPLS router using SDN
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
nvirters
 
Ad

Recently uploaded (20)

What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Ad

FreeSWITCH as a Microservice

  • 2. What we are: an MVNO/MVNE running on the Sprint Network What we do: rapid development cycles and constant iteration to be a different kind of consumer cellular company.
  • 3. Quickly: What is a microservices architecture?
  • 4. Quickly: What is a microservices architecture? • Monolithic • Simpler architecture • Generally confined to a single language or framework • Scaling Inefficient • Depth of Knowledge Required (DOKR) can lead to substantially increased technical debt • Microservices • More complex • Decoupled services allow for more rapid development • Increased scalability and fault tolerance • Knowledge need not span multiple services • Deployment is more complex but… simpler?
  • 6. Doesn’t Live in A Bubble
  • 7. Doesn’t Live in A Bubble • Billing • Fraud Management • Call Tracking & Analytics • Performance Monitoring • Call Quality Analysis • Failover • Realtime Multimodal Interaction (PSTN->WebRTC…) Very different domains requiring very different processing backends, language requirements, and service architectures
  • 8. Simple Example User Registration: mod_xml_curl • Queries a remote API for registration information • API uses business logic to decide which registrations permissions to bestow <binding name="directory"> <param name="gateway-url" value="https://dev.ringplus.net/endpoints" bindings="directory"/> <param name="gateway-credentials" value="journey:foreigner" /> <param name="auth-scheme" value="basic"/> </binding> Works for dialplan, configuration, and phrases Decouples SIP endpoint information Easy migration to a mid-registrar like Kamailio Registration Microservice Data Store HTTP HTTP (XML) ??? ??? if create_sip_endpoint render :registration, status: :ok, formats: [:xml] else render xml: @sip_endpoint.errors, status: :unprocessable_entity end XML RUBY
  • 10. Here’s a little something. Setting Preprocessor values: exec-set <X-PRE-PROCESS cmd="exec-set" data="local_ip_v4 = ip addr show eth0 | awk '/inet /{print $2}' | head -n 1 | cut -d '/' -f 1"/> Scenario: You’re starting a container and don’t know the IP <X-PRE-PROCESS cmd="exec-set" data="internal_sip_port = echo $INTERNAL_SIP_PORT"/> Scenario: You’re big into 12-Factor and are using lots of ENV variables <X-PRE-PROCESS cmd="exec-set" data="rtp_start_port = /etc/freeswitch/rtp_ports_based_on_env Scenario: It’s complicated, man. I need some real logic processing. Go routine that queries a service to retrieve the public RTP ports for this container. That service also opens/maps firewall and NAT ports correctly, or can really do anything.
  • 11. Talking To FreeSWITCH Is Easy Many choices of built-in modules and 3rd party libraries • Ruby: Adhearsion (https://github.com/adhearsion/adhearsion) • JavaScript: https://github.com/shimaore/esl • Go: https://github.com/0x19/goesl • Python: Python ESL • mod_xml_rpc • mod_verto • etc… What About Push?
  • 12. This Sounds Complex. Can we make this easier? Let’s Talk About One Way To Go
  • 13. • You may have heard me talk about this last year. I’m still talking about it. • Containers should be single-process, no durable storage, ephemeral little creatures • Lightweight and distributable containers • Scalability due to built in resilience and orchestration layers • Higher packing density than virtual machines due to shared libs Docker
  • 15. Docker Networking • Docker 1.12 (June) allows for easy, multi-hostVXLAN routing • Easily scale containers across nodes • Built in state reconciliation for resilient deployments • Orchestration is built into Docker Engine • Includes auto-load balancing of inbound requests to multiple containers utilizing in- kernel Linux IPVS, automaticTLS generation, and a free basket of kittens Note: Docker is still a moving target.
 • Documentation • Best Practices • Service Integration/Discovery
  • 17. Scaling The Business Logic Using Adhearsion for your dialplan. - We use it for ease and rapidity of development - Can leverage the Ruby ecosystem for gems Problem: Ruby MRI is locked to a single CPU, so can become CPU bound Solution: JRuby(?) Problem Redux: Call volume on a particular node is exceeding CPU capacity due to amazingly wonderful consumer adoption (Pokémon Go Syndrome) Solution: Scale nodes • FreeSWITCH is rarely the blocker but can consume enough CPU to max out • Adhearsion communicates with mod_rayo via XMPP - many clients, one server.
  • 18. CPU BOUND Save money on the weekends ya’ll!
  • 19. Scaling The Business Logic Using Adhearsion for your dialplan. - We use it for ease and rapidity of development - Can leverage the Ruby ecosystem for gems Problem: Ruby MRI is locked to a single CPU, so can become CPU bound Solution: JRuby Problem Redux: Call volume on a particular node is exceeding CPU capacity due to amazingly wonderful consumer adoption (Pokémon Go Syndrome) Solution: Scale nodes • FreeSWITCH is rarely the blocker but can consume enough CPU to max out • Adhearsion communicates with mod_rayo via XMPP - many clients, one server. root@adhearsion-swarm-01:~# docker service ls ID            NAME   REPLICAS  IMAGE                      COMMAND ec23ck911hgc  adhearsion    20/20   ringplus/adhearsion:latest 28ght39gvfce  freeswitch   1/1       ringplus/freeswitch_v1.6:latest root@adhearsion-swarm-01:~# docker service scale adhearsion=20 adhesion scaled to 20
  • 20. FreeSWITCH Adhearsion NYC Datacenter Adhearsion + FreeSWITCH Spike Condition with DockerAdhearsion DigitalOcean NYC-1 NYC Datacenter Kamailio • Host monitoring detects low-CPU condition on Node 1 • collectd container • Active call monitoring • Calls Ansible to spin up a new DO container • Adhearsion images pulled from Docker repo • Start containers with overlay network and information on parent FS container • Quiesce Adhearsion on affected system • Gracefully shutdown • Update Kamailio MySQL DB with new dispatcher information if FreeSWITCH scaling is necessary.
  • 21. FreeSWITCH Joins A Bunch of Microservices FreeSWITCH Static Assets Voicemails IVR AdhearsionKafka ELK S3 / Gluster Fraud API Kafka Consumer Billing API Redis Logs WAL-E Backups Postgres HTTP/S, HTTPS, XMPP, XML, Go, Ruby, Elixer RBT Selection API User API
  • 22. NO MAGIC PILL YET.
 STILL REQUIRES DEV, OPS, DEVOPS, MANAGEMENT
 COMPLEXITY
  • 23. Finals Thoughts & Bon Mots • If you can help it, don’t start with microservices unless you have a team willing and able. • Do build your monolithic app with an eye toward breaking it apart. • Consider that you’ll eventually need to scale one part, but not others. • Follow a Services or Operations pattern to development - make them as independent as possible to facilitate eventual decoupling. • Do think of your FreeSWITCH andVoIP infrastructure as smaller services. • Consider your business case: Instead of running one 10k channel FreeSWITCH, why not run 100 100-channel FreeSWITCH instances?