Asterisk 11 installieren

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


#!/bin/sh

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

asteriskversion=asterisk-11.12.0
libpriversion=libpri-1.4.15
dahdilinuxversion=dahdi-linux-2.10.0
dahditoolsversion=dahdi-tools-2.10.0

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

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

cd /usr/src

## 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
## download Libpri
if [ ! -f /usr/src/$libpriversion.tar.gz ] ; then
wget http://downloads.digium.com/pub/libpri/$libpriversion.tar.gz
fi
if [ ! -d /usr/src/$libpriversion ] ; then
tar xvzf $libpriversion.tar.gz
fi
## download dahdilinux
if [ ! -f /usr/src/$dahdilinuxversion.tar.gz ] ; then
wget http://downloads.digium.com/pub/telephony/dahdi-linux/$dahdilinuxversion.tar.gz
fi
if [ ! -d /usr/src/$dahdilinuxversion ] ; then
tar xvzf $dahdilinuxversion.tar.gz
fi
## download dahditools
if [ ! -f /usr/src/$dahditoolsversion.tar.gz ] ; then
wget http://downloads.digium.com/pub/telephony/dahdi-tools/$dahditoolsversion.tar.gz
fi
if [ ! -d /usr/src/$dahditoolsversion ] ; then
tar xvzf $dahditoolsversion.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

## libpri installieren
cd /usr/src/$libpriversion
make
make install

## dahdi installieren
cd /usr/src/$dahdilinuxversion
make
make install

cd /usr/src/$dahditoolsversion
./configure
make
make install
make config
/etc/init.d/dahdi start

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

exit 0