Add EDGE stuff.

master
Jay 1 year ago
parent 5db3f56bd8
commit c4dd026d76

@ -6,8 +6,8 @@ This is currently a quick and very dirty way document on compiling Asterisk on A
This is not intended to be a Tutorial or HOWTO. I am not holding hands.
I *HAVE NOT* re-verified this document with a second build. In fact, I haven't even verified
the current build works. It simply doesn't fail at any point in the process.
This has been tested on 3.16 and edge as of 27-FEB. It works and was stable. I built optimized for low memory and it ran
in a 512MB VM just fine for 3 months.
This is based heavily off Alpine's own buildlog and uses some of their scripts from aports.
@ -17,6 +17,14 @@ 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
```
The Edge repositories require some changes:
```
apk add linux-virt-dev bsd-compat-headers linux-headers wget git nano build-base alsa-lib-dev alpine-sdk bluez-dev bsd-compat-headers curl-dev findutils freetds-dev imap-dev jansson-dev libcap-dev libedit-dev libogg-dev libresample libsrtp-dev libtool libxml2-dev lua-dev mariadb-connector-c-dev ncurses-dev subversion newt-dev openssl-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
```
The DHADI and Libpri libaries don't exist in edge. As of right now they can't be built for edge; which is fine for IP only setups.
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.
```
@ -51,8 +59,7 @@ The file is `xpp/hexfile.h` if running the patch inside the dahdi-tools. You hav
```
autoreconf -fi
./configure
make -j4
./configuremake -j4
make install
make install-config
dahdi_genconf modules
@ -90,10 +97,13 @@ Since you're doing this in the repository, you typically just drop the first fol
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/40-asterisk-cdefs.patch
patch -ruN 10-musl-mutex-init.patch
patch -ruN 20-musl-mutex-init.patch
patch -ruN 40-asterisk-cdefs.patch
patch -ruN -d /path/to/asterisk < 10-musl-mutex-init.patch
patch -ruN -d /path/to/asterisk < 20-musl-mutex-init.patch
patch -ruN -d -d /path/to/asterisk < 40-asterisk-cdefs.patch
```
The patches were made with the sources in a/ and b/ folders. You'll get errors and have to manually enter the path; but the path is the same under the a and b folders. At some point I'll fix this and verify it works next time I build Asterisk.
Grab Asterisk's MP3
```
@ -108,14 +118,14 @@ res_crypto.c requires some attention. Open the file and add these lines with the
#endif
```
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.
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. You may need to append `--without-tonezone` if skipping dhadi. 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-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
```
And OMG, yes. Now do the menuselect thing:
Building under edge requires you to remove `--with-dahdi` and `--with-pri`; you will also have to add `--without-tonezone` as that is part of the dhadi dev package. Opus still optional.
```
make menuselect
@ -150,6 +160,7 @@ chmod 644 /etc/conf.d/asterisk
wget https://git.alpinelinux.org/aports/plain/main/asterisk/asterisk.initd?h=3.16-stable
mv asterisk.initd\?h=3.16-stable /etc/init.d/asterisk
chmod 644 /etc/init.d/asterisk
chmod +x /etc/init.d/asterisk
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
chmod 644 /etc/logrotate.d/asterisk
@ -160,4 +171,4 @@ rc-update add asterisk
```
That's it. It's all on you to write your configurations.
That's it. It's all on you to write your configurations. `make basicpbx` will get you started; or just copy existing configurations in to /etc/asterisk.
Loading…
Cancel
Save