FreeSWITCH
FreeSWITCH is an open-source, carrier-grade telephony platform designed for real-time communication that supports audio, video, text, and other forms of media across IP networks and the public switched telephone network (PSTN). It is released under the Mozilla Public License (MPL).[1] It operates as a back-to-back user agent, enabling versatile applications such as private branch exchange (PBX) systems, transit switches, text-to-speech servers, conferencing solutions, and VoIP gateways.[1] Development of FreeSWITCH began in 2005 through discussions aimed at creating a more scalable and future-oriented switching platform, distinct from existing tools like Asterisk, which were primarily focused on PBX functionality.[2] The project was officially launched in 2006 and has since evolved into a robust framework powering over 5,000 businesses and serving more than 300 million daily users worldwide.[3][4] At its core, FreeSWITCH employs a modular architecture built around channel variables, dialplan applications, and an Event Socket Layer (ESL) API, which allows integration with scripting languages like Lua and Perl for custom extensions.[1] This design supports key protocols such as SIP and WebRTC, along with features including video multipoint control units (MCUs), call recording, voicemail, and advanced media processing.[3] Maintained by SignalWire—founded by FreeSWITCH's original core developers—the platform emphasizes scalability for enterprise environments, with options for commercial modules like G.729A codec support to enhance performance in high-volume deployments.[3][5] FreeSWITCH's adoption extends to major telecommunications providers and services, including Amazon Chime, Zoom Phone, and Five9, highlighting its reliability in handling complex, global telephony infrastructures.[3] The project fosters a vibrant open-source community through forums, IRC channels, and annual events like ClueCon, the 2025 edition of which celebrated FreeSWITCH's 20th anniversary and focused on innovations in AI-driven communications and real-time collaboration.[6][7] Its ongoing development, tracked via the official GitHub repository, ensures compatibility with modern standards while addressing breaking changes in releases, such as the shift to modular components in version 1.10.x.[8][9]Overview
Description
FreeSWITCH is a free, open-source software platform designed for real-time communication, enabling the handling of audio, video, and text over IP networks.[3] It functions as a versatile softswitch, facilitating the creation of scalable telephony systems that support voice over IP (VoIP), video conferencing, and WebRTC applications.[1] At its core, FreeSWITCH serves as a back-to-back user agent that powers everything from simple softphones to full-scale Class 5 switches, making it suitable for building robust communication infrastructures.[1] Its high-level capabilities include multi-protocol support for seamless interoperability, embeddability within custom applications, and scalability to handle carrier-grade deployments serving millions of users daily.[3] For instance, it supports over 5,000 businesses and more than 300 million daily active users worldwide, demonstrating its capacity for large-scale operations.[3] As an open-source alternative to proprietary private branch exchange (PBX) systems, FreeSWITCH offers flexibility and cost-effectiveness for developers and enterprises seeking to deploy telephony solutions without vendor lock-in.[3] Its modular design further enhances adaptability, allowing integration of diverse functionalities as needed.[1]Licensing and Platforms
FreeSWITCH is licensed under the Mozilla Public License (MPL) version 1.1, which permits free use, modification, and distribution of the software while requiring that any modifications to the source code be made available under the same license.[10] This open-source framework encourages community contributions by ensuring that derivative works remain accessible, though it allows for proprietary extensions as long as the core remains open.[11] For commercial use, the MPL supports integration into proprietary applications without mandating the release of the entire enclosing software, provided FreeSWITCH modifications are shared.[10] SignalWire, the primary steward of FreeSWITCH, offers dual licensing options for enterprise features, including commercial modules such as Answering Machine Detection (AMD) at $50 per channel and support for codecs like G.729A.[3] These proprietary enhancements complement the open-source core, providing advanced capabilities like priority bug fixes and deployment assistance for high-scale deployments, while the base platform remains freely available under MPL 1.1.[3] FreeSWITCH supports a wide range of platforms, with Linux distributions such as Debian, Ubuntu, CentOS, Fedora, and RHEL serving as the primary environments due to their stability and package availability.[10] It also runs natively on Windows via Visual Studio compilation, macOS, FreeBSD variants (*BSD), NetBSD, OpenBSD, and Solaris, enabling cross-compilation for diverse hardware architectures including 32-bit and 64-bit systems.[12] This broad compatibility facilitates deployment in varied telephony infrastructures without significant platform-specific adaptations.[13] Hardware requirements for FreeSWITCH are modest for basic setups, requiring a minimum of a 32-bit operating system (64-bit recommended), 512 MB RAM (1 GB recommended), and 50 MB of disk space, allowing it to operate on low-end devices like Raspberry Pi.[12] For intensive media processing, such as high-concurrency voice or video handling, more robust configurations are advised to maintain performance under load, with system demands scaling based on expected call volume and features like conferencing.[12] Installation methods include compiling from source for customization and access to the latest features, supported across Unix-like systems, macOS, and Windows.[13] Pre-built binaries are available for streamlined deployment on Debian 12, CentOS 7, and Windows via MSI installers, reducing setup time for standard environments.[13] Additionally, containerization via Docker is supported through community-maintained images and official Dockerfiles for building containers, enabling portable and scalable deployments in modern orchestration setups like Kubernetes.[14]History
Origins
FreeSWITCH was announced in January 2006 at O'Reilly's ETEL conference by Anthony Minessale II, Brian West, and Michael Jerris, marking the inception of an open-source telephony platform.[15] The project arose from frustrations with the constraints of prevailing open-source solutions like Asterisk, which often exhibited instability under high loads and resisted easy customization for advanced use cases.[5] The founding team sought to create a versatile softswitch that prioritized scalability, embeddability, and support for real-time communications extending beyond conventional PBX functionalities, addressing the growing demand for flexible, high-density telephony in the mid-2000s.[4] Initial development emphasized a modular design built from scratch, while integrating select components from established VoIP libraries, such as SIP handling tools, to promote cross-platform compatibility and extensibility without inheriting legacy limitations.[5] After approximately two years of intensive coding and testing, the project achieved its first stable milestone with the public release of version 1.0.0 on May 26, 2008, which introduced core capabilities for SIP signaling and media processing.[16] This release laid the groundwork for FreeSWITCH's role as a robust foundation for diverse communication applications.[4]Key Releases
FreeSWITCH's development has progressed through several major open-source releases since its initial stable versions, each introducing significant enhancements in protocol support, media handling, and integration capabilities. The 1.2 series, codenamed "Dragon," was released in 2012 and marked an important step forward with the introduction of SIP over WebSocket support, enabling seamless communication between web-based clients and traditional SIP endpoints. Additionally, this version provided basic WebRTC compatibility, allowing early integration of browser-based real-time communication without extensive custom modifications.[17] Building on these foundations, the 1.4 series arrived in 2014, focusing on multimedia advancements. Key updates included enhanced video transcoding capabilities through improved codec handling in mod_av, supporting multiple formats for smoother interoperability in diverse environments. Conferencing features were also bolstered, with better support for video streams in mod_conference, facilitating more reliable multi-party sessions and laying groundwork for advanced WebRTC video applications.[18][19] The 1.6 series, released starting in 2015, emphasized architectural refinements and efficiency gains. Improvements in modularity allowed for more flexible module loading and configuration, reducing overhead in large-scale deployments. Performance optimizations, such as quality enhancements to the VPX video codec and updates to WebRTC signaling for better compliance with evolving standards, contributed to higher throughput and lower latency in media processing.[20] In 2018, the 1.8 series introduced deeper ties to the emerging SignalWire ecosystem. The standout addition was mod_signalwire in version 1.8.3, which simplified connectivity to SignalWire's cloud services for dynamic routing, monitoring, and scaling of communications workloads. This integration streamlined deployment for hybrid on-premises and cloud setups, enhancing FreeSWITCH's role in distributed telephony architectures.[21] The ongoing 1.10 series, initiated in 2019, continues to prioritize stability and modern platform compatibility, with the latest open-source release being 1.10.12 in August 2024. This version incorporates critical security fixes addressing vulnerabilities in core components, alongside support for Debian 11 as a reference platform and the introduction of mod_python3 for scripting with the latest Python runtime. These updates ensure robust operation in contemporary Linux environments while maintaining backward compatibility for established deployments.[9] Complementing the open-source track, FreeSWITCH's enterprise editions under SignalWire have evolved separately, with version 20.25.4 released on October 27, 2025. This update delivers essential security patches for XML parsing and signaling protocols, alongside SIP enhancements like optimized handling for complex session setups and new monitoring tools via low-level APIs for real-time diagnostics and performance tracking.[22][23] Across these releases, FreeSWITCH has trended toward greater emphasis on WebRTC for browser-native communications, advanced video processing for immersive conferencing, and cloud-native features like modular integrations and API-driven management, reflecting broader shifts in real-time communication demands.Architecture
Core Components
FreeSWITCH employs a softswitch architecture centered on an event-driven state machine that manages call sessions, channels, and media streams efficiently. This design allows the core engine to process events triggered by significant actions, such as call initiation or termination, enabling real-time handling of concurrent communications without blocking operations. The event system facilitates monitoring and control, where external applications can bind to events to track system status and respond dynamically.[17] At the heart of this architecture is the libfreeswitch core library, an embeddable C-based engine that provides the foundational switching and signaling capabilities. Libfreeswitch offers a stable, protected core with opaque critical data structures to ensure reliability and prevent inter-module dependencies, allowing it to be integrated into larger applications as a shared library (typically 4-8 MB in size). It supports multi-protocol softswitch functionality, enabling the addition of voice processing and other real-time features to host applications while running in separate threads to minimize performance impact.[24][10] Key internals include session management through finite state machines, which handle call flows similarly to traditional dialplans, and a multi-threaded processing model where each connection operates in its own thread alongside background subsystems for concurrency. This separation of signaling from media processing ensures that control plane operations do not interfere with real-time media streams, supporting high throughput on standard hardware—capable of managing thousands of concurrent channels. Scalability is achieved through horizontal scaling mechanisms, including clustering for distributed deployments and load balancing algorithms like round-robin or load-based routing to distribute requests across multiple servers based on metrics such as CPU utilization or active connections. Additionally, built-in NAT traversal handling, via parameters like nat-options-ping for keeping ports open and external profile configurations using STUN for IP discovery, facilitates deployment in varied network environments.[17][24][25] Configuration of the core is managed through an XML-based dialect, providing a structured approach to routing and user management. The dialplan, stored in XML files, defines the decision tree for call routing and application execution, while the directory handles user authentication and registration details in a similar XML format located in the conf/directory path. This XML registry supports real-time dynamic access and updates, allowing seamless adjustments without restarting the system.[26][27][17]Modules
FreeSWITCH features a modular extension system that enables dynamic loading of loadable modules at runtime, allowing users to extend the core engine's capabilities without recompiling the software. These modules are typically implemented in C or C++, with Lua support for scripting certain functionalities, and are organized into categories such as applications, codecs, endpoints, and formats. This design promotes flexibility, as modules can be loaded, unloaded, or reloaded via the console or configuration without restarting the system.[28][29] Application modules deliver targeted telephony features; for instance, mod_voicemail handles automated voice messaging storage and retrieval, mod_conference manages multi-party audio and video calls with features like muting and floor control, and mod_dptools provides tools for building IVR applications through dialplan scripting. Codec modules support various audio and video compression algorithms, exemplified by mod_opus, which integrates the Opus codec for high-quality, low-latency communication over variable bandwidth. Endpoint modules interface with communication protocols and devices, such as mod_sofia, which implements the SIP protocol for VoIP session handling. Format modules process media streams and files, including mod_shell_stream for piping audio to external commands and mod_av for advanced video and audio format support.[28][30] Developers can create custom modules using the FreeSWITCH API, starting from skeleton templates in the source code repository and defining key functions like load, runtime, and shutdown hooks to interact with the core state machine. Once built, new modules integrate seamlessly into the system. Enabling or disabling modules occurs through the XML configuration file at conf/autoload_configs/modules.conf.xml, where administrators uncomment or add lines such as<load module="mod_example"/> to control loading order and specify custom paths if needed; critical modules can be flagged to halt startup on load failure.[29][31]
This architecture minimizes core bloat by loading only required modules, optimizing resource usage for diverse deployments from simple gateways to complex media servers; numerous modules are available, encompassing everything from basic protocol support to specialized media processing.[28][3]
Features
Protocol Support
FreeSWITCH provides native support for a range of signaling protocols essential for VoIP communications, with Session Initiation Protocol (SIP) as its primary standard, implemented through the mod_sofia module based on the Sofia-SIP stack. This implementation ensures compliance with RFC 3261 for SIP version 2.0, enabling core functions such as session establishment, modification, and termination, along with support for additional RFCs including 3263 for DNS SRV and NAPTR records, 3325 for private extensions, and 4694 for number portability.[12][32] SIP in FreeSWITCH also extends to WebSocket transports via ws-binding and wss-binding configurations, facilitating integration with web-based clients without requiring additional gateways.[32] For chat and presence integration, FreeSWITCH supports XMPP through the mod_dingaling module, which handles XMPP registrations and Jingle extensions for real-time communication.[33] On the media transport side, FreeSWITCH's core architecture natively handles Real-time Transport Protocol (RTP) streams for audio and video as per RFC 3551, with Secure RTP (SRTP) encryption supported via Security Descriptions for Media Streams (SDES) or Datagram Transport Layer Security (DTLS).[12] WebRTC integration is achieved through modules like mod_verto and mod_rtc, enabling browser-native audio/video sessions with full support for Interactive Connectivity Establishment (ICE), Session Traversal Utilities for NAT (STUN), and Traversal Using Relays around NAT (TURN) to manage NAT traversal and firewall penetration, including data channels via SCTP as of recent updates.[34][35] Additionally, Real-Time Messaging Protocol (RTMP) is supported via mod_rtmp for legacy streaming applications.[36] Security features are embedded in FreeSWITCH's protocol stack, with Transport Layer Security (TLS) available for SIP signaling to encrypt control messages and prevent eavesdropping.[32] For media encryption, DTLS is utilized in WebRTC contexts to negotiate SRTP keys securely, while ZRTP support—once enabled for end-to-end encryption in RTP streams—was deprecated in early 2023, removed in version 1.10.12 (August 2024), and is no longer available.[37][38] These mechanisms ensure robust protection for both signaling and media paths in deployed systems. Interoperability is enhanced through gateway modules for legacy protocols, such as H.323 support via mod_h323 (based on the H.323plus library) and mod_opal (which also handles IAX2), allowing bridging between H.323 endpoints and modern VoIP sessions.[39][40] Routing capabilities include ENUM via the mod_enum module, which performs E.164 to URI lookups using DNS NAPTR records to direct calls efficiently across PSTN and IP networks.[41] FreeSWITCH operates across multiple network transports, supporting both IPv4 and IPv6 addressing for SIP and RTP to accommodate dual-stack environments.[12] Signaling and media can utilize UDP, TCP, SCTP, and TLS transports, providing flexibility for reliability and security needs in diverse network conditions.[32]Advanced Functions
FreeSWITCH provides robust call control mechanisms that enable dynamic management of telephony sessions. Call bridging connects multiple channels, allowing seamless integration of participants into ongoing conversations, as implemented through thebridge application in mod_dptools. Blind transfers redirect a call to a new destination without consultation, typically handled via SIP REFER in mod_sofia or the transfer application, which restarts dialplan processing in a specified context while respecting SIP Max-Forwards limits to prevent loops. Attended transfers, or consultative transfers, involve bridging a third party for private consultation before completing the handover, facilitated by the att_xfer application that temporarily parks the original caller. Call parking places sessions in a holding state for later retrieval, using features like mod_valet_parking for extension-based slots or the park application to suspend media without endpoint involvement.[42] Session recording captures audio streams with privacy controls, such as starting post-answer via the record_session application and options to exclude announcements or enable one-way recording.
Media handling in FreeSWITCH supports advanced manipulation for diverse telephony needs. Transcoding converts between codecs like G.711 (PCMU/PCMA) and Opus dynamically during sessions, leveraging the core media engine to negotiate and switch formats without interrupting calls, ensuring compatibility across endpoints, with recent enhancements to Opus PLC for improved packet loss concealment as of 2024.[43][35] Conference mixing aggregates multiple audio streams into a unified output using mod_conference, which applies gain control, energy scoring for floor management, and video layout options for multiparty sessions.[44] Fax support includes T.38 protocol handling for reliable transmission over IP, with mod_spandsp enabling gateway mode to convert audio tones to T.38 packets and vice versa, supporting both send and receive operations in dialplans.[45]
Scripting capabilities extend FreeSWITCH's flexibility through the Event Socket Layer (ESL), a TCP-based interface for external applications to monitor and control events in real-time. ESL supports bindings in languages such as Lua for embedded scripting within dialplans, Python via the native ESL module for inbound/outbound connections, and JavaScript through Node.js libraries for asynchronous event handling.[46] This allows developers to originate calls, inject IVR logic, or integrate with databases without recompiling the core.
AI and machine learning integrations are facilitated through modular hooks, particularly mod_unimrcp, which implements the MRCP protocol for connecting to speech engines. Speech recognition (ASR) converts audio to text using grammars or large-vocabulary models, invoked via the unimrcp application for real-time processing in IVR flows.[47] Text-to-speech (TTS) synthesis generates audio from text or SSML, supporting playback with voice parameters and integration into sessions for interactive voice responses.[47]
Reliability features ensure resilient operation in production environments. Failover routing sequentially attempts alternative gateways or endpoints upon failure detection, configurable in dialplans with inline bridges or the failover parameter to handle causes like 403 or 503 responses.[48] Least-cost routing optimizes carrier selection using mod_lcr, which queries databases for prefix-based rates and prefixes to minimize expenses while balancing load.[49] Session timers, compliant with RFC 4028, periodically refresh SIP dialogs to detect and terminate stale sessions, enabled in Sofia profiles with configurable intervals like 1800 seconds minimum.[12]