-
Notifications
You must be signed in to change notification settings - Fork 2
Build and Installation
This page documents the normal source build for GABPBX.
Do not edit generated configure or make scripts for a normal build. Use the
standard build method.
./configure
make menuselect
make
make installFor an already configured tree, this is also valid:
make installmake install builds pending objects first and then installs them.
For first-time lab installs only:
make samplesBe careful: make samples can overwrite existing files under /etc/gabpbx.
Use lowercase -j:
make -j$(nproc)Uppercase -J is not the GNU make parallel-build option.
This recipe was validated on Debian 13 with source trees in /opt:
/opt/sofia-sip
/opt/gabpbx
Install the build tools and the common module dependencies used by a practical
chan_sofia installation:
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential autoconf automake libtool-bin pkg-config git \
libopus-dev libsrtp2-dev libspandsp-dev libpq-dev libxml2-dev \
libsqlite3-dev libssl-dev zlib1g-dev uuid-dev libncurses-dev \
libedit-dev libcurl4-openssl-dev libjansson-dev libspeex-dev \
libspeexdsp-dev libogg-dev libvorbis-dev libasound2-dev libgsm1-dev \
unixodbc-dev libldap2-dev libsnmp-devVerify the important dependencies:
for p in opus libsrtp2 spandsp libpq libxml-2.0 sqlite3 openssl zlib; do
pkg-config --exists "$p" && echo "OK $p $(pkg-config --modversion "$p")"
doneBuild and install Sofia-SIP first:
cd /opt/sofia-sip
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATHIf the Sofia-SIP checkout is missing autotools auxiliary files such as
compile, missing, install-sh, config.guess, or config.sub, generate
them using the upstream bootstrap script:
./bootstrap.shThen build and install:
./configure --prefix=/usr/local
make -j$(nproc)
make install
ldconfig
pkg-config --modversion sofia-sip-uaThe expected Sofia-SIP package version from the validated Debian 13 build was:
1.13.17
Build and install GABPBX:
cd /opt/gabpbx
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH
./configure
make menuselect.makeopts
menuselect/menuselect --enable chan_sofia menuselect.makeopts
menuselect/menuselect --enable codec_opus menuselect.makeopts
make -j$(nproc)
make installDo not run make samples on a production server unless you intentionally want
to overwrite existing configuration under /etc/gabpbx.
Verify installed binaries and modules:
gabpbx -V
find /usr/lib /usr/local/lib -path '*/gabpbx/modules/*' \( -name chan_sofia.so -o -name codec_opus.so \) -ls
ldd /usr/lib/gabpbx/modules/chan_sofia.so | grep -E 'sofia|not found'
ldd /usr/lib/gabpbx/modules/codec_opus.so | grep -E 'opus|not found'Expected successful checks include:
GABpbx 1.3.1 (chan_sofia)
libsofia-sip-ua.so.0 => /usr/local/lib/libsofia-sip-ua.so.0
libopus.so.0 => /lib/x86_64-linux-gnu/libopus.so.0
default.exports is required by module link rules when GNU ld version scripts
are used. The file contains:
{
local:
*;
};
The rule in Makefile.rules calls:
build_tools/make_linker_version_script
That helper needs default.exports as the default symbol visibility script. If
the file is missing, builds can fail with:
cp: cannot stat '/opt/gabpbx/default.exports': No such file or directory
make[1]: *** [Makefile.rules:134: chan_agent.so] Error 1
The repository must track default.exports. .gitignore should ignore
generated *.exports files but explicitly allow the base file:
*.exports
!default.exportschan_sofia requires Sofia-SIP installed in the layout used by the current
make rules:
/usr/local/include/sofia-sip-1.13
/usr/local/lib
Library:
lsofia-sip-ua
chan_sofia builds against Sofia-SIP's NUA API, which is not a distro package -
build it from the upstream source
(garacil/sofia-sip, a fork of freeswitch/sofia-sip) and install it
into /usr/local:
git clone https://github.com/garacil/sofia-sip.git
cd sofia-sip
git checkout v1.13.17 # the stable release chan_sofia is built + tested against
./bootstrap.sh # only if ./configure is missing from the checkout
./configure --prefix=/usr/local
make
make install
ldconfigIf you already have a Sofia-SIP checkout elsewhere, build it from that path
instead - only the install prefix (/usr/local) matters to the GABPBX build.
If Sofia-SIP is not installed, chan_sofia fails like this:
[CC] chan_sofia.c -> chan_sofia.o
chan_sofia.c:120:10: fatal error: sofia-sip/nua.h: No such file or directory
120 | #include <sofia-sip/nua.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [/opt/gabpbx/Makefile.rules:108: chan_sofia.o] Error 1
make: *** [Makefile:369: channels] Error 2
This means the compiler cannot find Sofia-SIP headers. The missing header comes from Sofia-SIP's NUA API:
sofia-sip/nua.h
After installing Sofia-SIP, verify:
test -f /usr/local/include/sofia-sip-1.13/sofia-sip/nua.h
test -f /usr/local/lib/libsofia-sip-ua.so || test -f /usr/local/lib/libsofia-sip-ua.a
ldconfig -p | grep sofia-sip-uaThen run the normal GABPBX build again:
cd /opt/gabpbx
./configure
make menuselect
make -j$(nproc)
make installInside make menuselect, enable chan_sofia before running the final build:
Channel Drivers -> chan_sofia
Runtime rule:
noload => chan_sip.so
load => chan_sofia.soDo not load chan_sip and chan_sofia together.
codec_opus requires libopus and pkg-config.
Debian/Ubuntu package:
apt install libopus-dev pkg-configEnable:
Codec Translators -> codec_opus
Verify after startup:
*CLI> module show like opus
*CLI> opus show
Install only the libraries needed by the modules you select in menuselect.
Common useful packages on Debian/Ubuntu:
apt install build-essential pkg-config ncurses-dev libssl-dev zlib1g-dev
apt install libxml2-dev libsqlite3-dev libpq-dev unixodbc-dev
apt install libopus-dev libsrtp2-dev libspandsp-dev
apt install libspeex-dev libspeexdsp-devModule mapping:
| Dependency | Used by |
|---|---|
Sofia-SIP source installed to /usr/local
|
chan_sofia |
libopus-dev |
codec_opus |
libsrtp2-dev and res_srtp.so
|
SRTP/encryption |
libspandsp-dev |
fax/T.38 support through SpanDSP modules |
libpq-dev |
PostgreSQL realtime/CDR/CEL modules |
unixodbc-dev |
ODBC realtime/CDR/CEL/function modules |
libsqlite3-dev |
SQLite realtime/CDR modules |
libspeex-dev, libspeexdsp-dev
|
Speex codec and DSP functions |
test -f default.exports
test -d /usr/local/include/sofia-sip-1.13
test -f /usr/local/lib/libsofia-sip-ua.so || test -f /usr/local/lib/libsofia-sip-ua.a
pkg-config --libs opus*CLI> core show version
*CLI> module show
*CLI> module show like sofia
*CLI> module show like opus
*CLI> sip show settings
*CLI> sip show peers
GABPBX can run under a native systemd unit on Debian 13. Install this file as
/etc/systemd/system/gabpbx.service:
[Unit]
Description=GABPBX PBX
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/var/lib/gabpbx
RuntimeDirectory=gabpbx
RuntimeDirectoryMode=0755
ExecStart=/usr/sbin/gabpbx -f
ExecReload=/usr/sbin/gabpbx -rx 'core reload'
ExecStop=/usr/sbin/gabpbx -rx 'core stop now'
Restart=on-failure
RestartSec=5
TimeoutStopSec=30
LimitNOFILE=65536
LimitCORE=infinity
[Install]
WantedBy=multi-user.targetEnable and start it:
systemd-analyze verify /etc/systemd/system/gabpbx.service
systemctl daemon-reload
systemctl enable gabpbx
systemctl start gabpbx
systemctl status gabpbxUseful service checks:
systemctl is-enabled gabpbx
systemctl is-active gabpbx
gabpbx -rx 'core show version'
journalctl -u gabpbx -n 40 --no-pagerModule loading is still controlled by GABPBX configuration. For chan_sofia,
make sure modules.conf does not load chan_sip.so at the same time:
noload => chan_sip.so
load => chan_sofia.soSIP — chan_sofia
Subsystems
Realtime & data
Operations