FreeSWITCH Documentation
repository·master·Indexed 26 days ago
https://github.com/signalwire/freeswitchA Software Defined Telecom Stack enabling digital transformation from proprietary switches to a versatile software implementation. Documentation covers minimal configuration, Docker deployment (including environment variables for sound rates and types), systemd management, Coverity scanning, and the FreeSWITCH Portal GUI. Includes technical details on networking ports for SIP, SIPS, and WebSocket signaling, as well as GoogleTest customization macros.
What's inside FreeSWITCH
- libyuv is an open source library providing YUV scaling and conversion functionality. It is optimized for various architectures including SSSE3/AVX2 (x86/x64), Neon (Arm), and MSA (Mips).
Overview of ExprEval expression evaluation library
masterExprEval is a high-performance C-based expression evaluation library with a C++ wrapper. It is designed to parse and evaluate expressions containing variables, constants, and functions.
Key features:
- Multiple Expressions: Supports parsing multiple expressions in a single string, provided each sub-expression ends with a semicolon (
;). - Performance: Expressions are parsed into an action tree first, allowing the same expression to be evaluated many times efficiently.
- Shared Resources: Functions, constants, and variables are stored in separate lists that can be shared across multiple expression objects to reduce memory overhead and allow inter-expression dependency.
- Multiple Expressions: Supports parsing multiple expressions in a single string, provided each sub-expression ends with a semicolon (
Overview of libSRTP
masterlibSRTP is an implementation of the Secure Real-time Transport Protocol (SRTP), the Universal Security Transform (UST), and a supporting cryptographic kernel. It provides functions to protect RTP and RTCP data by providing confidentiality to RTP data and authentication to the RTP header and payload (as defined in RFC 3711).
Key components include:
- SRTP API: Documented in
include/srtp.h. - Library File:
libsrtp2.aafter compilation. srtp_stream_t: An opaque typedef pointing to a structure holding the state for an SRTP stream (keys, cipher/authentication parameters, and anti-replay data).srtp_t: An opaque typedef pointing to a structure holding the state for an entire SRTP session, which can contain multiple stream contexts.
- SRTP API: Documented in
Core libyuv Formats and Conversion Logic
masterlibyuv relies on two core formats for its primary operations:
- I420: The core YUV format. All YUV formats can be converted to or from I420.
- ARGB: The core RGB format. All RGB formats can be converted to or from ARGB.
Filtering functions (such as scaling) and planar functions are designed to work specifically on I420 and/or ARGB. When performing conversions, function names typically follow the pattern
[Source]To[Destination], such asI420ToARGB().Get help with FreeSWITCH
masterYou can access the FreeSWITCH community and professional support through the following channels:
- IRC:
#freeswitchonirc.freenode.net - Mailing List:
freeswitch-usersonlists.freeswitch.org - Professional Consulting: Visit freeswitchsolutions.com or email
consulting@freeswitch.org.
- IRC:
Understand LibYuv Filtering and Subsampling
masterLibYuv uses different filtering modes for scaling images (up-sampling and down-sampling). The primary challenges addressed are the centering of samples (which requires clamping at edges) and clipping source regions. The behavior of centering depends on both the scale factor and the selectedFilterMode.Run Address Sanitizer (ASan) with Valgrind
masterTo detect memory address errors, build with
build_for_tool=asanand run the resulting unittests using Valgrind.GYP_DEFINES="clang=0 target_arch=x64 build_for_tool=asan" python gyp_libyuv ninja -C out/Debug valgrind out/Debug/libyuv_unittestBuild XML-RPC for C/C++ as a DLL on Windows
masterTo create DLLs, use the project files located in thedllsubdirectory. These files are maintained separately from the main build system and require Visual Studio 2008 or later.Build libyuv on macOS and Linux
masterUse
gnto generate build files andninjato compile for Release and Debug builds.gn gen out/Release "--args=is_debug=false" gn gen out/Debug "--args=is_debug=true" ninja -v -C out/Release ninja -v -C out/Debuggn gen out/Release "--args=is_debug=false" gn gen out/Debug "--args=is_debug=true" ninja -v -C out/Release ninja -v -C out/DebugBuild libSRTP using CMake (Visual Studio)
masterOn Windows, you can use CMake to generate Visual Studio project files. Ensure you run these commands from within a Visual Studio command prompt or after running
vcvarsall.bat.# Create build subdirectory mkdir build cd build # Make project files cmake .. -G "Visual Studio 15 2017" # Or for 64 bit project files cmake .. -G "Visual Studio 15 2017 Win64"Create a custom FreeSWITCH Docker image
masterTo build a custom container, you must first generate a minimized archive of the FreeSWITCH files using the provided scripts. This requires a Debian-based distribution.
- Install the vanilla configuration package:
apt-get install freeswitch-conf-vanilla - Clone the FreeSWITCH repository.
- Run the
make_min_archive.shscript located infreeswitch/docker/base_image. - Build the image using
docker build.
- Install the vanilla configuration package:
Build GoogleTest as a standalone CMake project
masterTo build GoogleTest and GoogleMock as a standalone project using CMake, follow these steps:
- Clone the repository and enter the directory.
- Create a build directory.
- Run CMake to generate build scripts.
- Build using
make(on *nix) or a Visual Studio/Xcode project file (on Windows/macOS).
To build only GoogleTest without GoogleMock, pass
-DBUILD_GMOCK=OFFto thecmakecommand.git clone https://github.com/google/googletest.git -b release-1.10.0 cd googletest mkdir build cd build cmake .. -DBUILD_GMOCK=OFF make