Asterisk – Leaner is Meaner!
This is my updated installation guide. This approach will be alot different than my previous installation guide. What’s different? For one, I’m using the latest and greatest Asterisk version: 1.6.2.7. This will be the leanest, meanest install yet.
I’ll be exploring the different applications and functions available within Asterisk, and my favoriate approach to using Asterisk.
STEP ONE: Install CENTOS and Tools
So we’re running the leanest install of CentOS. You probably will only need the first CD (1 of 6) for this install. I customized the installation and unchecked everything. I wanted just the bare install. Anything else we need we’ll be installing via YUM. Leaner is meaner – right?
By the way, I’m installing the latest CentOS 5.x.
Once that’s done, we’ll install the tools that we know we’ll need. This is a nice little list, so I hope your internet connection is good. Or you can install from the CD these packages if you need. So here we go:
rpm -import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
yum -y install nano setuptool ifconfig man nslookup traceroute dig chkconfig system-config-network-tui screen kernel-devel kernel-source bison openssl-devel mysql php-mysql mysql-server mysql-devel gcc libtermcap libtermcap devel newt newt-devel zlib-devel ncurses-devel gcc-c++ compat-gcc-32 compat-gcc-32-c++ unixODBC unixODBC-devel gtk+ libxml2-devel wget mlocate lynx tar nmap bzip2 mod_ssl crontabs vixie-cron libtool-ltdl libtool-ltdl-devel mysql-connector-odbc libidn curl libidn-devel curl-devel lame sox ntsysv httpd php mod_ssl php-mbstring php-mcrypt sudo vixie-cron
Let’s do a quick yum -y update and update the whole system. Then reboot.
I’m a big fan of using a database to drive Asterisk. It gives alot more flexibility for configuring on the fly and can add more redundancy to the system by separating the database from Asterisk. So we’ll be installing ODBC. We’ve already yum installed the ODBC packages. Now we just need to set them up to interface with our database server. We need to do this before we compile Asterisk, so that we can compile func_ODBC, res_ODBC and cdr_ODBC, etc. Check out a previous article here for how to setup ODBC.
The ODBC install tells us how to compile Asterisk, but I’ll note that again here:
cd /usr/src/
wget http://www.asterisk.org/downloads/asterisk/1.6.2.7
tar -zxvf asterisk-1.6.2.7.tar.gz
rm -f asterisk-1.6.2.7.tar.gz
cd /usr/src/asterisk-1.6.2.7
./configure
make && make install
make config
Because we’re using ODBC, there’s no reason that I would install the Asterisk-Addons. I mainly used it for the ability to connect to MySQL. Some others might want it for the MP3 Playback. If that’s you, here’s how you would do that:
cd /usr/src/
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.2.1.tar.gz
tar -zxvf asterisk-addons-1.6.2.1.tar.gz
rm -f asterisk-addons-1.6.2.1.tar.gz
cd asterisk-addons-1.6.2.1
./configure
make menuselectmake && make install
Other things you might have to compile…
DAHDI: http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.3.0+2.3.0.tar.gz
LibPRI: http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.10.2.tar.gz
For this example, I’m not installing anything but Asterisk. After all, the title is leaner is meaner. So we’re running the most basic of Asterisk. All connections to our carrier is purely SIP or IAX, so we only need a good Internet connection to make our PBX rock n’ roll.
Okay, so let’s backtrack just a little bit. Let’s go back to before we compiled Asterisk. Let’s take a look at the ‘make menuselect’ options and only get what we need. Obviously, that’s going to depend on your own personal requirements. I’m just going to list a couple that I didn’t need, and you probably aren’t going to need either:
APPLICATIONS:
- app_adsiprog
- app_alarmreceiver
- app_festival
CHANNEL DRIVERS:
- chan_oss
- chan_skinny
- chan_unistim
CODEC TRANSLATORS:
- codec_adpcm
- codec_g722
- codec_g726
- codec_ilbc
- codec_lpc10
FORMAT INTERPRETERS:
- format_g723
- formet_g726
- format_g729
- format_h263
- format_h264
- format_ilbc
- format_jpeg
- format_pcm
- format_siren14
- format_siren7
- format_sln16
- format_sln
- format_vox
There’s so much more than can be disabled. I like having some features around to play around with.
So that’s it. I hope that the leaner, meaner Asterisk is useful to you.