Script to compile the latest version of Asterisk v1.8
I wrote this script in vim on an Ubuntu 10.04 LTS box, to stand-up the latest version of Asterisk. At the time I wrote this script, the latest version was Asterisk v1.8.11.0; however, this script maybe easily tweaked to install any version of Asterisk you like. You may find the latest (and almost every) build of Asterisk here: http://downloads.asterisk.org/pub/telephony/asterisk/releases/
After visiting the above URL and determining which version of Asterisk you wish to install, simply change the parts of the script that are relevant to that version (i.e. 1.8.11.0.tar.gz), and let it rip. If you don’t know what, ‘let it rip’ means, then read the next paragraph.
Just as a quick aside (for newbs), to make the following code executable, copy and paste the below text into a file titled whutever.sh. Then execute that script from the CLI via:
~$ sudo sh ./whutever.sh
—- Script is Below —
#!/bin/sh
# Install Asterisk v1.8.11.0 ( & vim & ntpd )
# Tested on Ubuntu 10.04 LTS
# Written by RZFeeser on 04/02/2012 – This script quickly installs Asterisk
# clear off the screen, easier to review whats happening
clear
# start with a fully upgraded machine
sudo apt-get upgrade -y
# in my opinion vim is always necessary for txt editing
# however, it is not required to install Asterisk
sudo apt-get install vim -y
# install ntpd, which is slightly cpu intensive, but compensates for system clock drift
# can be helpful if running Asterisk on a virtual machine
sudo apt-get install ntp
# load dependancies
sudo apt-get install build-essential -y
sudo apt-get install libxml2-dev -y
sudo apt-get install ncurses-dev
# create a temporary location to put Asterisk files in
mkdir /tmp/asterisk
cd /tmp/asterisk
# asterisk versions avail here:
# http://downloads.asterisk.org/pub/telephony/asterisk/releases/
wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.11.0.tar.gz
# untar the asterisk version just DL’d
tar zxvf asterisk-1.8.11.0.tar.gz
cd asterisk-1.8.11.0/
./configure
make
sudo make install
sudo make config
# install the sample configuration files (overwriting any existing config files)
sudo make samples
# uncomment the below code to install program documentation
# first line is the dependancy to read the programdocs – second installs program docs
# sudo apt-get install doxygen
# sudo make progdocs
# cleanup – deletes downloaded files and temporary directory
rm -rf /tmp/asterisk
echo ” ”
echo ” ”
echo “Thanks for installing Asterisk v1.8.11.0!”
read -p “<Press ‘Enter’ to exit>” waiting