Asterisk-13 installieren

Starthilfe … kompilieren von Asterisk in einem Shell Script.
Grundlage: Debian 7 Internet Installation (Kleine CD) … Download unter:
http://www.debian.org/distrib/netinst#smallcd

#!/bin/sh

apt-get update && apt-get upgrade -y

asteriskversion=asterisk-13.7.2

apt-get install -y linux-headers-`uname -r`
apt-get install -y build-essential
apt-get install -y wget
apt-get install -y libssl-dev
apt-get install -y libncurses5-dev
apt-get install -y libnewt-dev
apt-get install -y libxml2-dev
apt-get install -y libsqlite3-dev
apt-get install -y libjansson-dev
apt-get install -y git

ln -s /usr/src/linux-headers-`uname -r` /usr/src/linux

cd /usr/src

## pjsip installieren
git clone https://github.com/asterisk/pjproject pjproject
cd /usr/src/pjproject
./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr
## um IPv6 Support in pjsip einzuschalten, muss das CFLAGS='-DPJ_HAS_IPV6=1' angegeben werden !!!!
#./configure CFLAGS='-DPJ_HAS_IPV6=1' --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr
make dep
make
make install
ldconfig

### check inst.
# ldconfig -p | grep libpj

## System vorbereiten
## download Asterisk
if [ ! -f /usr/src/$asteriskversion.tar.gz ] ; then
wget http://downloads.asterisk.org/pub/telephony/asterisk/$asteriskversion.tar.gz
fi
if [ ! -d /usr/src/$asteriskversion ] ; then
tar xvzf $asteriskversion.tar.gz
fi
## erforderliche libs installieren
/usr/src/$asteriskversion/contrib/scripts/install_prereq install

## optional
/usr/src/$asteriskversion/contrib/scripts/get_mp3_source.sh
/usr/src/$asteriskversion/contrib/scripts/get_ilbc_source.sh
gcc -O2 /usr/src/$asteriskversion/contrib/utils/rawplayer.c -o /usr/bin/rawplayer

## asterisk installieren
cd /usr/src/$asteriskversion
./configure
make menuconfig
make
make install
make samples
make config
make install-logrotate

exit 0