ASTRISK INSTALLATION

A). Asterisk has dependencies on following packeges!
Install first packages before installing Asterisk mentioned as below:

apt-get install linux-headers-`uname -r` bison openssl libssl-dev libeditline0 libeditline-dev libedit-dev 

apt-get install build-essential php5-cli mysql-common libmysqlclient15-dev libnewt-dev mysql-server php5-mysql  libcurl3-dev vim sox


sudo apt-get install libxml2.dev


B). Download latest version of Dahdi, Libpri, Asterisk
Download latest version of Dahdi latest stable version 2.4.*
Download latest version of libpri latest  stable version 1.4.*
Download latest version of Asterisk latest stable version 1.8.*

C). Now Install the all three Packages in the the same sequence as mentioned below!
1). Dahdi
2). Libpri
3). Asterisk
Note:*Due to dependency one on another please strictly fallow the sequence.

This is how the installation done for Asterisk for a PRI line.