I long to accomplish great and noble tasks, but it is my chief duty to accomplish humble tasks as though they were great and noble. The world is moved along, not only by the mighty shoves of its heroes, but also by the aggregate of the tiny pushes of each honest worker.
In the previous chapter, we discussed preparing a system to install Asterisk. Now it’s time to get our hands dirty!
Although a large number of Linux[42] distributions and PC architectures are excellent candidates for Asterisk, we have chosen to focus on a single distribution in order to maintain brevity and clarity throughout the book. The instructions that follow have been made as generic as possible, but you will notice a leaning toward CentOS directory structure and system utilities. We have chosen to focus on CentOS (arguably, the most popular distro for Asterisk) because its command set, directory structure, and so forth are likely to be familiar to a larger percentage of readers (we have found that many Linux administrators are familiar with CentOS, even if they don’t prefer it). This doesn’t mean that CentOS is the only choice, or even the best one for you. A question that often appears on the mailing lists is: “Which distribution of Linux is the best to use with Asterisk?” The multitude of answers generally boils down to “the one you like the best.”[43]
Most Asterisk configurations are composed of three main packages : the main Asterisk program (asterisk), the Zapata telephony drivers (zaptel), and the PRI libraries (libpri). If you plan on a pure VoIP network, the only real requirement is the asterisk package, but we recommend installing all three packages; you can choose what modules to activate later. The zaptel drivers are required if you are using analog or digital hardware, or if you’re using the ztdummy driver (discussed later in this chapter) as a timing source. The libpri library is optional unless you’re using ISDN PRI interfaces, and you may save a small amount of RAM if you don’t load it, but we recommend that it be installed in conjunction with the zaptel package for completeness.
In the first edition of this book, we recommended that you install the additional asterisk-sounds package. This was a separate compressed archive that you would download, extract, and then install. As of Asterisk version 1.4.0, there are now two sets of sounds packages: the Core Sound package and the Extra Sound package. Since Asterisk supports several different audio formats, these packages can be obtained in a number of different sound formats, such as G.729 and GSM. The reason for all of the different formats is that Asterisk can use the sound format that requires the least amount of CPU transcode. For example, if you have a lot of connections coming in on VoIP channels that are running GSM, you would want to have the GSM version of the sound files. You can select one or more sound prompt types in the menuselect screen (discussed later in this chapter). We recommend that you install at least one type of sounds file from both the Core Sound package and Extra Sound package menu items. Since we may make use of some of the Extra Sound files throughout this book, we will assume you have at least one of the formats installed.
To compile Asterisk, you must have the GCC compiler (version 3.x or later) and its dependencies on your system. Asterisk also requires bison, a parser generator program that replaces yacc, and ncurses for CLI functionality. The cryptographic library in Asterisk requires OpenSSL and its development packages.
Zaptel requires libnewt and its development packages for the zttool program (see Using ztcfg and zttool later in this chapter). If you’re using PRI interfaces, Zaptel also requires the libpri package (again, even if you aren’t using PRI circuits, we recommend that you install libpri along with zaptel).
If you install the Software Development packages in CentOS, you will have all of these tools. If you are looking to keep things trim, and wish to install the bare minimum to compile Asterisk and its related packages, Table 3-1 will prove useful.
Note
In the following table, the -y
switch to the yum
application means to answer yes to all prompts, and using it will
install the application and all dependencies without prompting you.
If this is not what you want, omit the -y
switch.
If you just want to install all of the above packages in one go, you can specify more than one package on the command line, e.g.:
# yum install -y gcc ncurses-devel libtermcap-devel [...]
Table 3-1. List of packages required to compile libpri, zaptel, and asterisk
Package name | Installation command | Note | Used by |
---|---|---|---|
GCC 3.x | yum install -y gcc | Required to compile zaptel, libpri, and asterisk | libpri, zaptel, asterisk |
ncurses-devel | yum install -y ncurses-devel | Required by menuselect | menuselect |
libtermcap-devel | yum install -y libtermcap-devel | Required by asterisk | asterisk |
Kernel Development Headers | yum install -y kernel-devel | Required to compile zaptel | zaptel |
Kernel Development Headers (SMP) | yum install -y kernel-smp-devel | Required to compile zaptel | zaptel |
GCC C++ 3.x | yum install -y gcc-c++ | Required by asterisk | asterisk |
OpenSSL (optional) | yum install -y openssl-devel | Dependency of OSP, IAX2 encryption, res_crypto (RSA key support) | asterisk |
newt-devel (optional) | yum install -y newt-devel | Dependency of zttool | zaptel |
zlib-devel (optional) | yum install -y zlib-devel | Dependency of DUNDi | asterisk |
unixODBC; unixODBC-devel (optional) | yum install -y unixODBC-devel | Dependency of func_odbc, cdr_odbc, res_config_odbc, res_odbc, ODBC_STORAGE | asterisk |
libtool (optional; recommended) | yum install -y libtool | Dependency of ODBC-related modules | asterisk |
GNU make (version 3.80 or higher) [a] | yum install -y make | Required to compile zaptel and asterisk | asterisk |
[a] It is a common problem among new installs on some Linux distriebutons to see GNU make versions of 3.79 or lower. Note that Asterisk will no longer build correctly unless you have at least version 3.80 of GNU make. |
[42] And some non-Linux operating systems as well, such as Solaris, *BSD, and OS X. You should note that while people have managed to successfully run Asterisk on these alternative systems, Asterisk was, and continues to be, actively developed for Linux.
[43] We will be using CentOS Server 4.4 in this book, which we usually install with nothing except the Editors package selected. If you are not sure what distribution to choose, CentOS is an excellent choice. CentOS can be obtained from http://www.centos.org.
Get Asterisk: The Future of Telephony, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.