Avaya CM to Asterisk Voicemail without Sip Enablement Server (SES) or Session Manager

Asterisk Voicemail is a good replacement for legacy voicemail and works well with Avaya. You can send an email to your inbox on receipt of a new voicemail or even use imap storage with any imap server. I will document in my next post the steps required to integrate with Microsoft Exchange imap. No Sip Enablement Server (SES) or session manager is required for connectivity to Avaya. Avaya requires TCP sip connections so your Asterisk version must be 1.6 or greater.

You need to check that you have some sip trunk licenses available. Do a “display capacity” and look for the number of available sip trunks.

In order to get MWI working on your Avaya phones, you will need to compile Asterisk from source due to a change in the chan_sip.c source file that formats the sip message-notify packet.

Versions used:
Asterisk 1.8.3.3
Avaya CM 4.0.5

Asterisk
Download source
Modify /asterisk-1.8.3.3/channels/chan_sip.c
Line 12044
The else clause (Packet is TCP) appends “;transport=TCP” on the packet. Avaya does not like this.

Change this:

if (!sip_standard_port(p->socket.type, ourport)) {
if (p->socket.type == SIP_TRANSPORT_UDP) {
ast_str_append(&out, 0, "Message-Account: sip:%s@%s:%d\r\n", exten, domain, ourport);
} else {
ast_str_append(&out, 0, "Message-Account: sip:%s@%s:%d;transport=%s\r\n", exten, domain, ourport, sip_get_transport(p->socket.type));
}
} else {
if (p->socket.type == SIP_TRANSPORT_UDP) {
ast_str_append(&out, 0, "Message-Account: sip:%s@%s\r\n", exten, domain);
} else {
ast_str_append(&out, 0, "Message-Account: sip:%s@%s:%d;transport=%s\r\n", exten, domain, ourport, sip_get_transport(p->socket.type));
}
}

To this:

if (!sip_standard_port(p->socket.type, ourport)) {
if (p->socket.type == SIP_TRANSPORT_UDP) {
ast_str_append(&out, 0, "Message-Account: sip:%s@%s:%d\r\n", exten, domain, ourport);
} else {
ast_str_append(&out, 0, "Message-Account: sip:%s@%s:%d\r\n", exten, domain, ourport);
}
} else {
if (p->socket.type == SIP_TRANSPORT_UDP) {
ast_str_append(&out, 0, "Message-Account: sip:%s@%s\r\n", exten, domain);
} else {
ast_str_append(&out, 0, "Message-Account: sip:%s@%s\r\n", exten, domain);
}
}

Compile.

Set up SIP trunk between Avaya and Asterisk

Avaya CM:

Create Trunk Group

display trunk-group 35 Page 1 of 21
TRUNK GROUP

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

Signaling Group: 35
Number of Members: 20

Create Signaling group. Far-end Node Name is defined by using “change node-names ip” to define the ip of the Asterisk server.
The Near-end Node Name is an Avaya C-lan

display signaling-group 35
SIGNALING GROUP

Group Number: 35 Group Type: sip
Transport Method: tcp

Near-end Node Name: pbx-ethernet Far-end Node Name: asterisk1
Near-end Listen Port: 5060 Far-end Listen Port: 5060
Far-end Network Region: 6
Far-end Domain: Avaya-vm

Bypass If IP Threshold Exceeded? n

DTMF over IP: in-band Direct IP-IP Audio Connections? n
IP Audio Hairpinning? n
Enable Layer 3 Test? n
Session Establishment Timer(min): 3
change node-names ip asterisk1 Page 1 of 2
IP NODE NAMES
Name IP Address
asterisk1 10.125.16.116

Set up the routing to the Asterisk server

list uniform-dialplan                                                  Page   2

                      UNIFORM DIAL PLAN TABLE

 Matching Pattern   Len   Del   Insert Digits   Net    Conv   Node Num
 606                 4     0                    aar     n 
list aar analysis                                                      Page   2

                           AAR DIGIT ANALYSIS REPORT

               Dialed            Total        Route    Call      Node
               String          Min    Max    Pattern   Type     Number
         606                    4      4      302      pubu
display route-pattern 302                                       Page   1 of   3
                    Pattern Number: 302 Pattern Name: Test Sip1
                             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: 35   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
display hunt-group 98                                           Page   1 of  60
                                  HUNT GROUP

            Group Number: 98                               ACD? n
              Group Name: Asterisk VM                    Queue? n
         Group Extension: 6060                          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 98                                           Page   2 of  60
                                  HUNT GROUP





                      Message Center: sip-adjunct

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

Set up the extension in Avaya to cover to Asterisk Voicemail

Coverage Path is used on the station to send to call to hunt group 98

display coverage path 31
                                 COVERAGE PATH

                   Coverage Path Number: 31
                                                  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: h98            Rng:    Point2:
  Point3:                        Point4:
  Point5:                        Point6: 
display station 3495                                            Page   1 of   5
                                     STATION

