Asterisk-Partner ACS

Integrating Asterisk with Avaya Partner ACS

First the Avaya:
The Avaya was a Partner ACS R3, with - besides for the main module - has a VM module, and an extension module.
They wanted mainly VoIP added but wouldn't mind the additional features like VM and IVR options.
In most legacy integrations there are usualy 4 ways:

  1. Put Asterisk in front of the System between the PSTN and the legacy PBX
  2. Put Asterisk as analog extensions on the legacy PBX
  3. Mixed 1 & 2 you have Asterisk sitting before the legacy PBX, and you have it on extension ports
  4. Put Asterisk as trunks on the legacy PBX (using either T1 or analog trunks from legacy to FXS on Asterisk), then programm the Dialplan on the legacy to allow: 1. An access code that gives you access to the Asterisk trunks, 2. Trunk to Trunk access, so that Asterisk can call out.

When using # 2 or 3 above, there are 2 ways you can configure it:
  1. Is a 2 stage dialing, where anyone on the legacy PBX wants to dial anyone on Asterisk has to first dial the extension on the legacy PBX, and then wait for Asterisk to answer, once Asterisk answered you dial the Asterisk extensions. this option usualy doesn't allow for IVR transfer to asterisk. BTW the Avaya Definity (and maybe others) allow you to setup extensions in the Dialplan that get processed by a vector that using skills can do this 2 stage dialing automaticaly for you, and in fact makes one of the best ways (besides for a T1 line) to integrate Asterisk with the Avaya definity.
  2. Each analog extension on the legacy PBX connected to Asterisk, is mapped to an extension in Asterisk, that way that extension is only used for one extension within Asterisk. This option allows one to have the IVR transfer from the legacy system dial an extension on Asterisk directly, however it is very expensive, as it means that Asterisk is not extending the system beyond the capacity of the legacy system.

Since I didn't know the Avaya Partner too well, I first planned on just adding a T1 module to the Avaya which together with a Digium single span T1 card will allow me to program a DialPlan on the Partner that will route certain numbers over the T1, and allow me access the CO lines from the T1 modules, which is very easy to do on the Definity system, and so I thought it would be on the Avaya. So the follwoing was my list for parts on this system:

  • Buy a T1 module for the Partner (BTW, the T1 modules only allows for 16 channels)
  • Asterisk Server
  • Digium single span T1 card
  • Avaya R6 upgrade PC card (needed so that it can support the T1 module)

When I got everything together I realized my mistakes (the Partner is just too limited):

  • There is no DialPlan programming available in the Partner
  • There is no way of allowing direct dialing from the T1 module to the CO lines

So I thought just adding an Adit 600 with an FXO card, and programm the Partner to use only the T1 as outgoing. In this configuration Asterisk would sit between the PSTN and the Avaya. However I ran into problems that the Avaya doesn't support CallerID over the T1, a must for my customer, so I ended up buying a FXS card to the Adit 600, so my config looked like this:
PSTN <> Adit 600 FXO card in slot 1<> Adit 600 slot A1 to Asterisk T1 <> Adit 600 FXS card slot 2 <> Adit 600 A2 to Avaya Partner T1.
The reasone I kept the T1 is that it gave me a few addtional channles between Avaya and asterisk, so that people can be on the phone with asterisk users and all of the PSTN lines.

The installation:

  • Connect the phone lines from telco to the FXO card on the Adit
  • Connect the the Lines to the Avaya to the Adit FXS card
  • Connect a crossover T1 cable from the T1/1 jack on the Adit to Asterisk
  • Connect a crossover T1 cable from the T1/2 jack on the Adit to the Partner

Now the programming side:

  • In the Adit 600 connect all the channels from slot 1 to the first 8 channels on slot a:1
  • In the Adit 600 connect all the channels from slot 2 to the 2nd 8 channels on slot a:1 (channels 9-16)
  • In the Adit 600 connect the rest of the channels from a:1 to the same channels on a:2, Avaya uses only 16 channels from 9-24.
