Avaya to Asterisk to Exchange 2010 Unified Messaging

Exchange 2010 Unified Messaging is feature rich and can replace a legacy PBX voicemail system.  Avaya communication manager can utilize Unified messaging without a session manager (used to be called Sip enablement server) by interfacing with the Asterisk free pbx.

Software and versions used:

  • Avaya Communication Manager 4.0.5
  • Asterisk 10.1.2
  • Exchange 2010 sp1 version 14.01.0218.013
  • opensips 1.7.2

Check your Avaya system to make sure that you have enough Sip trunks licenced.

display capacity

display capacity                                       Page   7 of  12
                                                  SYSTEM CAPACITY
                                                  System
                                            Used Available  Limit
                                          -----------------------
 SIP Trunks (included in 'Trunk ports'):    178     222      400

There are 400 sip trunks licenced and 222 available.

Set up a trunk group between Avaya and Asterisk

Avaya Configuration

 

1. Create node name for remote Asterisk server.

The authoritative domain is set in the ip network region to “avaya.com”

change node-names ip

list node-names                                                Page   4
NODE NAMES

Type     Name              IP Address
IP       asterisk          10.125.16.115

2. Create Signaling Group

display signaling-group 13
SIGNALING GROUP

Group Number: 13             Group Type: sip
Transport Method: tcp
Near-end Node Name: pbx-ethernet          Far-end Node Name: asterisk
Near-end Listen Port: 5060                Far-end Listen Port: 5060
Far-end Network Region:
Far-end Domain: asterisk

Bypass If IP Threshold Exceeded? n

DTMF over IP: rtp-payload            Direct IP-IP Audio Connections? n
IP Audio Hairpinning? n
Enable Layer 3 Test? n
Session Establishment Timer(min): 3

DTMF over IP: Use rtp-payload (rfc2833)

Near-end Node Name is a c-lan card.

3. Create Trunk Group

display trunk-group 8                                  Page   1 of  22
TRUNK GROUP

Group Number: 8                    Group Type: sip           CDR Reports: y
Group Name: Asterisk                    COR: 1        TN: 1        TAC: 769
Direction: two-way        Outgoing Display? y
Dial Access? n                                   Night Service:
Queue Length: 0
Service Type: public-ntwrk          Auth Code? n

Signaling Group: 13
Number of Members: 8
display trunk-group 8                                   Page   2 of  22
Group Type: sip

TRUNK PARAMETERS

Unicode Name? y

Redirect On OPTIM Failure: 5000

SCCAN? n                               Digital Loss Group: 18
Preferred Minimum Session Refresh Interval(sec): 600
display trunk-group 8                                  Page   5 of  22
PROTOCOL VARIATIONS

Mark Users as Phone? n
Prepend '+' to Calling Number? n
Send Transferring Party Information? n

Telephone Event Payload Type:

4. Create Uniform Dial Plan to route selected numbers to the Asterisk Server

list uniform-dialplan                                                  Page   2

UNIFORM DIAL PLAN TABLE

Matching Pattern   Len   Del   Insert Digits   Net    Conv   Node Num
609                 4     0                                       aar     n

In this example, 6090 – 6099 will be routed using the aar table.

5. Update AAR table

list aar analysis                                                      Page   2

AAR DIGIT ANALYSIS REPORT

Dialed            Total        Route    Call      Node
String          Min    Max    Pattern   Type     Number

609                    4      4           301       pubu

6. Create route pattern

list route-pattern
ROUTE PATTERNS
Route Name/Trk FRL Hop IXC      BCC      TSC  CA-TSC    ITC   Service/Feature
Pat   Pref Grp     Lmt      0 1 2 M 4 W       Request
301  test sip
1   8    0      user y y y y y n   n   none      rest
display route-pattern 301                                       Page   1 of   3
Pattern Number: 301 Pattern Name: test sip
SCCAN? n     Secure SIP? n
Grp FRL NPA Pfx Hop Toll No.  Inserted                             DCS/ IXC
No          Mrk Lmt List Del  Digits                               QSIG
Dgts                                      Intw
1: 8    0                                                              n   user
2:                                                                     n   user
3:                                                                     n   user
4:                                                                     n   user
5:                                                                     n   user
6:                                                                     n   user

BCC VALUE  TSC CA-TSC    ITC BCIE Service/Feature PARM  No. Numbering LAR
0 1 2 M 4 W     Request                                 Dgts Format
Subaddress
1: y y y y y n  n            rest                                         none
2: y y y y y n  n            rest                                         none
3: y y y y y n  n            rest                                         none
4: y y y y y n  n            rest                                         none
5: y y y y y n  n            rest                                         none
6: y y y y y n  n            rest                                         none

