@ -17,7 +17,7 @@ Install the dependencies (as a virtual package) - CHANGE linux-virt-dev TO MATCH
apk add linux-virt-dev bsd-compat-headers linux-headers dahdi-linux-dev wget git nano build-base alsa-lib-dev alpine-sdk bluez-dev bsd-compat-headers curl-dev dahdi-tools-dev findutils freetds-dev imap-dev jansson-dev libcap-dev libedit-dev libogg-dev libpri-dev libresample libsrtp-dev libtool libxml2-dev lua-dev mariadb-connector-c-dev ncurses-dev subversion newt-dev openssl1.1-compat-dev opus-dev opusfile-dev pjproject-dev popt-dev libpq-dev spandsp-dev speexdsp-dev speex-dev sqlite-dev tar tiff-dev unbound-dev unixodbc-dev util-linux-dev perl file autoconf automake pkgconfig zlib-dev -t builddep.asterisk
apk add linux-virt-dev bsd-compat-headers linux-headers dahdi-linux-dev wget git nano build-base alsa-lib-dev alpine-sdk bluez-dev bsd-compat-headers curl-dev dahdi-tools-dev findutils freetds-dev imap-dev jansson-dev libcap-dev libedit-dev libogg-dev libpri-dev libresample libsrtp-dev libtool libxml2-dev lua-dev mariadb-connector-c-dev ncurses-dev subversion newt-dev openssl1.1-compat-dev opus-dev opusfile-dev pjproject-dev popt-dev libpq-dev spandsp-dev speexdsp-dev speex-dev sqlite-dev tar tiff-dev unbound-dev unixodbc-dev util-linux-dev perl file autoconf automake pkgconfig zlib-dev -t builddep.asterisk
```
```
Clone the repos:
Clone the repo(s). You only need Asterisk if you don't plan on needing dahdi or libpri support. You can also skip the next few sections.
```
```
git clone https://github.com/asterisk/asterisk.git
git clone https://github.com/asterisk/asterisk.git
@ -71,7 +71,7 @@ make install
Wow. This is looking promising. Let's do Asterisk.
Wow. This is looking promising. Let's do Asterisk.
Grab the Opus codec and copy the file in to the repository before cd'ing in to it.
Grab the Opus codec and copy the file in to the repository before cd'ing in to it. Opus is optional. You can skip if desired.
```
```
wget https://distfiles.alpinelinux.org/distfiles/v3.16/asterisk-13.7-90e8780faccc79e68c07775c6ab2fe1ffaccfa08.tar.gz
wget https://distfiles.alpinelinux.org/distfiles/v3.16/asterisk-13.7-90e8780faccc79e68c07775c6ab2fe1ffaccfa08.tar.gz
@ -81,14 +81,18 @@ cp asterisk-opus-90e8780faccc79e68c07775c6ab2fe1ffaccfa08/codecs/ex_opus.h aste
```
```
If you skipped any of the optional stuff; start here.
Browse to the repository folder and grab the following files:
Browse to the repository folder and grab the following files. The patch files don't work like I think they should; you have to tell it where the file is.
Since you're doing this in the repository, you typically just drop the first folder; includes/whatever.c, main/code.c, etc.
```
```
wget https://git.alpinelinux.org/aports/plain/main/asterisk/10-musl-mutex-init.patch
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/20-musl-astmm-fix.patch
wget https://git.alpinelinux.org/aports/plain/main/asterisk/40-asterisk-cdefs.patch
wget https://git.alpinelinux.org/aports/plain/main/asterisk/40-asterisk-cdefs.patch
patch -ruN 10-musl-mutex-init.patch
patch -ruN 20-musl-mutex-init.patch
patch -ruN 40-asterisk-cdefs.patch
```
```
Grab Asterisk's MP3
Grab Asterisk's MP3
@ -104,10 +108,10 @@ res_crypto.c requires some attention. Open the file and add these lines with the
#endif
#endif
```
```
All patched. Now configure.
All patched. Now configure.If you're skipping all dahdi, pri, and/or opus; you'll want to remove their `--with- ` entries in the ./configure. They're at the end of the command.
```
```
./configure --build=$CBUILD --host=$CHOST --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --infodir=/usr/share/info --libdir=/usr/lib --localstatedir=/var --disable-xmldoc --enable-permanent-dlopen --with-gsm=internal --with-popt --with-z --with-newt --with-unixodbc --with-postgres --with-tds --with-dahdi --with-pri --with- tonezone --with-resample --with-sqlite3 --with-speex --with-asound --without-x11 --without-pjproject-bundled --with-spandsp --with-bluetooth --with-libcurl --with-libedit --with-srtp --with-imap=system --with-opus --with-opusfile
./configure --build=$CBUILD --host=$CHOST --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --infodir=/usr/share/info --libdir=/usr/lib --localstatedir=/var --disable-xmldoc --enable-permanent-dlopen --with-gsm=internal --with-popt --with-z --with-newt --with-unixodbc --with-postgres --with-tds --with-tonezone --with-resample --with-sqlite3 --with-speex --with-asound --without-x11 --without-pjproject-bundled --with-spandsp --with-bluetooth --with-libcurl --with-libedit --with-srtp --with-imap=system --with-opus --with-opusfile --with-dahdi --with-pri
```
```
@ -149,8 +153,9 @@ chmod 644 /etc/init.d/asterisk
wget https://git.alpinelinux.org/aports/plain/main/asterisk/asterisk.logrotate?h=3.16-stable
wget https://git.alpinelinux.org/aports/plain/main/asterisk/asterisk.logrotate?h=3.16-stable
mv asterisk.logrotate?h=3.16-stable /etc/logrotate.d/asterisk
mv asterisk.logrotate?h=3.16-stable /etc/logrotate.d/asterisk
chmod 644 /etc/logrotate.d/asterisk
chmod 644 /etc/logrotate.d/asterisk
chown -R asterisk: /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk
chown -R asterisk:asterisk "$subpkgdir"/var/*/asterisk
chmod -R 750 /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk
chown -R asterisk:asterisk "$subpkgdir"/etc/asterisk
chmod -R u=rwX,g=rX,o= "$subpkgdir"/etc/asterisk
rc-update add asterisk
rc-update add asterisk
```
```