So this is how the Adit looked:
channels a:1:1-8 <> 1:1-8
channels a:1:9-16 <> 2:1-8
channels a:1:17-24 <> a:2:17:24
  • In the Avaya make sure that you programm the T1 card (a PC is required for this, you can't just use extension 10) to disable the first 8 channesl (actualy from channel 9 to 16),
  • For the rest do DID as inbound,
  • Proramm the DID mappings,
  • Tell the Avaya to supply local dialtone on the T1,
  • Programm for all your phones a button that picks up a channel on the T1, I programmed at the most 3 buttons, since there wasn't any room for more. Because these buttons (the T1) are only used for VoIP extensions I didn't need more than that, in case you do, you will have to change the system to Hybrid from Keyed, and programm extensions to use pooled buttons instead of keyed buttons. Keep in mind that the Avaya partner mappes these buttons to actual channles in key mode.
  • In Asterisk, setup the span in /etc/zaptel.conf the main thing is the signaling: fxsks=1-8, fxoks=9-16, e&m=17-24
  • Setup /etc/asterisk/zapata.conf with different signalling for the channels as above,
  • Setup 3 groups in zapata.conf, 1 for the FXO card, 2, for the FXS card, and 3 for the T1. Here I made sure that I didn't configure more than 3 channels for group 3, since the Avaya had no use for any of the other channels, I had to disable them because of lack of buttons, and the Partners inability of using pooled and keyed together.
  • Setup 3 contexts to use for each group above.
  • Now in extension.conf, all I had to do was that group1/context1 is used for connection to the PSTN, and when a call came in, all I did was ring the Partner.
  • for group2/context2 I created outbound dialing as well as included the dialing for the extensions of asterisk
  • for group3/context3 I just setup that when dialing to the Avaya, it either knows the extension and calls that extension using DID, or if it doesn't know the extension, it just calls the VM calling group, using a custom DID map on the Partner.

Avaya VM integration.

The Avaya Partner ACS communicates with it's or any other Voice Mail System using DTMF. The way it works is, that you add the Avaya extensions that Asterisk is connected to in Hunt Group 777 on the Avaya. Using it's VMS Cover feature the Avaya will call those extensions and as soon as the voice mail system picks up it will send the DTMF. The following are codes that I know what they are and what to do with it:
  1. #00#XX#YY# User XX is checking Voice Mail, and is connected using port YY on the Avaya.
  2. #01#XX## Call was forwarded to VM for auto attendand (IVR) services.
  3. #02#XX#YY# Internal caller XX is leaving a voicemail message for YY.
  4. #03##XX# External caller leaving a message for XX.
  5. #04##XX# Also for auto attendand, I wasn't able to figure out which one when, or migh have made a mistake.
  6. #10### Someone put the system in day mode.
  7. #11### Someone put the system in night mode.
  8. #12#XX#YY# I have no clue what it is, but I observed it being done everytime the system started up.
  9. #13#XX#YY# Same as #12#XX#YY#.

When a call comes in to the Avaya I have it going to VM after a few rings, at that point asterisk will get the DTMF codes. Also when someone leaves a message the Avaya will call the VM Ports (Asterisk) with one of the codes above.

In /etc/asterisk/zapata.conf:
channel => 1-6
channel => 7-8

In /etc/asterisk/extensions.conf:
exten => s,1,Set(TIMEOUT(digit)=1)
exten => s,2,Answer
exten => s,3,WaitExten(5)

exten => _#00#XX#XX#,1,Noop(Someone is checking VoiceMail, first XX is the subscribers checking, the 2nd is the port on the a
vaya being used)
exten => _#00#XX#XX#,2,Noop()
exten => _#00#XX#XX#,3,Noop()
exten => _#00#XX#XX#,4,Set(CALLERID(num)=${EXTEN:4:2})
exten => _#00#XX#XX#,5,Goto(fac,740,1);this just goes to a macro for checking voicemail, that macro uses VoiceMailMain

exten => _#02#XX#XX#,1,Noop("knonw caller (first pair of XX), leaving message for subscriber (second pair of XX)")
exten => _#02#XX#XX#,2,Noop()
exten => _#02#XX#XX#,3,Noop()
exten => _#02#XX#XX#,4,Set(CALLERID(num)=${EXTEN:4:2})
exten => _#02#XX#XX#,5,Goto(default,*${EXTEN:7:2},1);thats my macro for going to voicemail (it's like a standardextmacro, only it goes only to voicemail)