Route pattern 301 sends traffic to the Asterisk box using trunk group 8.

7. Create Hunt Group

display hunt-group 100                                          Page   1 of  60
HUNT GROUP

Group Number: 100                              ACD? n
Group Name: Asterisk VM               Queue? n
Group Extension: 6096                          Vector? n
Group Type: ucd-mia                Coverage Path:
TN: 1          Night Service Destination:
COR: 1                    MM Early Answer? n
Security Code:               Local Agent Preference? n
ISDN/SIP Caller Display:
display hunt-group 100                                          Page   2 of  60
HUNT GROUP

Message Center: sip-adjunct

Voice Mail Number        Voice Mail Handle         Routing Digits
(e.g., AAR/ARS Access Code)
6096                     6096                      709

8. Create Coverage Path that will be assigned to stations

display coverage path 32
COVERAGE PATH

Coverage Path Number: 32
Hunt after Coverage? n
Next Path Number:          Linkage

COVERAGE CRITERIA

Station/Group Status    Inside Call     Outside Call
Active?                       n              n
Busy?                       y              y
Don't Answer?                 y              y         Number of Rings: 5
All?                          n              n
DND/SAC/Goto Cover?         y              y
Holiday Coverage?              n              n

COVERAGE POINTS
Terminate to Coverage Pts. with Bridged Appearances? n
Point1: h100           Rng:    Point2:
Point3:                        Point4:
Point5:                        Point6:

9. Assign Coverage Path to station

display station 5338                                            Page   1 of   5
STATION

Extension: 5338                          Lock Messages? n               BCC: 0
Type: 4610                          Security Code: *                TN: 2
Port: S00532                      Coverage Path 1: 32              COR: 1
Name: Chris                       Coverage Path 2:                 COS: 15
Hunt-to Station:
STATION OPTIONS
Time of Day Lock Table:
Loss Group: 19         Personalized Ringing Pattern: 1
Message Lamp Ext: 5338
Speakerphone: 2-way               Mute Button Enabled? y
Display Language: english
Survivable GK Node Name:
Survivable COR: internal              Media Complex Ext:
Survivable Trunk Dest? y                          IP SoftPhone? y

IP Video Softphone? n

Customizable Labels? y
display station 5338                                            Page   2 of   5
STATION
FEATURE OPTIONS
LWC Reception: spe              Auto Select Any Idle Appearance? n
LWC Activation? y                         Coverage Msg Retrieval? y
LWC Log External Calls? n                                    Auto Answer: none
CDR Privacy? n                               Data Restriction? n
Redirect Notification? y                     Idle Appearance Preference? n
Per Button Ring Control? n                   Bridged Idle Line Preference? n
Bridged Call Alerting? y                       Restrict Last Appearance? y
Active Station Ringing: single
EMU Login Allowed? n
H.320 Conversion? n          Per Station CPN - Send Calling Number?
Service Link Mode: as-needed
Multimedia Mode: enhanced                 Audible Message Waiting? n
MWI Served User Type: sip-adjunct           Display Client Redirection? n
Select Last Used Appearance? n
Coverage After Forwarding? s
Multimedia Early Answer? n
Remote Softphone Emergency Calls: as-on-local Direct IP-IP Audio Connections? n
Emergency Location Ext: 5338          Always Use? n IP Audio Hairpinning? n

Asterisk Configuration

1. Create sip trunks to Avaya and to Exchange

sip.conf

[Exchange2010]
tcpenable=yes
host=10.125.28.5
type=peer
nat=no
transport=tcp
port=5065
context=default
dtmfmode=auto
disallow=all                   ; First disallow all codecs
allow=ulaw                     ; Allow codecs in order of preference
relaxdtmf=yes
canreinvite=no  ;this is needed to force asterisk to bridge calls

[Avaya-vm]
tcpenable=yes
host=10.125.15.65
type=peer
transport=tcp
port=5060
dtmfmode=rfc2833
context=Avaya-vm
nat=no
canreinvite=no ;this is needed to force asterisk to bridge calls

2. Add extensions for dialing exchange.  Additionally, the logic is included to find out if the original dialed number was the voicemail number (6096) or if the avaya coverage path sent the call here.  Since my 8YY numbers VDNs are 5 digit and int the 9XXXX range, I also check if the number was dialed from outside.

extensions.conf

