Friday, August 24, 2007

Another Asterisk 1.4.11 installation

I haven't tested this installation at the time of the post (want to leave the office!!) but as always I keep my notes here to go back my steps later if needed.

The installation is simple as always.



a) Check version of GNU Make is greater than 3.79, just run

rbtest:/home/ricardo/asterisk_intall# make -v
GNU Make 3.81


b) Install some dependencies (errors show during the installation of pwlib)
$ apt-get install libldap2-dev
configure: error: pwlib needs the GNU Project fast lexical analyzer generator flex
$ apt-get install flex
configure: error: pwlib needs the GNU Project parser generator bison
$ apt-get install bison


19 apt-get install kernel-packages ncurses-dev fakeroot bzip2
20 apt-get install kernel-package ncurses-dev fakeroot bzip2
21 apt-get install yaird fakeroot
22 apt-get install make-kpkg kernel_image
23 apt-get install kernel_image
24 apt-get install sudo
25 apt-get install iniramfs-tools
26 apt-get install initramfs-tools
27 apt-get install bzip2
28 apt-get install libncurses-dev
30 ap-get install wget
35 apt-get install linux-headers-`uname -r` build-essential libnewt-dev libusb-dev




c) Download packages asterisk:

rbtest:/home/ricardo/asterisk_intall# ls -ltr
total 16772
-rw-r--r-- 1 ricardo ricardo 11218944 2007-08-24 16:25 asterisk-1.4.11.tar.gz
-rw-r--r-- 1 ricardo ricardo 1563752 2007-08-24 16:25 zaptel-1.4.5.1.tar.gz
-rw-r--r-- 1 ricardo ricardo 81178 2007-08-24 16:25 libpri-1.4.1.tar.gz
-rw-r--r-- 1 ricardo ricardo 1000286 2007-08-24 16:26 asterisk-addons-1.4.2.tar.gz
-rw-r--r-- 1 ricardo ricardo 3249876 2007-08-24 16:26 asterisk-sounds-1.2.1.tar.gz
drwxr-xr-x 2 root root 4096 2007-08-24 18:03 libpri-1.4.1
drwxr-xr-x 24 root root 4096 2007-08-24 19:11 asterisk-1.4.11
drwxr-sr-x 14 root root 12288 2007-08-24 19:21 zaptel-1.4.5.1
rbtest:/home/ricardo/asterisk_intall#


d) Download packages openh323

wget http://downloads.sourceforge.net/openh323/pwlib-v1_10_3-src-tar.gz
wget http://downloads.sourceforge.net/openh323/openh323-v1_18_0-src-tar.gz

rbtest:/home/ricardo/openh323_install# ls -ltr
total 5704
-rw-r--r-- 1 root root 3742730 2006-03-26 12:28 openh323-v1_18_0-src-tar.gz
-rw-r--r-- 1 root root 2079871 2007-01-25 00:01 pwlib-v1_10_3-src-tar.gz
drwxr-xr-x 9 1010 3000 4096 2007-08-24 18:28 pwlib_v1_10_3
drwxr-xr-x 7 1010 3000 4096 2007-08-24 18:40 openh323_v1_18_0
rbtest:/home/ricardo/openh323_install#



e) Install Openh323

tar zxvf pwlib-v1_10_3-src-tar.gz
cd pwlib_v1_10_3/
./configure
make


export PWLIBDIR=/home/ricardo/openh323_install/pwlib_v1_10_3
cp $PWLIBDIR/lib/libpt_linux_x86_r.so.1.10.3 /usr/lib
cd ..



It is very important that you set the PWLIBDIR to your path, othewise OpenH323 will not find it.


tar zxvf openh323-v1_18_0-src-tar.gz
cd openh323_v1_18_0/
./configure
make opt


export OPENH323DIR=/home/ricardo/openh323_install/openh323_v1_18_0
cp $OPENH323DIR/lib/libh323_linux_x86_r.so.1.18.0 /usr/lib


Aain we must set the OPENH323DIR variable, so Asterisk can know here to look for OpenH323. We copy the library manually to the system directory, as we do not care about the rest of OpenH323 features.


f) Install zaptel, libpri, asterisk

tar zxvf zaptel-1.4.4.tar.gz
cd zaptel-1.4.4
./configure
make menuselect


At this point use the menuselect utility to select which Zaptel hardware - if any - you have on board. Please remeber that if you want to exit keeping the changes you made, you must press x, while q will quit without saving and the left arrow will get you back to the previous menu. Even if you do not have Zaptel hardware, you should compile the ztdummy driver.

make
make install

Now we install libpri

tar zxvf libpri-1.4.1.tar.gz
make
make install
cd ..

Now we build Asterisk itself:

tar zxvf asterisk-1.4.8.tar.gz
./configure
make menuselect


At this point, you should go to the Channels menu and see that H323 is enabled. If it's not, vey likely you did not set OPENH323DIR or PWLIBDIR, so configure cannot enable H.323 by default.

make


You will get the following error, so run the make again:
When compiling with H.323 support, the first time you run make it will end with an error telling you to run make again. This is okay, just do it as it says.

***************************************************************

********** Re-run 'make' to pick up H.323 parameters **********

***************************************************************
make[1]: *** [h323/libchanh323.a] Error 1


make

make install
make samples
cd ..


This should be it. I checked that my /etc/zaptel.conf was missing. Not sure if this is because I didn't have any hardware installed. Just in case I copied
150 cp /home/ricardo/asterisk_intall/zaptel-1.4.5.1/zaptel.conf.sample /etc/zaptel.conf

Run the moprobe on zapte/ztdummy

151 modprobe zaptel
152 lsmod
153 modprobe ztdummy
154 lsmod

Change the default zone on zaptel.conf to UK

156 vi /etc/zaptel.conf


Run the configuration and obviously 0 boards configured message appear:
157 ztcfg -v

Started Asterisk
158 asterisk -vvvvvvvvvvvvvvvvvvvvvvvvvvc


Will test this solution. Will do the installation of add-ons and sounds later as add-ons brings an h323 solution by itself.

Enabling H.323
In order to enable H.323, you simply edit /etc/asterisk/h323.conf as follows:

gatekeeper = DISCOVER
context=h323


This will tell it to find the gatekeeper automatically and to route incoming calls to context h323.
To place an outbound call fron Asterisk, you just dial:

exten => 21,1,Dial(h323/21)

This will find the terminal 21 through the Gatekeeper and will call it as needed.


Main article retrieved from:
http://astrecipes.net/index.php?n=286

1 comment:

dan rogy said...

My project required to integrate dialer
with voice playing ability, fax detection and digit recognition

I bought
http://voipcore.com
and that guys provide great support