Monday, 4 July 2011

Asterisk 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

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/

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 runtest

cd ..

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

cd ..

tar -xvzf dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-
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-

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 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


/etc/init.d/asterisk restart

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

asterisk -r

module unload
module load and then it should find our file


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

vi ooh323.conf

bindaddr= ;(replace by IP address of your server but it's not mandatory)

host= ;#CLAN IP address that you have used to configure your signaling link

Now we'll see the extensions.conf file with the most important features:
exten => _4XXXX,1,Dial(OOH323/${EXTEN}@Avaya)
;my Dial plan on Avaya is on 5 digit and start with digit 4
include => 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

externip= ;Replace by your Asterisk server IP address


callerid="Cyril CONSTANTIN" <60000>

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.



SenselessSenses said...

hi constantin,

i'm using Asterisk w/
FreePBX on a Centos 5.7

successfuly configured ooh323.conf my problem is

1. asterisk to avaya ext call has no audio.
2. avaya to asterisk exte call - unsuccessful.. i got this error: "denial event 1220: Recovery on timer expiry"

tried all possible config for both avaya & asterisk that i know and get from forums.. but still unable to make a successful call.

avaya is in my LAN / NATted to a public IP.
asterisk server is a hosted VPS

I think it has something to do w/ my NAT. any suggestion to make it work?

i will also email this to you including the captured trace for reference.. i can also include all my config in both avaya & asterisk.

hope to get your reply.


Sergio Usón said...

Hi, Cyril, thanks for share your knowledge.
Do you need a license for to do this?

Boris said...


your problem sound like firewall blockings, did you check this?

Avaya licences is not free (H.323 needed),
Asterisk is GNU/GPL.


Boris said...

Hi Constantin,

thanks for this nice guide

I have 2 questions:

1) Why you use qsig as transport protokoll national will work also, because h.323 did not support realy qsig features.

2) Why you need h.248 it is a gateway protocoll.

This to feature will cost money at germany thats the reason for my interessting.


personalprojects said...

Excellent. Now Traying !!

constantin said...

Hi Boris,

1)it was needed for me to use qsig for specific development on Avaya to get some value from Avaya by sniffing packet

2) I'm not using H248, I don't know where you saw it. Please let me know.

Best Regards

kwli said...

Hi Constantin,
Great setup instruction. I was able to make call from Avaya to asterisk. But I ran in to problem with making call out from Asterisk to Avaya. From the ooh323_log show that I get Q931NoCircuitChannelAvailable during the Setup OpenLogicalChannel. Did I miss some step on the Avaya configuration?
We are using Avaya CM 5.2.1 with Asterisk 1.8.10 on Debian 6.0.4 32bit.

Thanks in advance.


Frances said...

This informative post would definitely be of great help for those who work closely with Avaya support teams.

ICT Indonesia said...

hi sir
how to dialout from asterisk using avaya ougoing trunk


constantin said...


You should create a dial plan.

Let say that your SIP Phone use the context "from-sip".

Add into it:

include => external

then if you try to dial 10 digits and need to add a 0 to make outbound call keep it like this or remove the 0 before {EXTEN}, you should adapt it to your country:

exten => _0XXXXXXXXX,1,NoOp(${CALLERID(all)})
exten => _0XXXXXXXXX,n,Dial(OOH323/0${EXTEN}@Avaya)

Avaya context match with the context declared into ooh323.conf which is for example
language = fr
country = fr

Chin Theong Tan said...
This comment has been removed by the author.
Chin Theong Tan said...

Thanks a lot. I managed to get both way calling with audio with the help of your guide.
FYI you do not need to set y to "H245 Support with other Vendors"

soysolojuan said...

Hi I have an Asterisk but some times inbound calls doesnt work, i need to reboot the asterisk, maybe exist a "reconnect" or "keep alive" parameter. the error on h323_log is this message, hope someone can help me. regards!

11:57:27:352 ERROR:Failed ooH2250Receive - Clearing call (incoming, ooh323c_159)
11:57:27:352 In ooEndCall call state is - OO_CALL_CLEAR (incoming, ooh323c_159)
11:57:27:352 Cleaning Call (incoming, ooh323c_159)- reason:OO_REASON_INVALIDMESSAGE
11:57:27:352 Closing H.245 connection (incoming, ooh323c_159)
11:57:27:352 Removing call 95de918: ooh323c_159
11:57:27:352 Removed call (incoming, ooh323c_159) from list

jorgearturo said...
This comment has been removed by the author.
jorgearturo said...

Hello, I find this guide to be very helpful. It helped me connect an Asterisk 1.6 box with Avaya using ooh323.

All calls between Avaya and Asterisk work fine, there is both way audio. I have used three codecs and the three work flawlessly (ulaw, alaw and g729).

The problem is when trying to make an external call from Asterisk. At the Asterisk end I can hear the voice but on the other end there's nothing. I don't know why I am getting this one way audio problem.

Both Asterisk and Avaya are on the same subnet and I've tried with many SIP clients (both softphones and actual phones) and the three audio codecs with no luck. Right now I'm only using ulaw but still can't get the audio to sound on the far end.

Do you have any suggestion to solve this issue?

Hope to hear from you. Thanks a lot!

mike das said...

I don't know why my comment got deleted but maybe you can help me out and set up a tutorial of how to connect avaya 5.x to asterisk using a sip trunk and not a h323 trunk. I have a successful set up and works great!

John John said...

How did get the inboud to work from avaya to asterisk?

My inbound calls hangup after 2 seconds.

any help, I will appreciate it.

John John said...

I have setup Asterisk 1.8 to make calls to Avaya and vice versa. But when I call from Avaya to Asterisk, the call rings for 2 second and hangup.

both boxs are in the same VLAN, with diferent sub nets.

Please, any help.