[default]
exten => _5XXX,1,Dial(SIP/${EXTEN}@Avaya-vm)
exten => _8XXX,1,Dial(SIP/${EXTEN}@Avaya-vm)
exten => 6095,1,Dial(SIP/${EXTEN}@Exchange2010)
exten => 6096,1,Dial(SIP/${EXTEN}@Exchange2010)

[Avaya-vm]
exten => 6096,1,Answer
exten => 6096,2,Set(orig_exten=${SIP_HEADER(History-Info,3)})
exten => 6096,3,Set(orig_exten=${CUT(orig_exten,<,2)})
exten => 6096,4,GotoIf($[${LEN(${orig_exten})}<1]?22)
exten => 6096,5,Set(orig_exten=${orig_exten:4:4})
exten => 6096,6,GotoIf($["${orig_exten}"=""]?400)
exten => 6096,7,GotoIf($["${orig_exten}"="6096"]?22)
exten => 6096,8,SIPAddHeader(Diversion: <tel:${orig_exten}>;reason=user-busy;screen=no;privacy=off)
exten => 6096,9,Dial(SIP/6096@Exchange2010)
exten => 6096,10,Hangup
exten => 6096,22,Set(orig_exten=${SIP_HEADER(History-Info)})
exten => 6096,23,Set(orig_exten=${orig_exten:5:4})
exten => 6096,24,GotoIf($["${orig_exten}"="6096"]?400)
exten => 6096,25,GotoIf($["${orig_exten}">"8999"]?400)
exten => 6096,26,SIPAddHeader(Diversion: <tel:${orig_exten}>;reason=user-busy;screen=no;privacy=off)
exten => 6096,27,Dial(SIP/6096@Exchange2010)
exten => 6096,400,Dial(SIP/6096@Exchange2010)

;this is the auto attendant number.

exten => 6095,1,Dial(SIP/${EXTEN}@Exchange2010)

Exchange 2010 Configuration

1. Install Exchange Unified Messaging

2. Create New UM Dialplan.  Select number of digits in your dialplan and associate with your UM server

3. Under subscriber access put in the voicemail access number.

4.Configure your UM IP Gateway to point to the Asterisk Server.

At this point, almost everything works.  The only thing that doesn’t work is the Message Waiting Indicator(MWI) on the Avaya phone.

This is where opensips comes in to fix the issue.   In this configuration, Exchange 2010 sends a SIP NOTIFY message to Asterisk with the message-summary.

Opensips Configuration

Here is what the SIP NOTIFY looks like from Exchange to Asterisk

NOTIFY sip:5338@10.125.16.115:5060;user=phone SIP/2.0
FROM: <sip:5338@10.125.16.115:5060;user=phone>;epid=9C9C089B0D;tag=cecc43a247
TO: <sip:5338@10.125.16.115:5060;user=phone>
CSEQ: 5 NOTIFY
CALL-ID: acd683f736af4b4b982822a15eef3ca1
MAX-FORWARDS: 70
VIA: SIP/2.0/TCP 10.125.28.5:46028;branch=z9hG4bK5ddc769
CONTACT: <sip:5338@10.125.16.115:5060;user=phone>
CONTENT-LENGTH: 100
EVENT: message-summary
SUBSCRIPTION-STATE: terminated
USER-AGENT: RTCC/3.5.0.0 MSExchangeUM/14.01.0218.012
CONTENT-TYPE: application/simple-message-summary

Messages-Waiting: yes
Message-Account: sip:5338@10.125.16.115:5060;user=phone
Voice-Message: 1/1

The SIP NOTIFY needs to be manipulated and sent to the Avaya PBX.
1. Install Opensips 1.7.2

/etc/opensips/opensips.cfg

Change listening port to 5061

port=5061
if (from_uri=~”.*@10.125.16.115″)
{
replace_all(“CONTENT-LENGTH: 101″,”CONTENT-LENGTH: 81″);
replace_all(“CONTENT-LENGTH: 100″,”CONTENT-LENGTH: 80″);
replace_all(“CONTENT-LENGTH: 99″,”CONTENT-LENGTH: 79″);
replace_all(“10.125.16.115:5061″,”avaya.com”);
replace_all(“;user=phone”,””);
t_relay(“tcp:10.125.15.65:5060″);
}

In exchange management shell run the command:

Set-UMIPGateway -identity Asterisk -Port 5061

This will change the port that Exchange sends the SIP NOTIFY messages to, but will not affect any other communication.
Once this change is made the SIP NOTIFY messages will go to opensips, which will then forward them to the Avaya Communication Manager.  The MWI will now work.

About these ads

2 thoughts on “Avaya to Asterisk to Exchange 2010 Unified Messaging

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s