Installing Asterisk 1.4 and Asterisk-GUI on CentOS 5
June 7, 2007
This is my first attempt in installing Asterisk 1.4 and I was amazed that I did not encounter any difficulty
.
1. Download the latest version source files using svn.
# cd /usr/src
# svn co http://svn.digium.com/svn/asterisk/trunk asterisk
# svn co http://svn.digium.com/svn/zaptel/branches/1.4 zaptel
# svn co http://svn.digium.com/svn/libpri/trunk libpri
2. Make sure the following packages are installed before proceeding:
# rpm -q bison
# rpm -q bison-devel
# rpm -q ncurses
# rpm -q ncurses-devel
# rpm -q zlib
# rpm -q zlib-devel
# rpm -q openssl
# rpm -q openssl-devel
# rpm -q gnutls-devel
# rpm -q gcc
# rpm -q gcc-c++
If any of the package is not installed, use yum to install it, e.g.,
# yum install bison-devel
3. Make sure you establish a link while in the /usr/src directory:
[root@localhost src] # ln -s kernels/kernel_version linux
4. Install the Asterisk files in the following order -> libpri, zaptel, asterisk.
Installing Libpri
# cd /usr/src/libpri
# make
# make install
Installing Zaptel
# cd /usr/src/zaptel
# ./install_prereq test
# ./install_prereq install
# make
# make install
# make config
Installing Asterisk
# cd /usr/src/asterisk
# ./configure <--- for asterisk 1.4 start the configure script
# make
# make install
# make samples
5. Verify your Asterisk installation by doing the following:
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`.
Install Asterisk GUI:
# cd /usr/src # svn checkout http://svn.digium.com/svn/asterisk-gui/trunk asterisk-gui # cd ../asterisk-gui
# ./configure # make # make install
Note: Backup the asterisk directory
# cp -r /etc/asterisk /etc/asterisk.backup
Check your Asterisk-GUI configuration by running the ‘make checkconfig’ while in /usr/src/asterisk-gui directory to verify if there are errors and make the necessary modifications.
Files that need to be modified to avoid errors:
/etc/asterisk/manager.conf enabled = yes webenabled = yes
[administrator] secret = mysecret
read = system,call,log,verbose,command,agent,user,config write = system,call,log,verbose,command,agent,user,config
/etc/asterisk/http.conf enabled=yes enablestatic=yes bindaddr=0.0.0.0
Note: bindaddr 0.0.0.0 means you can access it from anywhere, if you want access only on the local machine, put 127.0.0.1 instead.
To start Asterisk at boot time, do the following:
# cd /usr/src/asterisk
# make config
Then issue the following command to be able to start and stop asterisk via service command:
# chkconfig --add asterisk
That’s all there is to it. Cheers!
August 13, 2007 at 10:51 am
[root@asterisk zaptel-1.4.4]# pwd
/usr/src/zaptel-1.4.4
[root@asterisk zaptel-1.4.4]# make linux26
make: *** No rule to make target `linux26′. Stop.
[root@asterisk zaptel-1.4.4]#
Something is wrong in those instructions!
August 14, 2007 at 1:08 am
There’s nothing wrong with the instructions, I’ve done this a couple of times already. What particular part are experiencing a problem?
[root@asterisk zaptel-1.4.4]# pwd
/usr/src/zaptel-1.4.4
[root@asterisk zaptel-1.4.4]# make linux26
make: *** No rule to make target `linux26′. Stop.
[root@asterisk zaptel-1.4.4]#
Obviously you got it wrong, there’s no zaptel-1.4.4 directory in my tutorial. If you used the svn snapshots like I’ve mentioned everything should be alright, check your svn command syntax.
August 14, 2007 at 9:30 am
Yes, you are right. I didn’t used svn, I used release 1.4.4.
Sorry for that I though it’s all the same.
For Zaptel 1.4.4. this is procedure
make (there will be an error, so run make again)
make
make install
make config (to start Zaptel at boot time)
Bye.
August 25, 2007 at 5:48 pm
Hi I tried to install Asterisk as described in your blog.
I went to the Installing Libpri and later to the Installing Zaptel step.
I got this messages:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Installed: gcc-c++.i386 0:4.1.1-52.el5.2
Dependency Installed: libstdc++-devel.i386 0:4.1.1-52.el5.2
Complete!
-bash-3.1# cd /usr/src
-bash-3.1# ln -s kernels/kernel_version linux
-bash-3.1# cd /usr/src/libpri
-bash-3.1# make
CC=”gcc” ./mkdep -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g `ls *.c`
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
-bash-3.1#
-bash-3.1# 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 /sbin/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
-bash-3.1#
-bash-3.1# cd /usr/src/zaptel
-bash-3.1# dir
LICENSE fxotune.c patgen.c wctdm24xxp
Makefile fxotune.h patlooptest.c wcte11xp.c
README fxstest.c pattest.c wcusb.c
README.Astribank gendigits.c pciradio.c wcusb.h
README.b410p hdlcgen.c pciradio.rbt xpp
README.fxotune hdlcstress.c proslic.h zaptel.c
README.fxsusb hdlctest.c sec-2.h zaptel.conf.sample
acinclude.m4 hdlcverify.c sec.h zaptel.h
aclocal.m4 ifcfg-hdlc0 sethdlc-new.c zaptel.init
arith.h ifup-hdlc sethdlc.c zaptel.sysconfig
biquad.h install-sh timertest.c zaptel.xml
bittest.h jpah.h tonezone.c zconfig.h
bootstrap.sh kb1ec.h tonezone.h zonedata.c
build_tools kb1ec_const.h tor2-hw.h ztcfg-dude.c
checkstack makefw.c tor2.c ztcfg.c
complex.cc makeopts.in tor2.ee ztcfg.h
complex.h mec.h tor2ee.c ztcodec_dte
config.guess mec2.h torisa.c ztd-eth.c
config.sub mec2_const.h torisatool.c ztd-loc.c
configure mec3-float.h tormenta2.rbt ztdiag.c
configure.ac mec3.h tormenta2.ucf ztdummy.c
datamods menuselect tormenta2.vhd ztdummy.h
digits.h mg2ec.h usbfxstest.c ztdynamic.c
doc mg2ec_const.h wcfxo.c ztmonitor.c
ecdis.h mkfilter.h wct1xxp.c ztspeed.c
fasthdlc.h mknotch.cc wct4xxp zttest.c
fir.h oct612x wctdm.c zttool.c
firmware orig.ee wctdm.h zttranscode.c
-bash-3.1# clear
-bash-3.1# make linux26
grep: /include/linux/autoconf.h: No such file or directory
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking how to run the C preprocessor… gcc -E
checking for a BSD-compatible install… /usr/bin/install -c
checking whether ln -s works… yes
checking for GNU make… make
checking for grep… /bin/grep
checking for sh… /bin/sh
checking for ln… /bin/ln
checking for chkconfig… /sbin/chkconfig
checking for wget… /usr/bin/wget
checking for grep that handles long lines and -e… (cached) /bin/grep
checking for egrep… /bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for initscr in -lcurses… yes
checking curses.h usability… yes
checking curses.h presence… yes
checking for curses.h… yes
checking for initscr in -lncurses… yes
checking for curses.h… (cached) yes
checking for newtBell in -lnewt… no
checking for usb_init in -lusb… no
configure: creating ./config.status
config.status: creating build_tools/menuselect-deps
config.status: creating makeopts
configure: *** Zaptel build successfully configured ***
****
**** The configure script was just executed, so ‘make’ needs to be
**** restarted.
****
make: *** [config.status] Error 1
-bash-3.1# make linux26
grep: /include/linux/autoconf.h: No such file or directory
gcc -o gendigits gendigits.c -lm
./gendigits > tones.h
gcc -o makefw makefw.c
./makefw tormenta2.rbt tor2fw > tor2fw.h
Loaded 69900 bytes from file
./makefw pciradio.rbt radfw > radfw.h
Loaded 42096 bytes from file
You do not appear to have the sources for the 2.6.16.28-xen-r2 kernel installed.
make: *** [linux26] Error 1
-bash-3.1#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am not sure what this error message is about.
I tried to install it on a XEN-Server like this: http://www.xencon.net/512
Please can you help and advise if necessary, thanks a lot
Jochen.
August 27, 2007 at 10:34 am
As you can see from the error message you received ->
“You do not appear to have the sources for the 2.6.16.28-xen-r2 kernel installed.” Install the kernel header version which is 2.6.16.28-xen-r2, I don’t know where you can download the kernel header version you’re using but if you can find where to download that just follow the same procedure I’ve described and you’ll be alright. You can try downloading and installing it using the yum utility, it might work. In my tutorial I used the kernel header that comes with the default install of CentOS 5.
September 6, 2007 at 7:48 pm
I got the same problem as Parcina… but I must download zaptel from the FTP not from the svn because it’s a school work and school block svn port or something but I can’t dl it by svn .. so i got Zaptel-1.2.20.1 and when I type: make Linux26 an error saying “they can’t find such file” & “make:No rule to make target ‘Linux26′.stop.
September 7, 2007 at 1:29 am
svn client ports are not blocked, because it’s not an incoming service, maybe the svn package is not installed, verify it first. Also check the contents of zaptel-1.2.20.1, maybe it’s an empty file, also follow the procedure which Parcina did, he stated how he was able to make it work.