[Asterisk-Dev] SMDI and MWI: serial protocol for switch communication

John Todd jtodd at loligo.com
Fri Jun 13 16:30:27 MST 2003


I've been taking a brief look at how to integrate Asterisk's 
voicemail system with external voicemail systems.  It is often the 
case that Asterisk is implemented in an organization that has prior 
hardware that they wish to maintain and simply use Asterisk as a 
"smart" call gateway or for VOIP routing purposes.  Often, the 
voicemail system in Asterisk is a very interesting proposition as a 
replacement for expensive legacy platforms, but the question always 
arises: "Will the voicemail indicator lights on my current PBX system 
work if the voicemail is stored in Asterisk?"  The answer is "No" or 
"Not unless we figure out some way to do it."

Well, here is perhaps part of the answer on the "figure out some way 
to do it" question.  It appears that MWI's can be lit with what 
appears to be a fairly simple serial protocol.  Included below are 
two message snippets for the Bellcore spec on MWI transport, which 
I'm sure somebody clever could implement through a PC's serial port. 
These indicators are a part of a much larger simple protocol called 
"SMDI" which can be relayed via a serial port, but I will include 
only those messages for MWI.

This protocol of course could be made to work both ways, if you want 
to have Asterisk-served phones show MWI for voicemail stored in some 
other voicemail system, so long as you have some sort of mapping 
table between extensions or the two systems have exactly the same 
numbering plan.  This may be counter-intuitive, but never 
underestimate how emotionally attached people are to their voicemail 
systems.

I don't have a particular need for these right now, because I've 
always had to answer "No" on the question of MWI, and those bids went 
to other vendors :(  Perhaps if someone wants to beat me to the punch 
on a module to implement SMDI over a COM port, I can get my next bid 
that asks about it.  It's also nice to throw useful stuff like this 
into the archives, because I'm sure someone will be looking for it in 
the next few months, and the actual specification is nice to have 
somewhere searchable.

JT




----------------------------------------------------

Following text from: 
http://digest.textfiles.com/TELECOMDIGEST/vol14.iss0251-0300.txt

From: AL.FARNHAM at hq.doe.gov
Date: 26 May 94 09:56:00 -0400
Subject: Re: SMDI Question


Here is the message format for an SMDI link between a switch and a
Message Desk (Voice Mail System).

The link is normally 1200bps full duplex without handshaking although
some new implementations run at 9600bps.

The Bell spec is TSR-TSY-000283.

SMDI Message protocol:

The system checks messages that it receives from the Message Desk for
adherence to the following message protocols.

Incoming messages - (Voice Mail System to Switch):

There are two kinds of incoming messages the switch can accept
from the message desk:

OP:MWI(SP)nnnnnnn!(D)

RMV:MWI(SP)nnnnnnn!(D)

where:    nnnnnnnnnn = station number (can be 7 or 10 digits)
           (D) = control-D (End Of Transmission)   (SP) = space

The first message activates the message waiting indication. The second
deactivates the message waiting indication.

For example, if Station B (DN 234-2000) forwards calls to the Message
Desk and receives a message, the Message Desk activates message waiting
indication for Station B with the following message:

OP:MWI 2342000!(D)

After Station B retrieves the messages from the Message Desk, the Message
Desk deactivates message waiting indication for Station B with the
following message:

RMV:MWI 2342000!(D)


Outgoing messages - (Switch to Voice Mail System)

There are two groups of messages from the switch to the message desk.

Call details - These message types give items of information concerning
calls which the Message Desk received:

     (CR)(LF)MDgggmmmmannnnnnn(SP)yyyyyyy(SP)(CR)(LF)(Y)
     (CR)(LF)MDgggmmmmannnnnnn(SP)(SP)(CR)(LF)(Y)
     (CR)(LF)MDgggmmmma(SP)yyyyyyy(SP)(CR)(LF)(Y)

MWI change failure - The request to change the Message Waiting Indication
                      failed because it was either invalid (INV) or the switch
                      unable to perform the change when requested (BLK).

     (CR)(LF)MWInnnnnnn(SP)INV(CR)(LF)(DL)(DL)(Y)
     (CR)(LF)MWInnnnnnn(SP)BLK(CR)(LF)(DL)(DL)(Y)

where:
(CR)       = carriage return
(LF)       = line feed
(SP)       = space
(DL)       = delete character (ASCII value FF)
(Y)        = control-Y
ggg        = message desk number (001-063)
mmmm       = message desk terminal (0001-2047)
nnnnnnnnnn = forwarding from station number (can be 7 or 10 digits)
yyyyyyyyyy = calling station number (can be 7 or 10 digits)
a          = type of call
              where D = Direct Calls, A = Forward All Calls,
                    B = Forward Busy Calls, N = Forward No Answer Calls

For example, Station B (DN 234-2000) forwards all calls to the Message
Desk. Station A (DN 678-1234) calls Station B and forwards to Message
Desk number 002, terminal 009. The switch sends the following message
to the Message Desk:

(CR)(LF)MD0020009A2342000 6781234 (CR)(LF)(Y)

Hope this information answers the question.


Regards,

Al
----------------------------------------------------



----------------------------------------------------
Following text from somewhere in my mail archives:

Message Waiting Commands

The system accepts two commands for message waiting lights.

	OP:MWI[SP]xxxxxxx![Control D]

	RMV:MWI[SP]xxxxxxx![Control D]

On: OP. This message will switch on the light for extension xxxxxxx. Leading
zeros are stripped from the number prior to sending the number to the PBX.

Off: RMV. This message will switch off the light for extension xxxxxxx.
Leading zeros are also stripped from the number in this operation.

The application should pad the extension to seven or ten digits using zeros.
The system will accept a [CR][LF] at the end of the packet instead of the Ctrl
D and the ! is optional. This allows installers to test the system by typing
in MWI commands from a simple terminal or terminal program.

For example:

OP:MWI 0001234

will turn on the message light for extension 1234.


If the system carries out the request without an error, it will not respond.
If an error is detected, a packet is sent back to the application with the
following format:

	[CR][LF]MWIxxxxxxx[SP]aaa[CR][LF][Control Y]

xxxxxxx	This is the station identifier which encountered the error.

aaa	This is the error code. Two error codes are supported.

INV	This is a fatal error. The cause is usually that the 
extension number in
the extension field does not exist.

BLK	This is a non fatal error. It usually indicates that an 
attempt was made
to switch off a light that was already off.

If the system has a queue of MWI operations pending then it discards any
duplicate commands already in the queue - a command to put a light on followed
by a command to turn a light off will be replaced by a single command to turn
a light off.


There is a special MWI command that can be given that always generates an
error:

	OP:MWI[SP]5551212![Control D]

This may be useful for testing.

----------------------------------------------------



More information about the asterisk-dev mailing list