Let’s dockerize VoIP

An image of containers indicating dockerization

As a curious software engineer working at a telecommunications company, it was only a matter of time before 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.

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 the 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 easily as in production. No more magic or updating the same box over and over in place.

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