exten => _#03##XX#,1,Noop("someone leaving a meesage for XX)
exten => _#03##XX#,2,Noop()
exten => _#03##XX#,3,Noop()
exten => _#03##XX#,4,Goto(default,*${EXTEN:5:2},1)

exten => _#01#XX##,1,Noop(${EXTEN}" auto attendant XX indicates line number")
exten => _#01#XX##,2,Noop()
exten => _#01#XX##,3,Noop()
exten => _#01#XX##,4,Goto(mainivr,s,1)

exten => _#04##XX#,1,Noop("auto attendant XX indicates line number")
exten => _#04##XX#,2,Noop()
exten => _#04##XX#,3,Noop()
exten => _#04##XX#,4,Goto(mainivr,s,1)

exten => _#10###,1,Noop(Someone pushed day mode on the Avaya)
exten => _#10###,2,Set(DB(IVR/NIGHT)=0)
exten => _#10###,3,Hangup()

exten => _#11###,1,Noop(Someone pushed night mode on the avaya)
exten => _#11###,2,Set(DB(IVR/NIGHT)=1)
exten => _#11###,3,Hangup()

;in addition dialing #10XX where XX is the extension will turn off the MWI for that extension
;and dialing #09XX where XX is the extension will turn on the MWI for that extension

include => allothercodes ;we want to see other avaya codes

exten => _#X.,1,Noop(${EXTEN})
exten => _*X.,1,Noop(${EXTEN})
exten => _X.,1,Noop(${EXTEN})
exten => _#.,1,Noop(${EXTEN})
exten => _*.,1,Noop(${EXTEN})

To make the IVR work that when someone dials an extension it rings back to Avaya I use the following dialplan, which is included in mainivr, the avayas extensions go from 10 thru 48, while the 74X are the sip phones connected to Asterisk and is accessable to the Avaya users thru line buttons on the avaya phones:

First /etc/asterisk/features.conf
That is is used to transfer SIP users out of the Avaya system since I don't want to take up a VM port for the entire duration of the conversation:
blindxfer => *1 ; Blind transfer

Now back to /etc/asterisk/extensions.conf
exten => _1X,1,Noop()
exten => _1X,2,GotoIf($[${EXTEN}=19]?10);19 on the Avaya is one of the ports for the VM (asterisk)
exten => _1X,3,Noop()
exten => _1X,4,Flash()
exten => _1X,5,SendDTMF(${EXTEN})
exten => _1X,6,Hangup()

exten => _2X,1,GotoIf($[${EXTEN}=20]?mainivr|i|1);also Vm (asterisk)
exten => _2X,2,GotoIf($[${EXTEN}=24]?mainivr|i|1);door (I don't want anybody to be able to connect to the door opener
exten => _2X,3,GotoIf($[${EXTEN}=25]?mainivr|i|1);another door
exten => _2X,4,Flash()
exten => _2X,5,SendDTMF(${EXTEN})
exten => _2X,6,Hangup()

;since I have *1 as the blindxfer in features.conf I use that to transfer this call out of the asterisk, becasue the call comes in to the avaya thru an Asteirsk FXS port this is possible, but this means that before I dial the Avaya I have to make sure that I have t in the dial command:
exten => _74X,1,SendDTMF(*);I had some problems with asterisk detecting the first DTMF, so I added this line, since asterisk will always listen to the sequence, it doesn't do any harm.
exten => _74X,2,SendDTMF(*1)
exten => _74X,3,SendDTMF(${EXTEN})
exten => _74X,4,Hangup()

MWI on the Avaya

The Avaya has a function for turning the lights on or off. on any extension if you dial Feature10XX where XX is the extension number, that extension will have it's MWI turned off, and Feature09XX will turn it on, all the features on the Avaya system can be dialed by using # instead of Feature. So from Asterisk if you dial #1015 it will turn MWI off for extension 15.

To get it working I downloaded the following script:
from here, and a backup listed here. Huge thanks to the original author, Mike Cathey.. Mike's website. I just followed the instructions to edit the file as needed in my case I use Zap/g4 for MWI, and I dont use notify, so I just made sure to edit that to an invalid context.


This was a very expensive system for the customer but ended up doing what he wanted, which was to stay with the Avaya and add LCR, VM, and VoIP.

Created by: shmaltz, Last modification: Mon 03 of Apr, 2006 (22:53 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+