Extension: 3495                          Lock Messages? n               BCC: 0
     Type: 4610                          Security Code: *                TN: 1
     Port: S00395                      Coverage Path 1: 31              COR: 38
     Name: Test phone                  Coverage Path 2:                 COS: 12
                                       Hunt-to Station:
STATION OPTIONS
                                           Time of Day Lock Table:
              Loss Group: 19         Personalized Ringing Pattern: 1
                                                 Message Lamp Ext: 3495
            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

Make sure that the MWI Served User Type is sip-adjunct

display station 3495                                            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? y
  Emergency Location Ext: 3495          Always Use? n IP Audio Hairpinning? y

Asterisk

sip.conf
[general]
tcpenable=yes
tcpbindaddr=0.0.0.0
allowrefer=yes

[Avaya-vm]
host=10.125.15.65
type=peer
transport=tcp
port=5060
dtmfmode=inband
context=Avaya-vm

;Must add mailbox numbers for SIP NOTIFY messages to light up MWI
[3495]
type=peer
mailbox=3495@Avaya-vm
username=3495
host=avaya.com
transport=tcp
subscribemwi=no
fromdomain=avaya.com
vmexten=3495

extensions.conf

[Avaya-vm]
exten=6060,1,Answer
exten=6060,2,Set(orig_exten=${SIP_HEADER(History-Info,3)})
exten=6060,3,Set(orig_exten=${CUT(orig_exten,<,2)})
exten=6060,4,GotoIf($[${LEN(${orig_exten})}<1]?22)
exten=6060,5,Set(orig_exten=${orig_exten:4:4})
exten=6060,6,GotoIf($["${orig_exten}"=""]?400)
exten=6060,7,GotoIf($["${orig_exten}"="6060"]?22)
exten=6060,8,Voicemail(${orig_exten}@Avaya-vm,u)
exten=6060,9,Hangup
exten=6060,22,Set(orig_exten=${SIP_HEADER(History-Info)})
exten=6060,23,Set(orig_exten=${orig_exten:5:4})
exten=6060,24,GotoIf($["${orig_exten}"="6060"]?400)
exten=6060,25,GotoIf($["${orig_exten}">"8999"]?400)
exten=6060,26,Voicemail(${orig_exten}@Avaya-vm,u)
exten=6060,400,VoicemailMain(${ANI}@Avaya-vm)

voicemail.conf

Voicemail will be sent as an attachment to the user as long as your mail server is set up correctly

[General]
format = wav49|gsm|wav
attach=yes
pollmailboxes=yes
pollfreq=30
[Avaya-vm]
3495 => 1234,test,user@email.com

Here is an invite when extension 5338 calls 3495 and it covers to voicemail (6060)

INVITE sip:6060@Avaya-vm SIP/2.0
From: "Chris" ;tag=0fe726dee77e11b9914d672bb200
To: "6060" 
Call-ID: 0fe726dee77e11ba914d672bb200
CSeq: 1 INVITE
Max-Forwards: 71
Route: 
Record-Route: 
Via: SIP/2.0/TCP 10.125.15.65;branch=z9hG4bK0fe726dee77e11bb914d672bb200
User-Agent: Avaya CM/R014x.00.5.742.0
Supported: 100rel, timer, replaces, join, histinfo
Allow: INVITE, CANCEL, BYE, ACK, PRACK, SUBSCRIBE, NOTIFY, REFER, OPTIONS
Contact: "Chris" 
Session-Expires: 1200;refresher=uac
Min-SE: 1200
P-Asserted-Identity: "Chris" 
Content-Type: application/sdp
History-Info: ;index=1
History-Info: "Test phone" ;index=1.1
History-Info: "Asterisk VM" ;index=1.2
Content-Length: 113

We use the History-Info field to decide whether this is a call directly to voicemail or if this call is covering to voicemail and then play the appropriate message.

This is what a SIP NOTIFY message looks like

Reliably Transmitting (no NAT) to 10.125.15.65:5060:
NOTIFY sip:3495@avaya.com SIP/2.0
Via: SIP/2.0/TCP 10.125.16.116:5060;branch=z9hG4bK6124864b
Max-Forwards: 70
From: "asterisk" ;tag=as4c18ec9f
To: 
Contact: 
Call-ID: 073a283860705f9c1d89b1b17112d3b1@avaya.com
CSeq: 102 NOTIFY
User-Agent: Asterisk PBX 1.8.3.3
Event: message-summary
Content-Type: application/simple-message-summary
Content-Length: 86

Messages-Waiting: yes
Message-Account: sip:3495@avaya.com
Voice-Message: 5/0 (0/0)
About these ads

2 thoughts on “Avaya CM to Asterisk Voicemail without Sip Enablement Server (SES) or Session Manager

  1. extension.conf is not working for me. I use 5 digit extensions for hunt group & stations. Do i need to resolve avaya.com to CLAN IP of avaya. I am using RDNIS to route calls to voicemail but MWI is not working.
    Thanks

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