Friday, April 10, 2009

Asterisk PBX System Install - 03 Software

Packages need to be installed on our Linux CentOS in order to install and run the Asterisk software.

Quick/Visual/Learning: When the computer reboots logon with the root password in the command window. Along with the OS they say I need the following packages:
-Asterisk (along with Extra Sound Files)
-Zaptel Drivers
-PRI Libraries
There are also some Linux packages to be installed, below is the table from the book p.39:

Yum is used to get and install the packages. You need to have a network cable and working internet connection connected to your CentOS box for this to work. Below is an example of what you should see after you type the yum command to download package. You should see that it is downloading some files.

If you are using single processor machine:
-----------single processor commands----------
# rpm -e kernel-devel (removes the kernel-devel module if it is installed)
# yum update kernel* (updates the kernel)
# init 6 (reboot the machine to load the updated kernel)
----------end single processor commands----------

If you are using multi-processor or machine:
------------multi-processor commands-------------
# rpm -e kernel-devel (removes the kernel-devel module if installed)
# rpm -e kernel-smp-devel (removes the kernel-devel module for smp if installed)
# yum update kernel-smp* (update the kernel for smp)
# init 6 (reboot to load the updated kernel)
------------end multi-processor commands-------------

Be sure to reboot the server before installing these packages (important for getting the correct kernel development package).

Here is a list of the packages I installed.

yum install -y gcc
yum install -y ncurses-devel
yum install -y libtermcap-devel
yum install -y kernel-devel (for single processor)
yum install -y kernel-smp-devel (for multi-processor)

If you do not have the right development package installed, you will get an error when you try to compile your software, stating that you do not appear to have the sources for the kernel installed.

yum install -y gcc-c++
yum install -y openssl-devel
yum install -y newt-devel
yum install -y zlib-devel
yum install -y unixODBC-devel
yum install -y libtool
yum install -y make

The wget command is suggested for downloading software files to CentOS.
To download Asterisk 1.4 to the system, first change to the directory where we want to download the files, and run the following commands:
Type cd /usr/src/ to Change Directory to the /usr/src directory
# cd /usr/src/

# wget
# wget
# wget

Next extract the 3 files
Note: you can use tar zxvf za{Tab} to have the OS complete the filename.

# cd /usr/src/
# tar zxvf zaptel-1.4-current.tar.gz
# tar zxvf libpri-1.4-current.tar.gz
# tar zxvf asterisk-1.4-current.tar.gz

The above commands will extract the files into subfolders under the /usr/src directory

Asterisk includes tools to help build the software modules you need for the phone system. Menuselect is one of these tools that you will see below.

First install Zaptel which handles communication between Asterisk software and the phone hardware.

Note: The book talks about a symbolic folder link named linux-2.4, but it is not needed.

Note: UPPER and lower case matters in Linux commands.

Next we need to compile Zaptel

First do an ls command to find out what the name of the directory is for Zaptel.

The directory which you may be able to see in the picture below (hard to see because it is in blue) is called zaptel-
Now to change from the /usr/scr directory to the /usr/scr/zaptel- directory I type the command:
#cd /usr/src/zaptel-
# make clean (I do not think this is really needed unless you need to clean out files from a previous install attempt. If you have any problems try "make distclean" instead of "make clean" to also remove files from menuconfig subdirectory)

# ./configure

# make menuselect

This brings up this menu.
I did not make changes here. (If you are not going to make changes you should not need to run menuselect so you could skip this step)
Just press the x key to save and exit.

# make

# make install

# make config
I do not have any phone hardware installed on the server so is does not find any and no reason for me to edit the file indicated below as I will be using a Cisco call router.

Now I compile libpri (This may not be needed but the book says it does not hurt to install it)
Do an ls command on in the scr directory to get the right directory name
First change to the /usr/src/ directory and then do a listing.
#cd /usr/src/
#ls /usr/src/
#cd /usr/src/libpri-version (fill in the correct version name)
#make clean


#make install

Now with Zzptel and libpri installed it is time to compile Asterisk
#cd /usr/src/
#ls /usr/src/
# cd /usr/src/asterisk-version
# make clean

# ./configure

#make menuselect

For menu navigation use the arrow keys:
Use the up and down arrow keys to move up and down.
Use the right arrow key to select an item
Use the left arrow key to go back
Use the x key to save and exit

Move down to Extras Sound Packages
Use right arrow to get into the submenu

Select the extra sounds GSM file. These will have sound recording that you will need to use with the phone system.

X key to exit the menu

Note : empty brackets [ ] means not going to be installed [*] means will install [xxx] means missing dependency so it can't be installed at this time.

#make install
This command will take a few minutes to run

# make samples

#make config

You should now have Asterisk installed.

Next time we start working on the configuration.

Asterisk PBX System Install - 04 PBX Test Config

Asterisk PBX Install - Index

No comments: