Asterisk-Partner ACS for Voicemail

Replacing PartnerMail VS with Asterisk


The system:

The customer has a Partner ACS R6 with a PartnerMail VS R5, and a handful of 206e expanders in a 5 slot chassis. 6 lines, about 20 extensions. The system serves a home office and the house connected to it, all phones are 18D system phones. PartnerMail has two AutoAttendants for the two businesses run out of the office, and one mailbox used as VMS cover for the home line.

The project:

The customer was unhappy with the PartnerMail VS system. In particular, they wanted voicemail-to-email capability, and the ability to fast-forward through a playing message (which apparently this PartnerMail revision did not allow, according to their previous telephony integrator). It would also take a long time (30+ seconds) to retrieve voicemail from the system- after pressing the Voicemail button, the customer had to enter his extension, password, and several other things to actually hear the message. In addition, the customer is interested in VoIP technology, and wanted an upgrade path to all VoIP phones in the future, replacing their current PBX. Some of these problems could possibly be solved by reconfiguring the PartnerMail system, but it could not provide email integration.
The immediate project was to completely replace PartnerMail with the Asterisk PBX, and have Asterisk provide AutoAttendant (IVR) service and VoiceMail.

Planning:

I drew heavily on information in the excellent Asterisk-Partner ACS article written by shmaltz. Much of the following is directly or indirectly quoted.
The Avaya Partner interacts with its or any other Voice Mail System using DTMF control codes. The PartnerMail shows up as a handful of normal extensions to the system. You assign these extensions to Hunt Group 7. When a call requires the use of the voice mail module (for leaving a message or connecting to an IVR), the partner dials one of the extensions from Hunt Group 7, and when the call is answered it sends the DTMF control code and connects the caller. The voice mail module then does what the code instructed, and (if needed) passes the call back by flashing the channel and sending a star code to transfer the call to its destination.

Configuration:

Most of the required research and testing was done by shmaltz, and this draws on his article heavily.

Known Codes (taken directly from Asterisk-Partner ACS:
  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 attendant (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 might 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#.

By adding these codes to a dialplan, one can make Asterisk effectively impersonate the PartnerMail module. This is a slightly modified version of the one shmaltz wrote.

MWI-
One can turn a system phone's MWI light on or off with a feature code- Feature-09-XX turns MWI on for exten XX, while Feature-10-XX turns MWI off for exten XX. The Avaya will accept # instead of Feature from a non-system phone, so Asterisk should dial #0923 to turn on MWI for port 23, or #1011 to turn it off for port 11.
To accomplish this I used the VMNotify perl script, written by Mike Cathey. After modifying this script to use the right channels / codes and creating the directories it needed, I added it to externnotify= in voicemail.conf. This calls the script after every time VoiceMail() or VoiceMailMain() is exited for a mailbox, and it works perfectly on the Avaya.

The following is the dialplan I used:


[avayavm]

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 avaya being used)
exten => _#00#XX#XX#,2,NoOp(CallerID is ${CALLERID})
exten => _#00#XX#XX#,3,Noop()
exten => _#00#XX#XX#,4,Set(CALLERID(num)=${EXTEN:4:2})
exten => _#00#XX#XX#,5,VoiceMailMain(${CALLERIDNUM},s)
exten => _00#XX#XX#,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning

exten => _#02#XX#XX#,1,Noop("known caller (first pair of XX), leaving message for subscriber (second pair of XX)")
exten => _#02#XX#XX#,2,NoOp(CallerID is ${CALLERID})
exten => _#02#XX#XX#,3,Noop()
exten => _#02#XX#XX#,4,Set(CALLERID(num)=${EXTEN:4:2})
exten => _#02#XX#XX#,5,VoiceMail(u${EXTEN:7:2})
exten => _02#XX#XX#,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning

exten => _#03##XX#,1,Noop("someone leaving a message for XX)
exten => _#03##XX#,2,NoOp(CallerID is ${CALLERID})
exten => _#03##XX#,3,Set(line=${EXTEN:6:1})
exten => _#03##XX#,4,VoiceMail(u${EXTEN:5:2})
exten => _03##XX#,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning

exten => _#01#XX##,1,Noop(${EXTEN}" auto attendant XX indicates line number")
exten => _#01#XX##,2,NoOp(CallerID is ${CALLERID})
exten => _#01#XX##,3,Set(line=${EXTEN:5:1})
exten => _#01#XX##,4,Goto(mainivr,s,1)
exten => _01#XX##,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning

exten => _#04##XX#,1,Noop(${EXTEN}" auto attendant XX indicates line number")
exten => _#04##XX#,2,NoOp(CallerID is ${CALLERID})
exten => _#04##XX#,3,Set(line=${EXTEN:6:1})
exten => _#04##XX#,4,Goto(mainivr,s,1)
exten => _04##XX#,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning


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 => a,1,VoiceMailMain() ; in case someone pushes * during a voicemail session

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


[aaextens]
exten => _XX,1,Noop(call transferred to avaya exten ${EXTEN})
exten => _XX,2,Background(hold-xfer) ; When the channel flashes, caller hears a 'click'. This is so they don't think they got dropped.
exten => _XX,3,ExecIf($[${EXTEN} > 25],Goto,i,1) ; extens 1-24 were them, 25 unused, 26-29 are voicemail.
exten => _XX,4,Flash()
exten => _XX,5,SendDTMF(${EXTEN})
exten => _XX,6,Hangup()

exten => i,1,Playback(xfer-oper)
exten => i,2,Flash()
exten => i,3,SendDTMF(10)
exten => i,4,Hangup()

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



[mainivr] ; Their companies main IVR

;( their IVR goes here)

exten => 1,1,Goto(aaextens,11,1) ; xfer to 11
exten => 2,1,Goto(aaextens,12,1) ; xfer to 12
exten => 3,1,Goto(aaextens,13,1) ; xfer to 13
exten => 4,1,Goto(aaextens,14,1) ; xfer to 14
exten => 0,1,Goto(aaextens,10,1) ; xfer to 10

exten => *,1,VoiceMailMain() ; let them check their voicemail


[vmnotify] ; for vmnotify.pl script
exten => s,1,Wait(5)
exten => s,2,Hangup



Installation:

I constructed a relatively small CentOS server with a Sangoma A200 card, configured with 4 FXO ports. I chose the Sangoma card because it only requires one PCI slot and (via a backplane) can provide up to 20 ports (given enough external slots). The MicroATX board I used had only two PCI slots, so using a Digium TDM400 card would limit the system to 8 ports. As the company migrates to VoIP, it may become necessary to pass all 6 lines through the * server, and have the Avaya do nothing but provide trunks to the phones. This will require 12 ports. The Sangoma card is well constructed- the ports themselves glow according to which module they are connected to, red for FXO, green for FXS.
These 4 ports were connected to Extens 26-29 on the Avaya PBX, and assigned to Hunt Group 7. Extens 34-35 (the PartnerMail system) were removed from Hunt Group 7. All the VM extens (26-29 and 34-35) were removed from all incoming lines so no calls would ring directly to the VM module or Asterisk when not specifically told to via Hunt Group 7.
This created an odd problem: When the Asterisk box was connected, any call coming in would cause ALL the lines to go active for a second, then drop. If the call had not been answered before that, it would be dropped. The stranger part was that this behavior would persist until Asterisk was disconnected AND the Avaya PBX was rebooted. The problem turned out to be that the Avaya was providing power for a system phone on pins 1 and 4 (the outside pins), which was somehow interacting with the Sangoma card in a way that confused the Avaya. Remaking the cables to only provide tip/ring pins solved the issue, and the system was up and running!

Result:

Asterisk works perfectly with the Avaya PBX. The above dialplan does not prompt for authentication when dialing from a phone with a valid mailbox, so they can simply push 'voicemail' and then 1 to start playing messages. In addition, they can easily fast forward through long messages on the PC using media player software. So far the customer is very happy with the system.

Annoyances

There are a few small issues. The main one is that when Asterisk flashes a channel to transfer, the caller hears a 'click-click' which sounds very much like the system has hung up on them. Thus, the 'hold-xfer' message.
The Avaya does not provide CallerID to the extension ports (only Avaya system phones can read the CallerID). As a result, the Asterisk server gets no CallerID to associate with the voice mail.
Voice over IP integration is not easy with this setup, because the Avaya PBX does not support any kind of dialplan at all! Also, when one manually dials any port assigned to Trunk Group 7, the PBX 'helpfully' sends the 'checking voicemail' code so VM ports could not be also used for DISA. The lack of dialplan and trunking capability limits how far this PBX can integrate with VoIP, especially when it comes to internal extensions and paging (intercom) between the Partner and Asterisk sides.

Hits: 25952

Replacing PartnerMail VS with Asterisk


The system:

The customer has a Partner ACS R6 with a PartnerMail VS R5, and a handful of 206e expanders in a 5 slot chassis. 6 lines, about 20 extensions. The system serves a home office and the house connected to it, all phones are 18D system phones. PartnerMail has two AutoAttendants for the two businesses run out of the office, and one mailbox used as VMS cover for the home line.

The project:

The customer was unhappy with the PartnerMail VS system. In particular, they wanted voicemail-to-email capability, and the ability to fast-forward through a playing message (which apparently this PartnerMail revision did not allow, according to their previous telephony integrator). It would also take a long time (30+ seconds) to retrieve voicemail from the system- after pressing the Voicemail button, the customer had to enter his extension, password, and several other things to actually hear the message. In addition, the customer is interested in VoIP technology, and wanted an upgrade path to all VoIP phones in the future, replacing their current PBX. Some of these problems could possibly be solved by reconfiguring the PartnerMail system, but it could not provide email integration.
The immediate project was to completely replace PartnerMail with the Asterisk PBX, and have Asterisk provide AutoAttendant (IVR) service and VoiceMail.

Planning:

I drew heavily on information in the excellent Asterisk-Partner ACS article written by shmaltz. Much of the following is directly or indirectly quoted.
The Avaya Partner interacts with its or any other Voice Mail System using DTMF control codes. The PartnerMail shows up as a handful of normal extensions to the system. You assign these extensions to Hunt Group 7. When a call requires the use of the voice mail module (for leaving a message or connecting to an IVR), the partner dials one of the extensions from Hunt Group 7, and when the call is answered it sends the DTMF control code and connects the caller. The voice mail module then does what the code instructed, and (if needed) passes the call back by flashing the channel and sending a star code to transfer the call to its destination.

Configuration:

Most of the required research and testing was done by shmaltz, and this draws on his article heavily.

Known Codes (taken directly from Asterisk-Partner ACS:
  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 attendant (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 might 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#.

By adding these codes to a dialplan, one can make Asterisk effectively impersonate the PartnerMail module. This is a slightly modified version of the one shmaltz wrote.

MWI-
One can turn a system phone's MWI light on or off with a feature code- Feature-09-XX turns MWI on for exten XX, while Feature-10-XX turns MWI off for exten XX. The Avaya will accept # instead of Feature from a non-system phone, so Asterisk should dial #0923 to turn on MWI for port 23, or #1011 to turn it off for port 11.
To accomplish this I used the VMNotify perl script, written by Mike Cathey. After modifying this script to use the right channels / codes and creating the directories it needed, I added it to externnotify= in voicemail.conf. This calls the script after every time VoiceMail() or VoiceMailMain() is exited for a mailbox, and it works perfectly on the Avaya.

The following is the dialplan I used:


[avayavm]

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 avaya being used)
exten => _#00#XX#XX#,2,NoOp(CallerID is ${CALLERID})
exten => _#00#XX#XX#,3,Noop()
exten => _#00#XX#XX#,4,Set(CALLERID(num)=${EXTEN:4:2})
exten => _#00#XX#XX#,5,VoiceMailMain(${CALLERIDNUM},s)
exten => _00#XX#XX#,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning

exten => _#02#XX#XX#,1,Noop("known caller (first pair of XX), leaving message for subscriber (second pair of XX)")
exten => _#02#XX#XX#,2,NoOp(CallerID is ${CALLERID})
exten => _#02#XX#XX#,3,Noop()
exten => _#02#XX#XX#,4,Set(CALLERID(num)=${EXTEN:4:2})
exten => _#02#XX#XX#,5,VoiceMail(u${EXTEN:7:2})
exten => _02#XX#XX#,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning

exten => _#03##XX#,1,Noop("someone leaving a message for XX)
exten => _#03##XX#,2,NoOp(CallerID is ${CALLERID})
exten => _#03##XX#,3,Set(line=${EXTEN:6:1})
exten => _#03##XX#,4,VoiceMail(u${EXTEN:5:2})
exten => _03##XX#,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning

exten => _#01#XX##,1,Noop(${EXTEN}" auto attendant XX indicates line number")
exten => _#01#XX##,2,NoOp(CallerID is ${CALLERID})
exten => _#01#XX##,3,Set(line=${EXTEN:5:1})
exten => _#01#XX##,4,Goto(mainivr,s,1)
exten => _01#XX##,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning

exten => _#04##XX#,1,Noop(${EXTEN}" auto attendant XX indicates line number")
exten => _#04##XX#,2,NoOp(CallerID is ${CALLERID})
exten => _#04##XX#,3,Set(line=${EXTEN:6:1})
exten => _#04##XX#,4,Goto(mainivr,s,1)
exten => _04##XX#,1,Goto(#${EXTEN},1) ; sometimes asterisk doesn't get the # at the beginning


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 => a,1,VoiceMailMain() ; in case someone pushes * during a voicemail session

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


[aaextens]
exten => _XX,1,Noop(call transferred to avaya exten ${EXTEN})
exten => _XX,2,Background(hold-xfer) ; When the channel flashes, caller hears a 'click'. This is so they don't think they got dropped.
exten => _XX,3,ExecIf($[${EXTEN} > 25],Goto,i,1) ; extens 1-24 were them, 25 unused, 26-29 are voicemail.
exten => _XX,4,Flash()
exten => _XX,5,SendDTMF(${EXTEN})
exten => _XX,6,Hangup()

exten => i,1,Playback(xfer-oper)
exten => i,2,Flash()
exten => i,3,SendDTMF(10)
exten => i,4,Hangup()

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



[mainivr] ; Their companies main IVR

;( their IVR goes here)

exten => 1,1,Goto(aaextens,11,1) ; xfer to 11
exten => 2,1,Goto(aaextens,12,1) ; xfer to 12
exten => 3,1,Goto(aaextens,13,1) ; xfer to 13
exten => 4,1,Goto(aaextens,14,1) ; xfer to 14
exten => 0,1,Goto(aaextens,10,1) ; xfer to 10

exten => *,1,VoiceMailMain() ; let them check their voicemail


[vmnotify] ; for vmnotify.pl script
exten => s,1,Wait(5)
exten => s,2,Hangup



Installation:

I constructed a relatively small CentOS server with a Sangoma A200 card, configured with 4 FXO ports. I chose the Sangoma card because it only requires one PCI slot and (via a backplane) can provide up to 20 ports (given enough external slots). The MicroATX board I used had only two PCI slots, so using a Digium TDM400 card would limit the system to 8 ports. As the company migrates to VoIP, it may become necessary to pass all 6 lines through the * server, and have the Avaya do nothing but provide trunks to the phones. This will require 12 ports. The Sangoma card is well constructed- the ports themselves glow according to which module they are connected to, red for FXO, green for FXS.
These 4 ports were connected to Extens 26-29 on the Avaya PBX, and assigned to Hunt Group 7. Extens 34-35 (the PartnerMail system) were removed from Hunt Group 7. All the VM extens (26-29 and 34-35) were removed from all incoming lines so no calls would ring directly to the VM module or Asterisk when not specifically told to via Hunt Group 7.
This created an odd problem: When the Asterisk box was connected, any call coming in would cause ALL the lines to go active for a second, then drop. If the call had not been answered before that, it would be dropped. The stranger part was that this behavior would persist until Asterisk was disconnected AND the Avaya PBX was rebooted. The problem turned out to be that the Avaya was providing power for a system phone on pins 1 and 4 (the outside pins), which was somehow interacting with the Sangoma card in a way that confused the Avaya. Remaking the cables to only provide tip/ring pins solved the issue, and the system was up and running!

Result:

Asterisk works perfectly with the Avaya PBX. The above dialplan does not prompt for authentication when dialing from a phone with a valid mailbox, so they can simply push 'voicemail' and then 1 to start playing messages. In addition, they can easily fast forward through long messages on the PC using media player software. So far the customer is very happy with the system.

Annoyances

There are a few small issues. The main one is that when Asterisk flashes a channel to transfer, the caller hears a 'click-click' which sounds very much like the system has hung up on them. Thus, the 'hold-xfer' message.
The Avaya does not provide CallerID to the extension ports (only Avaya system phones can read the CallerID). As a result, the Asterisk server gets no CallerID to associate with the voice mail.
Voice over IP integration is not easy with this setup, because the Avaya PBX does not support any kind of dialplan at all! Also, when one manually dials any port assigned to Trunk Group 7, the PBX 'helpfully' sends the 'checking voicemail' code so VM ports could not be also used for DISA. The lack of dialplan and trunking capability limits how far this PBX can integrate with VoIP, especially when it comes to internal extensions and paging (intercom) between the Partner and Asterisk sides.

Hits: 25952

Created by: IronHelix, Last modification: Wed 13 of Sep, 2006 (18:59 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+