The first step that you should make is to you to choose which version of Asterisk you want to install.
* Asterisk 1.2 - the stable version * Asterisk 1.4 - the version that is currently in beta testing
When you know which version you want to install download the according packages.
Note that we will install also libpri and zaptel packages. They are optional for Asterisk but if you want to use Asterisk with MeetMe (see MeetMe application and meetme.conf) or to use MusicOnHold you'll have to install zaptel. The TDMoE cards will also need the zaptel module in order to work correctly. If you will use PRI cards you'll have to install libpri module.
Now check the exact version of your kernel. You can achieve this by typing `uname -a`. The output should be something like this: `Linux luser 2.6.17-1.2142_EL #1 Tue Jul 11 22:41:14 EDT 2006 i686 i686 i386 GNU/Linux`. Check if you are using 2.6 or 2.4 kernel. Notice that. We'll need this info later. You should check if you have installed the kernel sources (for the current version of the kernel) on your machine. To achieve this type `rpm -q kernel-devel` The output of the screen should be something like this:
Note that if you don't have kernel sources you should install them. You can use yum again: `yum install kernel-devel`. If you use this command yum will install the sources for your current version of the kernel.
It is time to check for the availability of some other packages:
If yum is unable to find one or more of these packages, try your luck with PBone. You should find the required packages there. When you download them, install them with either of those:
rpm -i PACKAGE.rpm
rpm -Uvh PACKAGE.rpm
CentOS doesn't install the kernel sources into the /usr/src/linux directory as is written in Zaptel's and Asterisk's Makefile. Go to `/usr/src` and create a link named 'linux' to your kernel sources directory (the default place for your kernel's sources is /usr/src/kernels/...). The result should look like this:
Now extract the downloaded sources by the command `tar -vxzf PACKAGE.tar.gz`, where PACKAGE.tar.gz are the packages that we downloaded (libpri, zaptel and asterisk itself).
Installing Libpri:
cd /path/to/source/libpri
make
make install
Installing Zaptel:
cd /usr/src/asterisk/zaptel
# if you have a 2.4 kernel you should type just make
make
# if you have a 2.6 kernel you should type make linux26
make linux26 - if you have a 2.6 kernel
make install
Installing Asterisk:
cd /usr/src/asterisk/asterisk
# before making Asterisk you have to install mpg123 package (to be able to play mp3 files for music on hold).
make mpg123
# for Asterisk v1.4 you should start configure script
./configure
make
make install
make samples
In order to verify the asterisk installation start your asterisk daemon by typing `safe_asterisk` and connect to its console by typing `asterisk -vvvvvr`. Now reload the entire configuration by typing `reload`.
User Comments
Jay (binserar at gmail dot com) 22 June 2008 03:24:08 I have the same issue Tracy. Anyone?
andri (andri_yanuardi_bl at yahoo dot co dot id) 03 June 2008 11:19:17 i have error in this line :
coz chan_phone.c is not exist.. please help me (T_T)
Kiran Kumar S (kiku dot suri at gmail dot com) 27 May 2008 06:40:33 [CC] utils.c -> utils.o
[root@localhost asterisk-1.4.19.2]# make
utils.c: In function ‘ast_utils_init’:
utils.c:1357: error: ‘utils_cli’ undeclared (first use in this function)
utils.c:1357: error: (Each undeclared identifier is reported only once
utils.c:1357: error: for each function it appears in.)
make[1]: *** [utils.o] Error 1
make: *** [main] Error 2
virendra sharma (virendra83 at gmail dot com) 25 April 2008 10:59:12 hi i just joined a company who deal with asterisk
Tulume (sandugo333 at yahoo dot com) 05 October 2007 09:29:21 Please Help me find the solution.
Here's the error on Installation
[root@ASTERISK ~]# cd /usr/src/libpri
[root@ASTERISK libpri]# make
make: Nothing to be done for `all'.
[root@ASTERISK libpri]# make install
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
[root@ASTERISK libpri]#
leo and andres (leo_ at leo dot com) 16 May 2007 00:48:20 In Centos 5 Kernel the private data member of struct inode hasn't changed.
Then in line 164 approximately of xpp/xbus-core.c file, we must change
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
by
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
That's all.
Leo (leo_ at leo dot com) 16 May 2007 00:43:51 In Centos 5 Kernel the private data member of struct inode hasn't changed.
Then in line 164 approximately of xpp/xbus-core.c file, we must change
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
by
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
That's all.
Alfredo (astivalet at gmail dot com) 05 May 2007 21:19:56 i have problems installing Zaptel i made all the steps.
[root@asterisk zaptel-1.2.17.1]# uname -a
Linux asterisk.localhost.com 2.6.18-8.1.3.el5 #1 SMP Mon Apr 30 19:55:44 EDT 2007 i686 i686 i386 GNU/Linux
root@asterisk src]# ll
total 13504
drwxr-xr-x 25 root root 4096 abr 24 17:49 asterisk-1.2.18
-rw-r--r-- 1 root root 10621790 abr 24 19:06 asterisk-1.2-current.tar.gz
drwxr-xr-x 3 root root 4096 may 5 13:22 kernels
drwxr-xr-x 2 1000 1000 4096 oct 17 2006 libpri-1.2.4
-rw-r--r-- 1 root root 76663 oct 18 2006 libpri-1.2-current.tar.gz
lrwxrwxrwx 1 root root 31 may 5 14:05 linux -> /kernels/2.6.18-8.1.3.el5-i686/
drwxr-xr-x 9 root root 4096 may 5 14:08 zaptel-1.2.17.1
-rw-r--r-- 1 root root 3047448 abr 25 11:10 zaptel-1.2-current.tar.gz
when i tried to compiling zaptel i have the next error:
[root@asterisk zaptel-1.2.17.1]# make linux26
make: *** No hay ninguna regla para construir el objetivo `linux26'. Alto.
Whit make apears:
[root@asterisk zaptel-1.2.17.1]# make
Compile xpp (version trunk-r3495)
CC [M] /usr/src/zaptel-1.2.17.1/xpp/card_fxo.o
CC [M] /usr/src/zaptel-1.2.17.1/xpp/card_fxs.o
CC [M] /usr/src/zaptel-1.2.17.1/xpp/xbus-core.o
/usr/src/zaptel-1.2.17.1/xpp/xbus-core.c: En la función ‘debugfs_open’:
/usr/src/zaptel-1.2.17.1/xpp/xbus-core.c:171: error: ‘struct inode’ no tiene un miembro llamado ‘u’
make[3]: *** [/usr/src/zaptel-1.2.17.1/xpp/xbus-core.o] Error 1
make[2]: *** [/usr/src/zaptel-1.2.17.1/xpp] Error 2
make[1]: *** [_module_/usr/src/zaptel-1.2.17.1] Error 2
make[1]: se sale del directorio `/usr/src/kernels/2.6.18-8.1.3.el5-i686'
make: *** [all] Error 2
Byambabayar (bbr62003 at yahoo dot com) 07 April 2007 06:33:46 [root@localhost asterisk-1.4.2]# make
make: Warning: File `Makefile' has modification time 2.9e+08 s in the future
****
**** The configure script must be executed before running 'make'.
****
make: *** [makeopts] Error 1
eijal (systemworksmsn at hotmail dot com) 21 March 2007 01:08:40 I THINK IN THE REQUIREMENTS, IT'S SOMETHING MISSING. BECAUSE I INSTALLED CENTOS 4.4 WITH MINIMAL INSTALLATION, AND THEN I INSTALLED WITH YUM ALL THE REQUERIMENTS THAT YOU SAY.
EVERY GOES WELL, BUT WHEN I TRY TO USE THE X100P CARD THERE ARE ISSUES, THIS IS THE ERROR:
# modprobe zaptel
FATAL: Module zaptel not found.
AND I CAN'T SOLVE IT. BUT WHEN I INSTALL ALL DEVELOPMENT TOOLS FOR CENTOS THERE IS NOT ANY PROBLEMS WITH THE modprobe zaptel
Izzy (idatoo at yahoo dot com) 21 February 2007 18:29:15 The author doesn't mention how to get menuselect working and how to use it.
This is where I am stuck, as I try to run menuselect and receive the following msg:
Unable to open 'menuselect-tree' for reading!
Error parsing 'menuselect-tree'!
John (jwhelan at proxito dot com) 16 February 2007 16:51:34 It looks as though with zaptel 1.2.13 you can no longer build with target linux26.
I tried and got
[john@bender zaptel-1.2.13]# make linux26
make: *** No rule to make target `linux26'. Stop.
A Make && Make install ran just fine, and I could load ztdummy with modprobe afterwards.
The readme.linux26 file is still present, and still instructs to do "make linux26", though.
Blanc (toussainty at hotmail dot com) 26 January 2007 20:47:08 c'est bpon ce uqe vous faiytes
Mats (mats dot o dot karlsson at gmail dot com) 07 January 2007 11:43:44 I like to add both zaptel and asterisk to the standard init procedure in CentOS/RHEL.
To do this add:
make config
then you can start, stop and restart with the service command, ex.:
service asterisk start
and also do a :
chkconfig --add asterisk
chkconfig --level 345 asterisk on
and the same for zaptel.
This will start zaptel and asterisk in the boot procedure.
Arcopix (arcopix at gmail dot com) 04 January 2007 16:38:48 I've updated the links for Asterisk 1.4.0
Pierre (pierre at forestcitynetwerxs dot com) 01 January 2007 08:30:58 Ditto for Zaptel link above:<br />
http://ftp.digium.com/pub/zaptel/<br />
<br />
and Libpri:<br />
http://ftp.digium.com/pub/libpri/
Pierre Marceau (pierre at forestcitynetwerxs dot com) 01 January 2007 08:19:49 The link (above) to Asterisk 1.4 Beta 3 works but there are now newer versions available. Check it out:
http://ftp.digium.com/pub/asterisk/releases/
Chris (chris at empirecom dot on dot ca) 07 December 2006 16:16:53 Hi,
I have always been under the impression that as of Asterisk 1.2.X, when the asterisk-addons package is installed there is no need for mpg123 anymore. This was just for asterisk 1.0. I have not been installing it for quite some time and have been using mp3 files for MOH.
Thanks,
Chris
eslam (eshesh_1211 at hotmai dot com) 06 December 2006 20:57:22 hi
Lacho (support at asteriskguru dot com) 05 December 2006 18:43:23 Hi Tracy,
In version 1.4 the compilation process is a little bit different. There are no make mpg123 option. You could use the native format_mp3 which is coming with the asterisk-addons package.
Regards
Lacho
Tracy (tracyphillips at yahoo dot com) 05 December 2006 17:38:52 I am trying to get asterisk 1.4 working and in the tutorial, it says to 'make mpg124' for Music On Hold.
I cd to the asterisk directory and this is what I get:
[root@localhost asterisk-1.4.0-beta3]# make mpg123
make: *** No rule to make target `mpg123'. Stop.