FreeSWITCH Documentation

repository·master·Indexed 26 days ago

https://github.com/signalwire/freeswitch

A 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.

Tokens
27.1K
Snippets
77
Records
177
Agent score
89%

What's inside FreeSWITCH

  1. Overview of ExprEval expression evaluation library

    master

    ExprEval 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.
  2. Overview of libSRTP

    master

    libSRTP 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.a after 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.
  3. Core libyuv Formats and Conversion Logic

    master

    libyuv 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 as I420ToARGB().

  4. Understand LibYuv Filtering and Subsampling

    master
    LibYuv 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 selected FilterMode.
  5. Build libyuv on macOS and Linux

    master

    Use gn to generate build files and ninja to 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/Debug
    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/Debug
  6. Build libSRTP using CMake (Visual Studio)

    master

    On 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"
  7. Create a custom FreeSWITCH Docker image

    master

    To 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.

    1. Install the vanilla configuration package: apt-get install freeswitch-conf-vanilla
    2. Clone the FreeSWITCH repository.
    3. Run the make_min_archive.sh script located in freeswitch/docker/base_image.
    4. Build the image using docker build.
  8. Build GoogleTest as a standalone CMake project

    master

    To build GoogleTest and GoogleMock as a standalone project using CMake, follow these steps:

    1. Clone the repository and enter the directory.
    2. Create a build directory.
    3. Run CMake to generate build scripts.
    4. Build using make (on *nix) or a Visual Studio/Xcode project file (on Windows/macOS).

    To build only GoogleTest without GoogleMock, pass -DBUILD_GMOCK=OFF to the cmake command.

    git clone https://github.com/google/googletest.git -b release-1.10.0
    cd googletest
    mkdir build
    cd build
    cmake .. -DBUILD_GMOCK=OFF
    make