How to Install Asterisk 1.2 in CentOS 4 and CentOS 5

Minimum Requirements

To install Asterisk server in your computer, please consider the minimum hardware and software requirements. These are the minimum requirements.

Operating system:

  • Linux and BSD (All Linux, BSD and also MAC are supported)
  • CPU = Pentium 500MHz or greater
  • RAM = 128 MB or greater
  • HD = 10 GB
  • VIDEO = SVGA
  • NIC = Ethernet 10Base-T or greater
  • CDROM

Getting Started

If you install Asterisk please be advised that all existing data on the computer’s hard drive will be erased. First install the CentOS 4 or CentOS 5 Linux in your server and configure the internet connection, no need for other programs or bunch of software updates to be installed, you need to update only the following packages.

  • gcc
  • kernel
  • kernel-devel
  • bison
  • openssl-devel
  • libtermcap-devel and ncurses-devel for CentOS 5
Kernel-smp-devel (instead of kernel-devel) is necessary if you are using a dual core processor.

Run this command in the console:
For CentOS 4:

yum install gcc kernel kernel-devel bison openssl-devel

For CentOS 5:

yum install gcc kernel kernel-devel bison openssl-devel libtermcap-devel ncurses-devel

After installating the updates, you need to reboot to boot to your new kernel, just type the command below.

reboot

Then download the asterisk-1.2.26.2.tar.gz and zaptel-1.2.23.tar.gz packages from http://downloads.digium.com/ and untar all the files directly to /usr/src directory.

wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.2.26.2.tar.gz
wget http://downloads.digium.com/pub/zaptel/releases/zaptel-1.2.23.tar.gz
tar -zxvf zaptel-1.2.23.tar.gz -C /usr/src/
tar -zxvf asterisk-1.2.26.2.tar.gz -C /usr/src/

Installing Zaptel

cd /usr/src/zaptel-1.2.23
make clean
make
make install

Installing Asterisk 1.2

cd /usr/src/asterisk-1.2.26.2

If you want to use Music On Hold for your PBX, run this command:

make mpg123

Then continue installing using the following commands.

make clean
make
make install
make samples

Running Asterisk server for the first time

To start asterisk run the command:

asterisk –g

To run the asterisk console command:

asterisk -ncrvvvvvvv

Installing Open Source G729 codec

You can download the open source g729 codec based on the type of your processor here: http://asterisk.hosting.lv/.

cd /usr/lib/asterisk/modules/
wget http://asterisk.hosting.lv/bin12/codec_g729-ast12-gcc4-glibc-pentium4.so
chmod 755 codec_g729-ast12-gcc4-glibc-pentium4.so

Loading ztdummy driver

Configure ztdummy and asterisk to start automatically
To load the ztdummy driver run this following commands:

modprobe zaptel
modprobe ztdummy

Run vi /etc/rc.local and add the following lines to automatically start ztdummy driver and asterisk.

modprobe zaptel                                                                                                                                           
modprobe ztdummy        
asterisk –g

Then hit Esc key and type

:wqa

Done...

Reboot your system and that’s it!!! You have now a working asterisk PBX system…
Thanks to Mark Quitoriano for a very good howto and tutorial.
Source: http://www.voip-info.org/wiki/view/Asterisk+installation+for+CentOS+4.x