Published on O'Reilly (http://oreilly.com/)
 See this if you're having trouble printing code examples

An Interview with the Creator of FreeSWITCH

by Bruce Stewart

Anthony Minessale is the creator and lead developer behind the FreeSWITCH open source telephony project. When it comes to open source phone systems, Asterisk is by far the dominant player, but it isn't the only kid on the team and FreeSWITCH is considered by many to be one of the up and comers.

Surj Patel, the chair for O'Reilly's Emerging Telephony conference, recently wrote, "Undoubtedly Asterisk is king, but I do want to throw some of my support behind FreeSWITCH. Think of it as Asterisk++...It's a non-monolithic code base so it supports modules and plugins that don't have to be worked in with the main program code. Not as mature or as big of a developer base as Asterisk but its pedigree is solid with Brian West and Tony Minnesale developing it."

Minessale and FreeSWITCH are major participants in the upcoming ClueCon Telephony Developer Conference in Chicago on August 1-3, and will also be featured at our own Emerging Telephony conference next February. Minessale explains why he's building FreeSWITCH, how it differs from Asterisk, and what we can expect from the project in the near future in the following ETel interview.

Stewart: Hi Anthony, let's start at the beginning. What is FreeSWITCH?

Minessale: FreeSWITCH is my latest work. It's an open source software-based telephone switch designed on top of a solid state, machine-driven core with the goals of stability and scalability and abstraction to bring robust features to the top-level user of the software, while trying to minimize complexity.

Stewart: How long have you been programming and what got you interested in IP communications?

Minessale: I have been programming for about 15 years.

I started out in the web hosting industry in the mid to late 90s where I spent many years developing a unified web hosting platform that later grew into a web hosting/dialup account platform and then finally into a web hosting/dialup/telephony platform.

I got into communications when we decided to make a hosted call center for our agents and came to Asterisk. I soon learned that I had my work cut out for me. I had to spend almost two years learning about telephony programming to be able to mold Asterisk to support our needs. Along the way I also started Asterlink, which is based on most of my efforts to improve Asterisk. I have since decided to make an effort to build a new platform for future projects, hence FreeSWITCH.

Stewart: How is FreeSWITCH different from Asterisk, which I understand you've spent a lot of time working on. Why did you decide to launch this project instead of continuing to work on Asterisk?

Minessale: The biggest difference between the two, besides the fact that Asterisk is a PBX and FreeSWITCH is a soft-switch, is the architecture. Asterisk was originally designed with a purely monolithic architecture, meaning that processing, user interface, and data all reside within one entity (the main Asterisk process). Despite the fact that Asterisk supports loadable modules, the majority of them are not gateways to other technologies but rather inline implementations of whatever technology the module was written for. Also, Asterisk is very cautious about the number of concurrent threads it is willing to use and will take any measure to reduce that total. Some work has been done to support Asterisk on a few other Unix variants but there are no goals set to support anything beyond Linux and GCC. Since Asterisk feels it only has to concern itself with carrying calls to the PSTN, it only supports an 8 kilohertz audio sampling rate, the rate of most telephone circuits. I respect these decisions and because I disagree with some of them at a fundamental level I chose to make a new application.

FreeSWITCH takes an entirely different approach with its architecture. The initial release of the code already supported multiple sampling rates and even had the ability to bridge calls with unlike sample rates in real time. Portable cross-platform code is foremost on the list of requirements, which has paid off with support for Windows, Mac O SX, and many versions of Linux on varying numbers of processors, both 32- and 64-bit. External data access and cluster ability has been planned for since day one and the module interfaces are designed to bring existing technology into the core by providing a gateway from existing libraries. So clearly, FreeSWITCH aims to create a platform on which to combine technologies where Asterisk, like its namesake (the "*" character), aims to implement just about everything.

Despite the fact that I have contributed a sizeable list of features to Asterisk, working around the politics was almost harder than working around some of the shortcomings in the design. I have raised FreeSWITCH up from scratch in only one-third of the time I had previously spent working on just adding things to a fully-functional Asterisk.

Stewart: Where are you in the development process? Is FreeSWITCH stable enough to run in production environments yet?

Minessale: I am almost to the point of the first stable release. At this point, I am working on making sure I do not need to change any of the core API interface and above all else, to provide ample documentation, which I consider to be as equally important as working code. I want to ensure developers and users alike are able to fully understand the software when they choose to use it. In terms of stability, I was able to run 1,200 RTP-based g711 channels on a dual Xeon machine. Since 1,200 calls of g711 maxed out my Ethernet I need to get a Gigabit network to do further testing. As far as implementations, I have a handful of providers who are working with me to use it in the real world right now but I have my hands full with the upcoming ClueCon conference.

Stewart: I read recently that FreeSWITCH now supports a 16khz audio codec. Tell me why you've decided to do this.

Minessale: Yes, we are very proud. In fact we are being a bit modest with the announcement. In reality, the design of FreeSWITCH will permit audio at any imaginable rate because all of the code in the core takes the rate formulas into consideration. It so happens we had access to the speex softphone that was capable of 16khz, so that was the perfect way to try it. Of course, CD quality phone calls may seem to be overkill today but you never know how fast the Internet will be in the future.

Stewart: Tell us about the work you're doing with FreeSWITCH and RSS, that sounds pretty interesting.

Minessale: As a way to demonstrate some of the features of FreeSWITCH, I designed an IVR application that is able to parse and read RSS news feeds with a Text-To-Speech module. There is a currently a module available for Cepstral that can provide a voice for FreeSWITCH and allow you to call and navigate RSS feeds from your favorite news sites from a touch pad.

Stewart: FreeSWITCH supports Jingle. What are your thoughts on this protocol, do you see it gaining popularity?

Minessale: I like the Jingle protocol because the IM model and peer-to-peer signaling brings a whole new list of possibilities to telephony in general. We are fortunate to have the author of the Jingle specification, Peter St. Andre, attending the ClueCon Conference the first week in August, where he will be doing a presentation on it. He has invited me to participate in the JSF and help shape the protocol to become more compatible with other telephony protocols. There is also a good chance we will get some form of input from the GoogleTalk team.

Stewart: What have been the most difficult aspects of developing FreeSWITCH?

Minessale: The two most difficult aspects have been making sure the code is portable to all platforms and operating systems and maintaining a strict set of fundamentals in the design. There is a lot of discipline involved to make code work correctly for every compiler. Also, it's way too easy to get distracted by a potential feature or by an overwhelming problem and to lose sight of the fundamentals. If you keep your design true to its original goals, you will find it much easier to bring things together in the long run.

Stewart: What telephony features most excite you?

Minessale: I am excited by being able to bring together all of the best elements of various telephony-related projects and concepts. I am looking forward to seeing what becomes of Jingle. The single most anticipated feature is support for Microsoft's .NET with mod_mono and once that is completed developers will actually be able to make IVR applications and modules for FreeSWITCH in C#. We already have some pretty cool stuff with mod_xmlrpc that makes it possible to control FreeSWITCH with xmlrpc as well as external data access hooks using remote URL access.

Stewart: What's next for FreeSWITCH? What new features or functionality can we look forward to?

Minessale: As tempting as it is to work on features in the near future, I will probably begin going over what I already have with a fine-toothed comb and make sure it's all absolutely as perfect as I can make it. Once I am satisfied, I will release the first revision of the core. Once that is done it will be possible to make more features in the form of modules which are not forced to be frozen in time like the core is. Because of the overall design, you can continue to work on modules as long as they do not require any API changes to the core, making modules forever binary-compatible with the version of the core they are based on. I may not have a release done in time for ClueCon like I had hoped to, but like they say, "you can't rush perfection," and I am not willing to force a version because of a chance at media attention. If it doesn't make it into the first version, an upcoming version will definitely contain the .NET support, as well as a User Directory to store access to local and remote extensions that can be accessed from the onboard XML database or hooked to an external data hook module. And allow unified configuration for extension across all protocols.

Stewart: Is FreeSWITCH a labor of love, or do you see a business model in this open source project?

Minessale: I believe that there is a viable business model in allowing companies to license their custom modules to individuals as well as branded implementations.

Stewart: Have you been single-handedly doing the development work on FreeSWITCH, or is there an active community of developers?

Minessale: There have been more developers contributing recently but previously I had done 100 percent of the coding and have made most of what you see now. But I see some awesome potential in the private development branches of some FreeSWITCH developers that will soon be completed. One namely being the mod_mono support that I referred to before. I have had lots of help on building and testing from the community, which is rapidly evolving, but it's important to remember that we have only been around since the beginning of 2006, so the sky's the limit.

Bruce Stewart is a freelance technology writer and editor.

Return to O'Reilly Emerging Telephony.

Copyright © 2009 O'Reilly Media, Inc.