BreadCrumbs: Asterisk Install

Asterisk Install

From Luke Jackson

Revision as of 00:51, 2 May 2007; Ljackson (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Jump to: navigation, search

Contents

Fedora Core

Summary

A friend called and asked me for some help installing Asterisk 1.4 on his system so lets begin.

Download the tars from digium

Make yourself a nice little place to place in /usr/src/

mkdir /usr/src/asterisk
cd /usr/src/asterisk
wget http://ftp1.digium.com/pub/asterisk/asterisk-1.4.4.tar.gz
wget http://ftp1.digium.com/pub/asterisk/asterisk-addons-1.4.1.tar.gz
wget http://ftp1.digium.com/pub/zaptel/zaptel-1.4.2.1.tar.gz
wget http://ftp1.digium.com/pub/libpri/libpri-1.4.0.tar.gz

Extract the tars

tar zxvf asterisk-1.4.4.tar.gz
tar zxvf asterisk-addons-1.4.1.tar.gz
tar zxvf libpri-1.4.0.tar.gz
tar zxvf zaptel-1.4.2.1.tar.gz

Check the Kernel for compatibility

This is probably the most complex part so pay attention.

You will need the kernel sources to compile zaptel sounds easy right? Wrong with dual core CPUs being so common these days you need to make sure you have either one core or 1< cores.

For those of you with only one core issue this command:

yum install kernel-devel

For those of you with more than one issue this command:

yum install kernel-smp-devel

Compile zaptel

Some people have issues with linking to there kernel sources. If you get errors like this:

You do not appear to have the sources for the kernel installed.

You need to symlink to the kernel source as stated in the Readme.Linux26

ln -s /lib/modules/`uname -r`/build/ `uname -r`

Now you are ready to configure and compile zaptel. Change to the zaptel directory and lets get dirty!

cd /usr/src/asterisk/zaptel*

Lets check out what it is actually installing and then save the make config by pressing 'x'

make menuconfig

Now you are ready to make if everything goes right you shouldn't see any errors.

make

Now install...

make install

If everything went well you should end up with something like this and your prompt returning below.

Building /etc/modprobe.d/zaptel...
***
*** WARNING:
*** If you had custom settings in /etc/modprobe.d/zaptel,
*** they have been moved to /etc/modprobe.d/zaptel.bak.
***
*** In the future, do not edit /etc/modprobe.d/zaptel, but
*** instead put your changes in another file
*** in the same directory so that they will not
*** be overwritten by future Zaptel updates.
***
[root@localhost zaptel-1.4.2.1]# 

Last we have to generate the configuration files.

make config

Compile libpri

If you will be using a Digium or Sangoma telephony card that supports T1/E1 signaling do this step as well.

cd /usr/src/asterisk/libpri*
make install

Here is some output for fun:

gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g     -c -o copy_string.o copy_string.c
gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g     -c -o pri.o pri.c
gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g     -c -o q921.o q921.c
gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g     -c -o prisched.o prisched.c
gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g     -c -o q931.o q931.c
gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g     -c -o pri_facility.o pri_facility.c
ar rcs libpri.a copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o
ranlib libpri.a
gcc -fPIC -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g   -o copy_string.lo -c copy_string.c
gcc -fPIC -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g   -o pri.lo -c pri.c
gcc -fPIC -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g   -o q921.lo -c q921.c
gcc -fPIC -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g   -o prisched.lo -c prisched.c
gcc -fPIC -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g   -o q931.lo -c q931.c
gcc -fPIC -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g   -o pri_facility.lo -c pri_facility.c
gcc -shared -Wl,-hlibpri.so.1.0 -o libpri.so.1.0 copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
/sbin/ldconfig -n .
ln -sf libpri.so.1.0 libpri.so
ln -sf libpri.so.1.0 libpri.so.1
mkdir -p /usr/lib
mkdir -p /usr/include
install -m 644 libpri.h /usr/include
install -m 755 libpri.so.1.0 /usr/lib
if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then  restorecon -v /usr/lib/libpri.so.1.0; fi
( cd /usr/lib ; ln -sf libpri.so.1.0 libpri.so ; ln -sf libpri.so.1.0 libpri.so.1 )
install -m 644 libpri.a /usr/lib
if test $(id -u) = 0; then /sbin/ldconfig -n /usr/lib; fi

Compile Asterisk

Finally you are in the home stretch! Now all thats left is compiling asterisk and its addons.

Personal tools