apk add -t pbx-build-deps alpine-sdk alsa-lib-dev asterisk-openrc \ binutils-dev bison bluez-dev bsd-compat-headers \ cmake curl-dev \ dahdi-linux dahdi-linux-dev dahdi-tools dahdi-tools-dev doxygen \ fftw-dev findutils flex freeradius-utils freetds-dev \ gmime-dev graphviz-dev gsm-dev \ ilbc-dev imap-dev \ jansson-dev \ libedit-dev libical-dev libpri-dev libresample libsamplerate-dev libsndfile-dev libsrtp-dev libtool libxml2-dev libxslt-dev libzip-dev \ lua-dev lua5.2-dev lua5.3-dev lua5.4-dev \ mariadb-connector-c-dev mariadb-dev mysql-client \ neon-dev net-snmp net-snmp-dev newt-dev \ openldap-clients openldap-dev openssl-dev opus-dev opusfile-dev \ pjproject-dev popt-dev portaudio-dev postgresql14-client postgresql14-dev \ spandsp spandsp-dev speex-dev speexdsp-dev sqlite sqlite-dev \ tar tiff-dev \ unbound-dev unixodbc-dev uriparser uriparser-dev util-linux-dev \ xmlstarlet mkdir -p /usr/local/src/patches/asterisk /usr/local/src/dist/asterisk /usr/local/src/build/codec2 cd /usr/local/src/dist git clone https://github.com/drowe67/codec2 git clone https://github.com/timothytylee/iksemel-1.4 iksemel cd /usr/local/src/build/codec2 cmake /usr/local/src/dist/codec2 make -j5 make install cd /usr/local/src/dist/iksemel # not sure what the order of operations is supposed to be here because I ran autoupdate # but then got messages from autogen.sh about obsolete things I should fix with autoupdate.. autoupdate ./autogen.sh ./configure # edit makefile here to remove all variables referencing the doc folder, # followed by removing the doc folder from SUBDIRS # otherwise make will error out because it wants to build the documentation # TODO: make a patch for that vi Makefile make -j5 make install cd /usr/local/src/patches/asterisk wget https://git.alpinelinux.org/aports/plain/main/asterisk/10-musl-mutex-init.patch wget https://git.alpinelinux.org/aports/plain/main/asterisk/20-musl-astmm-fix.patch wget https://git.alpinelinux.org/aports/plain/main/asterisk/30-asterisk-mariadb.patch wget https://git.alpinelinux.org/aports/plain/main/asterisk/40-asterisk-cdefs.patch wget -O 50-usecallmanager-18.11.3.patch https://raw.githubusercontent.com/usecallmanagernz/patches/master/asterisk/cisco-usecallmanager-18.11.3.patch cd /usr/local/src/dist/asterisk wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-18.11.3.tar.gz cd /usr/local/src/build tar xzf /usr/local/src/asterisk/dist/asterisk-18.11.3.tar.gz mv asterisk-18.11.3 asterisk cd /usr/local/src/build/asterisk patch --strip=1 < /usr/local/src/patches/asterisk/10-musl-mutex-init.patch patch --strip=1 < /usr/local/src/patches/asterisk/20-musl-astmm-fix.patch patch --strip=1 < /usr/local/src/patches/asterisk/30-asterisk-mariadb.patch patch --strip=1 < /usr/local/src/patches/asterisk/40-asterisk-cdefs.patch patch --strip=1 < /usr/local/src/patches/asterisk/50-usecallmanager-18.11.3.patch # Asterisk official documentation makes a big stink about how you should only use their bundled pjproject # otherwise you'll have instabilities and whatever, but their bundled pjproject doesn't build cleanly on Alpine # so they can stink up somewhere else. CFLAGS="-DENABLE_SRTP_AES_GCM -DENABLE_SRTP_AES_256" ./configure --without-pjproject-bundled make menuconfig ./contrib/scripts/get_mp3_source.sh make -j9 make install samples addgroup -S asterisk adduser -S -D -h /var/lib/asterisk -s /sbin/nologin -G asterisk -g asterisk asterisk addgroup -S dialout addgroup asterisk dialout chown -R asterisk:asterisk /run/asterisk chown -R asterisk:asterisk /var/lib/asterisk chown -R asterisk:asterisk /var/log/asterisk chown -R asterisk:asterisk /var/spool/asterisk