Connect Asterisk to Avaya using the H.323 protocol


On the one hand, we need asterisk itself.

You can use one of the ready-made distributions such as Trixbox, Elastix, AsteriskNow, but I could not get adequate work from the module working with h323, which is part of the first two distributions (at least when setting up trunks to avaya).

Who also did not succeed or just wondering, I ask for a cat.


We will use another driver, namely OpenH323 from NuFone, since it is not in any of the ready-made distributions, we will collect it from the source, we will collect asterisk for one.

But first, we need an OS, for all our “exercises”.
I chose the latest (at the time of these actions) stable version of CentOS, namely 5.8 (thanks to centos.org and the mirror from Yandex).

Download - Run - Install

Here, if desired, you can install using gui (then click further - further - yes - further - yes - configure the network - further - time zone - root password - you can select additional packages you need, but after installation we will use yum, so then on).

We are observing the installation process / going to drink tea / doing other things.

After installation and reboot, setup will run once, in which you need to configure / disable selinux and firewall.

If you missed the moment you started setup, you can start it yourself by writing in the setup terminal.
From there, we need only the firewall configuration item; it launches system-config-securitylevel-tui (you can run it instead of setup).

There, to speed up the process, disable firewall and selinux (setting both topics for individual articles).

Everything, you can connect to the server via SSH and install asterisk with the necessary additions.

Install the necessary packages, namely

make
gcc-c ++
kernel-devel
openssl-devel
expat-devel
gnutls-devel
flex
bison
ncurses-devel
libxml2-devel
sqlite-devel
yum install make gcc-c++ kernel-devel openssl-devel expat-devel gnutls-devel flex bison ncurses-devel libxml2-devel sqlite-devel -y

Download the necessary libraries to the / root

Open H.323 v1.18.0
PWLib v1.10.0 directory
cd /root
wget http://www.voxgratia.org/releases/openh323-v1_18_0-src-tar.gz
wget http://www.voxgratia.org/releases/pwlib-v1_10_0-src-tar.gz

Rename.
mv openh323-v1_18_0-src-tar.gz openh323-v1_18_0-src.tar.gz
mv pwlib-v1_10_0-src-tar.gz pwlib-v1_10_0-src.tar.gz

Unpack.
tar vfxz openh323-v1_18_0-src.tar.gz
tar vfxz pwlib-v1_10_0-src.tar.gz

And once again we rename.
mv pwlib_v1_10_0 pwlib
mv openh323_v1_18_0 openh323

Add the necessary compiler headers.
cp /usr/src/kernels/2.6.18-308.4.1.el5-i686/include/linux/compiler.h /usr/include/linux

We compile libraries.
cd /root/pwlib
./configure
make clean opt
cd /root/openh323
./configure
make clean opt

Copy the compiled libraries along with the links to the right place.
cp /root/openh323/lib/libh323_linux_x86_r* /lib
cp /root/pwlib/lib/libpt_linux_x86_r* /lib

Download the asterisk sources of the version we need, for example 10.4 (or, according to the old account, 1.10.4).
cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-10.4.0.tar.gz

Unpack.
tar vfxz asterisk-10.4.0.tar.gz

We go to the directory with the sources and indicate the necessary paths.
cd asterisk-10.4.0
export OPENH323DIR=/root/openh323/
export PWLIBDIR=/root/pwlib/
export OPENH323_LIBDIR=/lib
export PWLIB_LIBDIR=/lib

and run
./configure

If everything went well, then we will see the asterisk logo executed in pseudographics.
You can run.
make menuselect

There are channel drivers and at the very bottom we mark chan_h323, press s to save and exit further.
make
make install
make samples
make config
/sbin/chkconfig asterisk on

You can run asterisk.
/etc/init.d/asterisk start

TOTAL:

Running asterisk, with the h.323 channel driver from NuFone.

Create a trunk group on avaya:
add trunk-group next

page 1
Group Type: isdn
Carrier Medium: H.323
Service Type: public-ntwrk
Member Assignment Method: auto
Number of Members: 2 необходимое количество линий

change node-names ip
asterisk X.X.X.X

add signaling-group next

page 1
Group Type: h.323
Trunk Group for Channel Selection: "номер транковой группы"
Near-end Node Name: procr
Near-end Listen Port: 1720
Far-end Node Name: asterisk
Far-end Listen Port: 1720

This is where the avaya setup is done.

We pass to asterisk.
cd /etc/asterisk/

First of all, we need h323.conf:
[general]
port = 1720
bindaddr = X.X.X.X ; ip адресс астериска
disallow=all
allow=alaw
dtmfmode=inband
gatekeeper = DISABLE
context=h323-in ; контекст для входящих звонков по данному каналу
progress_setup = 8
progress_alert = 8
[avaya] ; контекст коннекта к avaya
type=friend
host=Y.Y.Y.Y ; ip адрес CM
port=1720
diallow=all
allow=alaw
h245tunneling=yes

Then you can / need to restart the threads on both sides.

asterisk:
asterisk -r
module reload chan_h323.so

avaya:
busyout trunk 15
busyout signaling-group 15
release signaling-group 15
release trunk 15

check
status trunk 15

0015/001 T00022 in-service/idle no

In order to use this trunk, you need to make changes to extensions.conf:
[general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
CONSOLE=Console/dsp
IAXINFO=guest
TRUNK=DAHDI/G2
TRUNKMSD=1
[default]
[h323-out] ; контекст исходящих на avaya
exten => _X.,1,Dial(H323/${EXTEN}@avaya) ; все исходящие в неизменном виде отправляем на avaya
[h323-in]
exten => _X.,1,Dial(SIP/${EXTEN}) ; все входящие по каналу h323 пытаемся передать на соответствующие sip номера в неизменном виде

Of course, in a real circuit such constructions should not be used; here they are given in order to show the concept.

I will give a configuration file sip.conf
[general]
bindport=5060
bindaddr=0.0.0.0
context=default
allowguests=no
[99999] ; тестовый sip юзер
type=friend
secret=99999
host=dynamic
context=h323-out ; использующий для исходящих звонков контекст h323-out из extensions.conf
cid_number=00000 ; с вот таким интересным АОН

You can make test calls
and control from asterisk by simply launching its console:
asterisk -r

And from the side of avaya
list trace tac #15

PS: when preparing the article, information was used from asterisk.ru and Google, of course.

Also popular now: