Previous
Home | Wiki
Next

Phase 2: Installing Asterisk

1. Install CVSup
As per the instructions on the Asterisk download page, I used CVSup to obtain Asterisk.  General instructions on installing the prerequisite programs, obtaining the CVSup sources, and building CVSup from the sources can be found on the CVSup FAQ.  Below you will find a walkthrough of my CVSup build.  You'll want to login as root for the entire Asterisk installation, so do that before you get started.

Build and Install Ezm3
Ezm3 is a simple, portable distribution of the Modula-3 compiler and runtime libraries which are needed to build CVSup.  The following steps can be followed to build and install Ezm3.

1. Download the following files from ftp://ftp.freebsd.org/pub/FreeBSD/development/CVSup/ezm3/ to the /usr/src directory:
The Ezm3 bootstrap distribution: ezm3-1.2-LINUXLIBC6-boot.tar.bz2
The Ezm3 source distribution: ezm3-1.2-src.tar.bz2

2. Create a link to make named gmake by issuing the following command at a console window's command line:
ln /usr/bin/make /usr/bin/gmake
Note: Typing which gmake at the command line should output /usr/bin/gmake if the link creation was successful.

3. Unpack the Ezm3 distribution files by issuing the following commands at a console window's command line:
cd /usr/src
tar -xjf ezm3-1.2-LINUXLIBC6-boot.tar.bz2
tar -xjf ezm3-1.2-src.tar.bz2

4. Build and install Ezm3 by issuing the following commands at a console window's command line:
cd /usr/src/ezm3-1.2
gmake

Build and Install the zlib Compression Library
zlib is a free, general-purpose data-compression library which is needed to build CVSup.  The following steps can be followed to build and install zlib.

1. Download the following file from http://www.zlib.net/ to the /usr/src directory:
The zlib source distribution: zlib-1.2.2.tar.bz2

2. Unpack the zlib distribution file by issuing the following commands at a console window's command line:
cd /usr/src
tar -xjf zlib-1.2.2.tar.bz2

3. Build and install zlib by issuing the following commands at a console window's command line:
cd /usr/src/zlib-1.2.2
make test; make install

Build and Install CVSup
Once you've installed Ezm3 and zlib, the following steps can be followed to build and install CVSup.

1. Install the X Athena widget set library development package by issuing the following command at a console window's command line:
apt-get install libxaw7-dev

2. Download the following file from ftp://ftp.freebsd.org/pub/FreeBSD/development/CVSup/sources/ to the /usr/src directory:
The CVSup source distribution: cvsup-snap-16.1h.tar.gz

3. Unpack the CVSup distribution file by issuing the following commands at a console window's command line:
cd /usr/src
tar -xvvzf cvsup-snap-16.1h.tar.gz

4. Build and install CVSup by issuing the following commands at a console window's command line:
cd /usr/src/cvsup-snap-16.1h
make
cd client
make install

2. Check Out Asterisk Using CVSup
The following steps can be followed to check out Asterisk using CVSup.

1. Download the following file to the /usr/src directory:
The Asterisk sup file: asterisk-sup

2. Launch CVSup's GUI by issuing the following commands at a console window's command line:
cd /usr/src
cvsup asterisk-sup

3. Start the file transfers by hitting the > button (you may have to stop and restart a few times to get the transfers going).

3. Install the Required Packages
The Asterisk download page lists a group of packages that you will need to build and install Asterisk.  The following table translates the package names listed on Asterisk's site to the corresponding Debian packages.  Just use the command apt-get install package-name to install each of these packages on your system.  Some of them may already be installed and up to date.

Asterisk Package Name
Debian Package Name(s)
ncurses
ncurses-base, ncurses-bin, ncurses-term
ncurses-devel
libncurses5-dev
openssl
openssl
openssl-devel
libssl-dev
zlib
zlib1g
zlib-devel
zlib1g-dev
bison
bison
bison-devel
----- (nothing found by apt-cache search)

Note: The command apt-cache search search-string is useful for finding Debian packages.

4. Install a 2.4.xx Kernel
Asterisk should be run on a 2.4.xx kernel, but the kernel installed with the Debian woody release is version 2.2.20.  This means you'll need to install a new kernel.  In this section, I'll review the steps I followed to accomplish this task.  For a more in-depth look at the procedure check out this Debian kernel compile guide.

1. List the available kernel source packages by issuing the following command at a console window's command line:
apt-cache search kernel-source

2. Install the most up to date 2.4.xx kernel source package by issuing the following command at a console window's command line:
apt-get install kernel-source-2.4.xx

3. Install the packages required to compile a new kernel by issuing the following command at a console window's command line:
apt-get install kernel-package ncurses-dev fakeroot wget bzip2

4. Unpack the kernel source by issuing the following commands at a console window's command line:
cd /usr/src
tar -xjf kernel-source-2.4.xx.tar.bz2

5. Display the existing kernel's release version by issuing the following command at a console window's command line:
uname -r
Note: The existing kernel's release version is 2.2.20 for this example, but substitute the output from this command in the following steps.

6. Configure the new kernel by issuing the following commands at a console window's command line:
cd /usr/src/kernel-source-2.4.xx
make menuconfig
IMPORTANT: The configuration menu will be launched by these commands.  The configuration of the kernel can be changed here to suit your needs (processor type and features, network device support, etc.), but to keep this example simple I'm just using the existing kernel configuration.

7. Use the existing kernel configuration as a starting point for the configuration of the new kernel by following the steps below:
Select Load an Alternate Configuration File from the configuration menu.
Enter /boot/config-2.2.20 as the configuration file to load.
Save the new kernel configuration.

8. Build the new kernel by issuing the following commands at a console window's command line:
make dep
make-kpkg clean
fakeroot make-kpkg --revision=custom.1.0 kernel_image
Note: Give the default answer to any questions.  Creating a boot floppy is optional, but it is a Very Good Idea.  When asked whether to use the existing lilo.conf file, answer Yes.  If compilation stops with an error, run make clean then rerun the previous commands starting with make menuconfig.  Change the kernel configuration where the error occurred.  If no errors occurred, the new kernel image will exist as a Debian package in the following file:
/usr/src/kernel-image-2.4.xx_custom.1.0_i386.deb

9. Install the new kernel by issuing the following commands at a console window's command line:
cd /usr/src
dpkg -i kernel-image-2.4.xx_custom.1.0_i386.deb
lilo

10. Reboot into the new kernel by issuing the following command at a console window's command line:
shutdown -r now

11. After rebooting, confirm that the new kernel was installed by issuing the following command at a console window's command line:
uname -a

5. Install the Asterisk Components
This section will guide you through building and installing the components that make up a working Asterisk system.  As per the Asterisk download page, the Asterisk components must be installed in the following order:
1. Zaptel
2. Libpri
3. Asterisk

Build and Install Zaptel
Zaptel provides support for Digium hardware.  The following steps can be followed to build and install Zaptel.

1. Create symbolic links to the new kernel's source files by issuing the following commands at a console window's command line:
cd /usr/src
ln -s /usr/src/kernel-source-2.4.xx linux
ln -s /usr/src/kernel-source-2.4.xx linux-2.4

2. Build and install Zaptel by issuing the following commands at a console window's command line:
cd /usr/src/zaptel
make clean; make install

Build and Install Libpri
Libpri provides support for T1 and E1 interfaces.   Build and install Libpri by issuing the following commands at a console window's command line:
cd /usr/src/libpri
make clean; make install

Build and Install Asterisk
Build and install Asterisk (finally!!) by issuing the following commands at a console window's command line:
cd /usr/src/asterisk
make clean; make install

Previous
Home | Wiki
Next