Je propose un script que j'ai utilisé pour une installation d'asterisk en version 1.6 bien sur il peut être modifié en cas de besoins. (Je ne suis que débutant en script) :s

#!/bin/bash
#Definition de nos variables
aaddons=asterisk-addons-1.6.0-current.tar.gz
dtools=dahdi-tools-2.2.0.tar.gz
as=asterisk-1.6.0.18.tar.gz
libpri=libpri-1.2-current.tar.gz
dlinux=dahdi-linux-2.2.0.2.tar.gz
home=/tmp/
#Telechargement des fichiers necessaires à l'installation si le fichier n'existe pas

if [ ! -e ${home}$aaddons ] ; then
    wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.0-current.tar.gz
fi
if [ ! -e ${home}$dtools ] ; then
    wget http://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/dahdi-tools-2.2.0.tar.gz
fi
if [ ! -e ${home}$as ] ; then
    wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.0.18.tar.gz
fi
if [ ! -e ${home}$libpri ] ; then
    wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.2-current.tar.gz
fi
if [ ! -e ${home}$dlinux ] ; then
    wget http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-2.2.0.2.tar.gz
fi
#Telechargement des programmes necessaires à la compilation et au fonctionnement
apt-get -y install gcc g++
apt-get -y install ncurses-dev
apt-get -y install make
apt-get -y install linux-headers- linux-headers-2.6.26-2-686

#Decompression des paquets
#L'option -C pourra être utilisée en cas de besoins
tar zxvf ${home}libpri-1.2-current.tar.gz
tar zxvf ${home}dahdi-linux-2.2.0.2.tar.gz
tar zxvf ${home}dahdi-tools-2.2.0.tar.gz
tar zxvf ${home}asterisk-1.6.0.18.tar.gz
tar zxvf ${home}asterisk-addons-1.6.0-current.tar.gz

#On se mets dans le répertoire en question puis nous lancons le processus d'installation
cd ${home}libpri-1.2.8
make clean
./configure
make
make install

cd ${home}dahdi-linux-2.2.0.2
make clean
./configure
make
make install

cd ${home}dahdi-tools-2.2.0
make clean
./configure
make
make install

cd ${home}asterisk-1.6.0.18
make clean
./configure
make
make install
make samples
make config


cd ${home}asterisk-addons-1.6.0.3
make clean
./configure
make
make install