Let’s Dockerize VoIP

02 Mar

As a curious software engineer working at a telecommunications company it was only a matter of time until I started learning about server-side VoIP software like FreeSWITCH, Kamailio / OpenSIPS, and Yate. These projects each have their own configuration language, resource needs, capabilities, and goals.

It is ideal to (actually) test these applications in an environment as close to production as possible. The best scenario would be to test the exact image that is going to be deployed to production. That doesn’t happen very often. In the telecom world, scaling vertically is seen more often than scaling horizontally. Configurations get updated in place and over time become a living organism surrounded by mystery and fear. Only certain people want or are allowed to touch it.

Configurations get updated in place and over time become a living organism surrounded by mystery and fear.

That doesn’t sound right. Fortunately, we have a platform called Docker that can help.

Meet Docker

Docker is an open source container virtualization platform. It uses namespaces, cgroups, and a union filesystem to create an isolated environment (container) for an application.

Docker containers are created using an image. The image is basically a template for creating a container. It is composed of multiple layers, that are unioned together when running the container. This is perfect for VoIP software.

blog-chart-2

The above figure demonstrates image reuse. Every box is an image that depends on those beneath it. These images can be versioned. You can probably see where I’m going with this…

 

The Benefits

There are many reasons why using Docker makes sense. The most important thing is that it lets system administrators focus on infrastructure and nothing else. All they need to know is that you need to be able to run a container. This reduces dependencies on each other and decreases the time it takes to push out updates.

Speed

Each container shares the same kernel as the host operating system, so there is no overhead of a hypervisor. Resources are allocated as needed, rather than up front. Docker containers start in a second or less.

Repeatability

The way Docker images work and the fact that we can version them has some nice qualities. A container can be created from an image on any machine and it will always be the same. As a result of this, images can be tested locally or in a QA environment.

Packaging

Everything needed to run an application is included in the image. This removes the problem of conflicting versions of libraries on production machines. Customers can run your image on any host that has Docker installed. Docker runs on Windows, Linux, and OS X.

Scalability

We can run multiple containers at the same time and Docker will handle setting up networking for us. The great thing about using Docker with SIP-related projects is that all we have to do for a new container is add an SRV record and we are done.

Conclusion

Docker has potential to be a great enabler of innovation in telecommunications. It’s not just for the web. A lot of constraints typically placed on a VoIP platform can be alleviated so that engineers can focus on what they are building. Perhaps the most useful thing is that engineers can run the application locally just as easy as in production. No more magic or updating the same box over and over in place.

The Docker web site has a lot of great information and documentation on their technology. Check it out.

Tyler Cross
Tyler Cross
tcross@bandwidth.com

Tyler Cross is a passionate software engineer from eastern North Carolina with a breadth of knowledge to draw on from the web, bioinformatics, and telecommunications. So far during his 2 years at Bandwidth he has worked on teams that gave him exposure to all technical aspects of our products- backend provisioning systems, real-time communications software, networking, and prototype development in the Bandwidth Incubator. In addition to being a techie, he is an avid runner and athlete in general. He is proud to be a Bandwidth employee and live up to all our principles and ideals.

3 Comments
  • Bill Geary
    Posted at 15:11h, 11 March Reply

    I’ve been a Bandwidth SIP customer for many years and have been waiting/hoping for a solution for when our internet connection is broken. When this happens, anyone calling us gets dead air. No ring tone, no busy tone, no auto attendant. Nothing. Nada. If would be a great help if Bandwidth could detect the outage and route calls to a voicemail box that includes a message in which we could inform our callers that service has been interrupted. This is a billable option that you’re missing out on. I believe customers like me would pay a monthly fee to have that emergency backup feature.

  • Utteru
    Posted at 11:12h, 24 March Reply

    Great post! These is a complete insights about VOIP service help me to increase my knowledge call China

  • Randy Weinberger
    Posted at 20:27h, 12 July Reply

    We created a Dockerized version of OpenSIPS to help folks get started. It’s publicly available on on Dockerhub at https://hub.docker.com/r/icehook/opensips/

Post A Comment