Friday, June 5, 2009

Asterisk PBX System Install - 12 Install H323

Issue:
I need to connect Asterisk to my Cisco CallManager 3.51 server to allow for phone migration from one system to the other. Since CCM 3.51 does not support SIP I need to get H323 working on Asterisk.

Quick/Visual/Learning:
I found a good link to get me started: Asterisk Cisco CallManager Integration

Talks about integration using either H323 or SIP. CCM 3.51 only supports h323 so I need to get h323 working on Asterisk.

For H323 I found another link: Compiling Asterisk 1.4 with TDM400 and H323 .
Following along using this guide-

The gcc-g++ was already downloaded in Asterisk PBX System Install - 03 Software, as was the kernel-devel module, but not gnutls-devel so I install that one:

#yum install –y gnutls-devel

It is not talked about here but I got an error later on that pwlib needed the fast lexical analyzer generator. After doing some poking around I discovered that I could load this using yum so I will do that now too:

#yum install –y flex

I am not interested in Google Talk so I skip the iksemel download and I already have the correct version of make that is above version 3.80, so on to the section: “Download and install OpenH323 libraries”

Need to download some source files. I will put these in the same place as my other files.
#cd /usr/src
#wget http://downloads.sourceforge.net/openh323/pwlib-v1_10_3-src-tar.gz
#tar zxvf pwlib-v1_10_3-src-tar.gz
#cd pwlib_v1_10_3/
#./configure
#make
#export PWLIBDIR=/usr/src/pwlib_v1_10_3

My path in the export command is different then those in the astrecipes link because I downloaded my files to a different directory then he did. The export command creates a shell variable that is also recognized by the kernel. In this case the variable contains the path to our pwlib directory. This is an important step as openh323 needs this path variable.

#cp $PWLIBDIR/lib/libpt_linux_x86_r.so.1.10.3 /usr/lib
Manual copy of the shared library to the system folder. Notice here that we are using the path variable that we created with the export command above.
The full path is:
/usr/src/pwlib_v1_10_3/lib/libpt_linux_x86_r.so.1.10.3 /usr/lib
By using the $PWLIBDIR variable we save a few keystrokes.

Go back one directory to the src directory
#cd ..

Next we do pretty much the same thing to install openh323:

#wget http://downloads.sourceforge.net/openh323/openh323-v1_18_0-src-tar.gz
#tar zxvf openh323-v1_18_0-src-tar.gz
#cd openh323_v1_18_0/
#./configure

This next command took several minutes on my machine so be patient.
#make opt

#export OPENH323DIR=/usr/src/openh323_v1_18_0
#cp $OPENH323DIR/lib/libh323_linux_x86_r.so.1.18.0 /usr/lib
#cd ..

The next section is about installing Asterisk which I have already done, but I need to recompile Asterisk to see the h323 stuff.

#cd /usr/src/asterisk-1.4.23.1
#make clean
#./configure
#make menuselect
I see that asterisk now has the chan_h323 option selected. That was a happy little moment.
Press x to exit out of menuselect
You need to run make twice now. The first time you get an error that you need to run it again, so just do it.
#make
#make
#make install
I am not going to "make samples" because that would overwrite the work I have done in my .conf files.

Note - If you run "make samples" by mistake the existing .conf files get written to .conf.old files but just to be safe you should probably save all the work you have done in the .conf files somewhere else once in a while.

#cd ..

To start asterisk type:
#asterisk
Attach to the console with:
#asterisk -vvvvr

It should be running now with H323.

Next time more work to connect to CallManager.
Asterisk PBX Install - Index

No comments: