Flexisip

May 6, 2026 · View on GitHub

Flexisip is a comprehensive, modular and scalable SIP server suite written in C++17. It offers a wide range of functionalities, including:

  • Proxy Server: acts as a central hub for routing SIP messages.
    • Push Notification Service: delivers SIP notifications (in-calls, messages) to mobile devices even when the app is not actively running.
  • Presence Server: enables users to see the online status of others and their availability for calls.
  • Back-to-Back User Agent (B2BUA) Server: enables caller identity translation, media-level transcoding and SIP trunking.
  • RegEvent Server: notify tier domains of user registration.

Deployment and Applications:

  • Server-based VoIP Service: Flexisip can be deployed on server machines to run a full-fledged SIP VoIP service. This is exemplified by the free linphone.org service, which has been powered by Flexisip since 2011. Users can create SIP accounts on this service to connect with each other.
  • Embedded Solutions: Flexisip can also be embedded and run seamlessly on smaller hardware systems, making it suitable for various embedded applications.

License

Copyright © Belledonne Communications

Flexisip is dual licensed, and can be licensed and distributed:

  • under a GNU Affero GPLv3 license for free (see COPYING file for details)
  • under a proprietary license, for closed source projects. Contact Belledonne Communications for any question about costs and services.

Documentation

Dependencies

DependencyDescriptionMandatoryEnabled by default
OpenSSLTLS stack.X
LibNgHttp2HTTP2 stack.X
libsrtp2Secure RTP (SRTP) and UST Reference ImplementationsX
SQLite3Library for handling SQlite3 fileX
libmysql-clientClient library for MySQL database.X
HiredisRedis DB client library, used for Registrar DB and communications between Flexisip instances of a same cluster. (-DENABLE_REDIS=YES)X
NetSNMPSNMP library, used for SNMP support. (-DENABME_SNMP=YES)X
XercesCXML parser. (-DENABLE_PRESENCE=YES)X
jsoncppJSON parsing and writing (-DENABLE_B2BUA=YES)X
cpp-jwtJSON Web Token support (-DENABLE_OPENID_CONNECT=YES)X
libsystemdLibrary to interact with SystemDX

Compilation

Required build tools

  • C and C++ compiler. GCC (>= 13.0) and Clang (>= 19.0) are supported they must be recent enough to support C++20 code.
    • Debian 12: Only Clang is supported as gcc is too old for C++20.
  • make or Ninja
  • Python >= 3
  • Doxygen
  • Git

Building Flexisip with CMake

Create a build directory and configure the project:

From cloned GIT repository

mkdir ./build
cmake -S . -B ./build
make -C ./build -j<njobs>

Custom

When built outside a git repository, you have to manually mention Flexisip and Linphone-SDK versions.

mkdir ./build
cmake -S . -B ./build -DFLEXISIP_VERSION=<version> -DLINPHONESDK_VERSION=<version>
make -C ./build -j<njobs>

Some tips

Check CMakeLists.txt to know the list of the available options and their default value. To change an option, invoke CMake again and specify the option you need to change. For instance, here is how to disable the presence server feature:

cmake ./build -DENABLE_PRESENCE=OFF
make -C ./build -j<njobs>

You may also use ccmake or cmake-gui utilities to interactively configure the project:

ccmake ./build
make -C ./build -j<njobs>

Building RPM or DEB packages

This procedure will help you generate a unique RPM package containing Flexisip, all its dependencies and the corresponding package for debug symbols. The following options are relevant for packaging:

OptionDescription
CMAKE_INSTALL_PREFIXPrefix path where the package will install the files.
SYSCONF_INSTALL_DIRDirectory where Flexisip expects to find its default configuration.
FLEXISIP_SYSTEMD_INSTALL_DIRDirectory where systemd units will be installed.
CMAKE_BUILD_TYPESet it to “RelWithDebInfo” to have debug symbols in the debuginfo package.
CPACK_GENERATORPackage type: “RPM” or “DEB”.
cmake ./build -DCMAKE_INSTALL_PREFIX=/opt/belledonne-communications -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSYSCONF_INSTALL_DIR=/etc -DFLEXISIP_SYSTEMD_INSTALL_DIR=/usr/lib/systemd/system -DCPACK_GENERATOR=RPM
make -C ./build -j<njobs> package

Packages are now available in the ./build directory.

More info on RPM packaging

Docker

A docker image can be built from sources using the following command:

docker build -t flexisip --build-arg='njobs=<njobs>' -f docker/flex-from-src .

Nix ❄️

Flexisip can also be compiled with Nix. From the root of the repository, you can obtain a development shell using:

nix-shell

Or with Flakes enabled:

nix develop

Nix makes it easier to have a reproducible development environment on any Linux distribution, and doesn't interfere with other installed tooling. It is just an additional, optional way to build flexisip.

Example build commands:

CC=gcc CXX=g++ BUILD_DIR_NAME="build" cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -S . -B ./$BUILD_DIR_NAME -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="$PWD/$BUILD_DIR_NAME/install" -DENABLE_UNIT_TESTS=ON -DENABLE_STRICT_LINPHONESDK=OFF -DINTERNAL_JSONCPP=OFF
cd build
clear && cmake --build . --target install && LSAN_OPTIONS="suppressions=../sanitizer_ignore.txt" bin/flexisip_tester --resource-dir "../tester/" --verbose

Note to maintainers

At the exception to shell.nix, .nix files should live inside the nix/ folder.

All .nix files should be formatted with nixpkgs-fmt.

Configuration

Flexisip needs a configuration file to run correctly. Use ./flexisip --dump-all-default > flexisip.conf to generate a documented default configuration file.

Developer notes

With sofia-sip, you can choose between msg_dup() and msg_copy(), sip_from_dup() and sip_from_copy(), etc. The difference isn't well documented in the sofia-sip documentation, but it is important to understand that:

  • *_dup() makes a copy of the structure plus all included strings inside (deep copy).
  • *_copy() just makes a copy of the structure, not the strings pointed by it (shallow copy). These functions are dangerous; use *_dup() versions in doubt.