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

Thursday, August 23, 2007

Install Sun Java on Ubuntu 7.04

The installation of Java is quite easy. The default installation has the GNU version of Java, to run Sun engine first install the following packages:

sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

Then check the version of Java running, the GNU version should still be the default one:

ricardo@lmnwok1:~$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 (Ubuntu 4.1.2-0ubuntu5)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ricardo@lmnwok1:~$

To select the new Sun engine run the update-alternatives as below and select the option you want to use:

ricardo@lmnwok1:~$ sudo update-alternatives --config java

There are 3 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
2 /usr/lib/jvm/java-6-sun/jre/bin/java
*+ 3 /usr/lib/jvm/java-gcj/jre/bin/java

Press enter to keep the default[*], or type selection number: 2
Using `/usr/lib/jvm/java-6-sun/jre/bin/java' to provide `java'.
ricardo@lmnwok1:~$


Now when checking the version you will see the new one:

ricardo@lmnwok1:~$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
ricardo@lmnwok1:~$



After this as in my other post change the JRE used by Eclipse.

Tuesday, August 21, 2007

Ubuntu 7.04 on Dell Latitude D620

I got that urge again of installing linux on my laptop. I've been using Fedora in the past but after the latest crash (that needed to get a new hard disk but I had to admit that I don't know if Fedora crash the disk or the disk crash Fedora) and as I normally install Debian on the servers (and due all the people I know and magazines and post I have read about Ubuntu) I decided to install Ubuntu on my laptop.

I went to the Ubuntu site and downloaded the image for the CD, run it on my laptop and first I was surprised about the installation process. Normally I install windows, leave enough space for Linux and then install Linux on the free space.

Ubuntu is different from the start. The cd is a LiveCD, once it is loaded on the desktop there is a shortcut to install Ubuntu. You click on it and you go on with the wizard. The only part that you have to keep an eye is on the disk partitioning. The automatic wizard resize existing file disk option didn't work (some kind of error) a friend at the office mentioned that he had the same problem and selected the option to do it manually. I choose it and altered my windows partition and it did an automatic resize of it (don't know if it worked as I haven't use my windows partition yet), once you have enough space you create you swap and you other mounting points. As this is my first attempt I created only "swap" and "/".

Next the installation is quite simple, once finished I run this two install packages:

# sudo apt-get install 915resolution (reboot)

On which you need to edit the /etc/default/915resolution file.
MODE=Auto
XRESO=1440
YRESO=900
BIT=

And...
# sudo apt-get install network-manager-pptp


I am still playing with this last one.

I will add more notes later as soon as I get my feet wet on Ubuntu (first thing I noticed is that I have to sudo everything.. I miss root)