Move into /usr/src/
cd /usr/src/
Download Asterisk from their website
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz
Extract the downloaded archive
tar zxvf asterisk-20-current.tar.gz
Optionally, remove the archive
rm asterisk-20-current.tar.gz
Move into the new directory
cd asterisk-20.5.2/
Run the install script
contrib/scripts/install_prereq install
Run the configure script
./configure
Select and modules to be installed
make menuselect
Compile Asterisk
make
Install Asterisk on the system
make install
OPTIONAL: Generate sample config files and move them into the sample
directory
make samples
mkdir /etc/asterisk/samples
mv /etc/asterisk/*.* /etc/asterisk/samples/
OPTIONAL: Generate files that make up a basic PBX config
make basic-pbx
Generate startup files
make config
Enable and start Asterisk
systemctl enable asterisk.service
systemctl start asterisk.service
systemctl status asterisk.service
You should now be able to launch the Asterisk CLI and further configure the system
asterisk -rvvvv