System information
The following is not a detailed explanation of how to configure SMDI for Asterisk, but
rather an introduction to the concepts, with some basic examples. If you are planning
on implementing SMDI, you will need to write some complex dialplan logic and have
a good understanding of how to interconnect systems via serial connections.
SMDI is enabled in Asterisk by the use of two options in the [general] section of the
voicemail.conf file:
smdienable=yes
smdiport=/dev/ttyS0; or whatever serial port you are connecting your SMDI service to
Additionally, you will need an smdi.conf file in your /etc/asterisk folder to define the
details of your SMDI configuration. It should look something like this (see the
smdi.conf.sample file for more information on the available options):
[interfaces]
charsize=7
paritybit=even
baudrate=1200 ; hopefully a higher bitrate is supported
smdiport=/dev/ttyS0 ; or whatever serial port you'll be using to handle
; SMDI messages on asterisk
[mailboxes] ; map incoming digit strings (typically DID numbers)
; to a valid mailbox@context in voicemail.conf
smdiport=/dev/ttyS0 ; first declare which SMDI port the following mailboxes
; will use
4169671111=1234@default
4165551212=9999@default
In the dialplan there are two functions that will be wanted in an SMDI configuration.
The SMDI_MSG_RETRIEVE() function pulls the relevant message from the SMDI message
queue. You need to pass the function a search key (typically the DID that is referred to
in the message), and it will pass back an ID number that can be referenced by the
SMDI_MSG() function:
SMDI_MSG_RETRIEVE(<smdi port>,<search key>[,timeout[,options]])
Once you have the SMDI message ID, you can use the SMDI_MSG() function to access
various details about the message, such as the station, callerID, and type (the SMDI
message type):
SMDI_MSG(<message_id>,<component>)
In your dialplan, you will need to handle the lookup of the SMDI messages that come
in, in order to ensure that calls are handled correctly. For example, if an incoming call
is intended for delivery to a mailbox, the message type might be one of B (for busy) or
N (for unanswered calls). If, on the other hand, the call is intended to go to VoiceMail
Main() because the caller wants to retrieve his messages, the SMDI message type would
be D, and that would have to be handled.
178 | Chapter 8: Voicemail