Compilation instructions for SEMS
=================================

SEMS uses CMake as its build system.

Quick Start
-----------

mkdir -p build && cd build
cmake ..
make
make test
sudo make install

CMake Targets
-------------

 $ make
builds the core and all applications.

 $ make install
installs SEMS to the configured prefix (default: /usr/local).

 $ make test
runs the test suite.

 $ make rpmtar
creates a source tarball in ~/rpmbuild/SOURCES/ for RPM building.

 $ make package_source
creates a source tarball (.tar.gz) in the build directory.

 $ make doc
generates doxygen documentation (output in doc/doxygen_doc).
Requires doxygen to be installed.

 $ make fulldoc
generates full doxygen documentation with cross-referenced source
(output in doc/doxygen_fulldoc).

CMake Options
-------------

Configure options using -D flags with cmake:

  cmake .. -DSEMS_USE_SPANDSP=yes -DSEMS_USE_G729=yes

Available options:

+-------------------------+----------+----------------------------------------+
|  Option                 | Default  | Description                            |
+-------------------------+----------+----------------------------------------+
| SEMS_USE_OPUS           | OFF      | Build with Opus codec                  |
| SEMS_USE_SPANDSP        | OFF      | Build with spandsp (DTMF detection)    |
| SEMS_USE_LIBSAMPLERATE  | OFF      | Build with libsamplerate               |
| SEMS_USE_ZRTP           | OFF      | Build with ZRTP encryption             |
| SEMS_USE_MP3            | OFF      | Build with MP3 support (lame/mpg123)   |
| SEMS_USE_ILBC           | ON       | Build with iLBC codec                  |
| SEMS_USE_G729           | OFF      | Build with bcg729 library              |
| SEMS_USE_CODEC2         | OFF      | Build with codec2 library              |
| SEMS_USE_TTS            | OFF      | Build with text-to-speech (Flite)      |
| SEMS_USE_OPENSSL        | OFF      | Build with OpenSSL                     |
| SEMS_USE_MONITORING     | ON       | Build with monitoring support          |
| SEMS_USE_IPV6           | ON       | Build with IPv6 support                |
| SEMS_USE_PYTHON         | ON       | Build with Python modules              |
| SEMS_USE_ASAN           | OFF      | Build with AddressSanitizer            |
+-------------------------+----------+----------------------------------------+

Installation Prefixes
---------------------

+-------------------+----------------+----------------------------------------+
|  Option           | Default        | Description                            |
+-------------------+----------------+----------------------------------------+
| SEMS_CFG_PREFIX   | ""             | Configuration file prefix              |
| SEMS_AUDIO_PREFIX | /usr/local/lib | Audio files prefix                     |
| SEMS_EXEC_PREFIX  | /usr/local     | Executable prefix                      |
| SEMS_RUNDIR_PREFIX| /var/local/run | Runtime directory prefix               |
| SEMS_LIBDIR       | lib            | Library subdirectory                   |
| SEMS_DOC_PREFIX   | /usr/share/doc | Documentation prefix                   |
+-------------------+----------------+----------------------------------------+

Example for system-wide installation:

  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DSEMS_CFG_PREFIX= \
    -DSEMS_AUDIO_PREFIX=/usr/share \
    -DSEMS_EXEC_PREFIX=/usr \
    -DSEMS_LIBDIR=lib \
    -DSEMS_DOC_PREFIX=/usr/share/doc

Inband DTMF Detector
--------------------

Two different inband DTMF detectors can be used. The SEMS' own one
is always available, and additionally, the inband DTMF detector from
spandsp library (www.soft-switch.org) can be used. To compile with
spandsp support:

  cmake .. -DSEMS_USE_SPANDSP=yes

IVR (Python)
------------

You need python3 development support. To enable Python modules:

  cmake .. -DSEMS_USE_PYTHON=yes

Python modules are enabled by default.

Text-to-Speech with Flite
-------------------------

To enable text-to-speech support using the Flite speech synthesizer:

1. Install Flite development files (e.g., flite-devel or flite1-dev)
2. Configure with:

   cmake .. -DSEMS_USE_TTS=yes

MP3 Support
-----------

To enable MP3 encoding and decoding:

1. Install lame and mpg123 development files
2. Configure with:

   cmake .. -DSEMS_USE_MP3=yes

Note: Using the LAME encoding engine (or other mp3 encoding technology)
may require a patent license in some countries.

G.729 Support
-------------

To enable G.729 codec support:

1. Install bcg729 development files
2. Configure with:

   cmake .. -DSEMS_USE_G729=yes
