Files
asterisk-docker/20-debian/asterisk-build.sh

26 lines
762 B
Bash
Executable File

#!/bin/bash
apt-get -y install build-essential libssl-dev libedit-dev uuid-dev libxml2-dev libsqlite3-dev
cd /usr/src
curl -L http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz > asterisk.tar.gz
tar zxf asterisk.tar.gz
cd asterisk-20.*
# set compiler flags for cross system compatibility
export ASTCFLAGS="-g -O2 -march=x86-64 -fstack-protector-strong -Wformat -Werror=format-security"
# configure to use the bundled jansson libs (less dependancy on base image)
./configure --with-jansson-bundled
make
make install
make samples
cd /usr/src
rm -rf *
apt-get -y purge build-essential
apt -y autoremove
adduser --system --home /var/lib/asterisk --shell /sbin/nologin --group asterisk
chown -R asterisk:asterisk /var/lib/asterisk