How to install asterisk from source on Debian

Asterisk Installation Guides | Communications

1)

# cd /usr/src

2) (YOU WILL HAVE TO GET THE MOST CURRENT RELEASE NAMES FROM www.asterisk.org
# wget http://ftp.digium.com/pub/asterisk/asterisk-1.2.6.tar.gz
# wget http://ftp.digium.com/pub/zaptel/zaptel-1.2.5.tar.gz
# wget http://ftp.digium.com/pub/libpri/libpri-1.2.2.tar.gz
# wget http://ftp.digium.com/pub/asterisk/asterisk-addons-1.2.2.tar.gz
# wget http://ftp.digium.com/pub/asterisk/asterisk-sounds-1.2.1.tar.gz

3)
# apt-get install screen
# apt-get install unp bzip2 gcc

(THIS LINE IS BY YOUR VERSION NUMBER.. DO A 'uname -a' to see what version you have then 'apt-cache search 2.6.8'
look for something called linux headers, or kernel headers.. nothing will compile with out it and will fail every time.
# apt-get install kernel-headers-2.6.8-2-386

This other stuff i found you need for some reason..You may already have some of this stuff depending on your version you run.
# apt-get install ncurses-base
# apt-get install libncurses5-dev libncurses5
# apt-get install openssl
# apt-get install libssl-dev
# apt-get install zlib1g zlib1g-dev zlibc

4)
This is the actual process of extracting all the source code. REMEMBER /usr/src is the best place to do this...
# unp asterisk-1.2.6.tar.gz
# unp zaptel-1.2.5.tar.gz
# unp libpri-1.2.2.tar.gz
# unp asterisk-sounds-1.2.1.tar.gz
# unp asterisk-addons-1.2.2.tar.gz

5)
this is the actuall process of compiling the asterisk program. if all the libs are installed it should compile no problem...
# cd zaptel-1.2
# make clean; make; make install
# cd ../libpri-1.2
# make clean; make; make install
# cd ../asterisk-1.2
# make clean; make; make install

6) Write your dial plan (this is a deep subject too big to discuss here...)
This should do it for you!