Asterisk from source

Linux vultr.guest 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux

apt-get update
apt-get upgrade
apt-get install build-essential
cd /usr/local/src
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar -zxvf asterisk-13-current.tar.gz
cd asterisk-13.*
contrib/scripts/get_mp3_source.sh
contrib/scripts/install_prereq install
contrib/scripts/install_prereq install-unpackaged
./configure --with-pjproject-bundled
make menuselect
make
make install
make samples
mkdir /etc/asterisk/samples/
mv /etc/asterisk/* /etc/asterisk/samples/
make basic-pbx
mkdir /etc/asterisk/basic_pbx
mv /etc/asterisk/* /etc/asterisk/basic_pbx/
make progdocs
make config
make install-logrotate
systemctl enable asterisk
systemctl start asterisk

Loops…..

#!/bin/sh
#
# Convert Music On Hold to native codecs.
#
for y in ulaw alaw
do
    for x in /var/lib/asterisk/moh/*.gsm;
    do
        asterisk -rx "file convert $x /var/lib/asterisk/moh/`basename $x .gsm`.$y";
    done
done