Monday 4 July 2011

Asterisk 1.8.4.4 connected to Avaya with ooh323







Hi everybody,

As I know that lot of people are interested by connecting Avaya to Asterisk and I have already made a tutorial in 2008 about it, I have decided to renew it with latest version of Asterisk which is currently version 1.8.4.4

First we'll configure Avaya and then Asterisk.

You should check on Avaya the options below:
display system-parameters customer-options


Check on page 2 that you have some licence in front of "Maximum Administred H.323 Trunks".

Now do this command:
display system-parameters special-applications


on page 4 you should have option "H245 Support with other Vendors" to Yes

If you don't have one of the options above you can't move forward.

For H245 support with other vendors you can ask to Avaya or business partner to turn it on, generally they can do it for free.

Now we'll start the configuration on Avaya, you just need to know IP address of your future Asterisk server.

Please do command below and add a node-name which will be the name of your asterisk server that you have chosen and it's IP address:
change node-names ip


now we'll add signalling link (chose a number which is free:
add signaling-group 60
















Don't fill yet the field "Trunk Group for Channel Selection"
Regarding the Far-end Node-name chose the one that you have configured when you have added a node-name. The near-end Node name is a CLAN of your choice (in my case I have dedicated one but it's not mandatory).

You can also configure the Far-end Network Region by a number of your choice that we'll dedicate to Asterisk.

Now do command below:
add trunk 60

and configure the option like screenshot below:

















































Now you can go back on your signaling link and add the number of your trunk into the field "Trunk Group for Channel selection" and put in my example the value 60.


Now we'll confiure the network region:
change ip-network-region 5




















now the codec used:
change ip-codec-set 5














Now we'll configure how Avaya will call Asterisk let say that the extension on Asterisk will be 60000.

Do change uniform-dialplan 0 and add entry below:
60 5 0 aar n

then do:
change aar analysis 60 and add entry below:
60 5 5 60 lev2

then change route 60 and enter command below:
60 0

then change dialplan analysis and enter command below:
6 5 ext


Now on your asterisk server you'll install a Debian 6 version:

and do command below:

cd /usr/src/
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
wget http://srtp.sourceforge.net/srtp-1.4.2.tgz

aptitude install libncurses5-dev linux-headers-$(uname -r) tar ssh libxml2-dev flex bison gcc g++ build-essential openssl libssl-dev libspeex-dev speex libspeexdsp-dev libldap-2.4-2 libldap2-dev festival-dev festival curl libcurl4-openssl-dev lua5.1 uw-mailutils libgsm1 libiksemel3 libogg0 libspeex1 libspeexdsp1 libvorbis0a libvorbisenc2 doxygen libnewt-dev libogg-dev libvorbis-dev liblua5.1-posix-dev libgsm1-dev screen flex bison openssl doxygen mlocate lynx tar nmap bzip2 unixODBC mysql-server mysql-client libmysqlclient-dev


tar -xvzf srtp-1.4.2.tgz
cd srtp-1.4.2
make
make runtest

cd ..

tar -xvzf libpri-1.4-current.tar.gz
cd libpri-1.4.11.5/
make
make install

cd ..


tar -xvzf dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-2.4.1.2+2.4.1/
make all
make install
make config

cd ..

tar -xvzf asterisk-1.8-current.tar.gz

Now before compiling Asterisk we can add all librairies for Asterisk which will unlock lot of features is not mandatory, settings that I have provided above with aptitude command will be sufficient, it's up to you.

cd asterisk-1.8.4.4/contrib/scripts
./install_prereq
./get_mp3_source.sh

cd ../..

./configure --prefix=/usr
make menuselect
check into "add-ons" section the chan_ooh323 and uncheck into "Channel Drivers" the "chan_h323", after that you can select the option that you require, after that save and exit.

make
make install
make samples

cd /contrib/init.d/
cp rc.debian.asterisk /etc/init.d/
cd /etc/init.d/
mv rc.debian.asterisk asterisk
vi asterisk

and modify value by these values:
# Full path to asterisk binary
DAEMON=/usr/sbin/asterisk
ASTVARRUNDIR=/var/run/asterisk/
ASTETCDIR=/etc/asterisk/

:wq

/etc/init.d/asterisk restart

cd /etc/asterisk/
cp chan_ooh323.conf ooh323.conf

asterisk -r

module unload chan_ooh323.so
module load chan_ooh323.so and then it should find our file

exit

now we'll configure the file ooh323.conf I'll put you only the interesting features:

vi ooh323.conf

[general]
port=1720
bindaddr=0.0.0.0 ;(replace by IP address of your server but it's not mandatory)
context=h323
disallow=all
allow=alaw
allow=ulaw
canreinvite=no
dtmfmode=rfc2833

[Avaya]
type=friend
host=10.147.9.64 ;#CLAN IP address that you have used to configure your signaling link
port=1720
disallow=all
allow=alaw
canreinvite=no
dtmfmode=rfc2833


Now we'll see the extensions.conf file with the most important features:
[general]
[from-sip]
exten => _4XXXX,1,Dial(OOH323/${EXTEN}@Avaya)
;my Dial plan on Avaya is on 5 digit and start with digit 4
[h323]
include => sip-extensions

[sip-extensions]
;Number dialed from Avaya
exten => _600XX,1,Dial(SIP/${EXTEN})
exten => _600XX,n,Wait(25)
exten => _600XX,n,HangUp()


Now On sip.conf

[general]
language=fr
dtmfmode=rfc2833
allowguest=yes
srvlookup=no
qualify=yes
nat=yes
externip=10.147.113.243 ;Replace by your Asterisk server IP address
canreinvite=no
videosupport=yes
tcpenable=yes


[features](!)
type=friend
transport=tcp
secret=Ex€mpl$!
host=dynamic
disallow=all
allow=alaw
;allow=g722
allow=h263
allow=h264
context=from-sip
limitonpeers=yes
callcounter=yes
call-limit=100
;incominglimit=1
nat=yes
qualify=yes
canreinvite=no

[60000](features)
callerid="Cyril CONSTANTIN" <60000>
transport=tcp


asterisk -r
core restart now

asterisk -r
core show channeltypes

you should see OOH323 Objective Systems H323 channels Driver

Register to asterisk by using Jitsi and account 60000 and password Ex€mpl$!
Don't forget to change it after you have tried that it works.

On jitsi don't forget to configure port 5060 and TCP, I'll not show you how to use TLS but it's very simple.

When you are properly registered on Asterisk with jitsi make a call from Avaya to extension 60000 you should receive a call on Jitsi from "Anonymous", answer and check that you have both way audio.

Do it now from your Jitsi to Avaya extension that you have configured in extensions.conf in my case I'll call 40075 but it can be different in your case, answer call from Avaya phone and check that you have both way audio.

Once done we'll configure Avaya to send correctly the CALLID number instead of having "Anonymous"

Do change public-unknown-numbering 0 and add an entry:
5 4 60 emtpy 5


Now you are able to make and receive calls from both way.

I hope that it will help lot of people like it was the case for my previous article.

Best Regards.

Cyril CONSTANTIN