1 ===============================================================================
2 ===============================================================================
3 === Asterisk SMDI (Simple Message Desk Interface) integration =================
4 ===============================================================================
5 ===============================================================================
7 ===============================================================================
8 ===== 1) Accessing SMDI information in the dialplan. ==========================
9 ===============================================================================
11 There are two dialplan functions that can be used to access the details of
12 incoming SMDI messages.
14 *CLI> core show function SMDI_MSG_RETRIEVE
16 -= Info about function 'SMDI_MSG_RETRIEVE' =-
19 SMDI_MSG_RETRIEVE(<smdi port>,<search key>[,timeout[,options]])
22 Retrieve an SMDI message.
25 This function is used to retrieve an incoming SMDI message. It returns
26 an ID which can be used with the SMDI_MSG() function to access details of
27 the message. Note that this is a destructive function in the sense that
28 once an SMDI message is retrieved using this function, it is no longer in
29 the global SMDI message queue, and can not be accessed by any other Asterisk
30 channels. The timeout for this function is optional, and the default is
31 3 seconds. When providing a timeout, it should be in milliseconds.
32 The default search is done on the forwarding station ID. However, if
33 you set one of the search key options in the options field, you can change
36 t - Instead of searching on the forwarding station, search on the message
38 n - Instead of searching on the forwarding station, search on the message
42 *CLI> core show function SMDI_MSG
44 -= Info about function 'SMDI_MSG' =-
47 SMDI_MSG(<message_id>,<component>)
50 Retrieve details about an SMDI message.
53 This function is used to access details of an SMDI message that was
54 pulled from the incoming SMDI message queue using the SMDI_MSG_RETRIEVE()
56 Valid message components are:
57 station - The forwarding station
58 callerid - The callerID of the calling party that was forwarded
59 type - The call type. The value here is the exact character
60 that came in on the SMDI link. Typically, example values
61 are: D - Direct Calls, A - Forward All Calls,
62 B - Forward Busy Calls, N - Forward No Answer Calls
65 Here is an example of how to use these functions:
67 ; Retrieve the SMDI message that is associated with the number that
68 ; was called in Asterisk.
69 exten => _0XXX,1,Set(SMDI_MSG_ID=${SMDI_MSG_RETRIEVE(/dev/tty0,${EXTEN})})
71 ; Ensure that the message was retrieved.
72 exten => _0XXX,n,GotoIf($["x${SMDI_MSG_ID}" != "x"]?processcall:hangup)
73 exten => _0XXX,n(hangup),NoOp(No SMDI message retrieved for ${EXTEN})
75 ; Grab the details out of the SMDI message.
76 exten => _0XXX,n(processcall),NoOp(Message found for ${EXTEN})
77 exten => _0XXX,n,Set(SMDI_EXTEN=${SMDI_MSG(${SMDI_MSG_ID},station)})
78 exten => _0XXX,n,Set(SMDI_CID=${SMDI_MSG(${SMDI_MSG_ID},callerid)})
80 ; Map SMDI message types to the right voicemail option. If it is "B", use the
81 ; busy option. Otherwise, use the unavailable option.
82 exten => _0XXX,n,GotoIf($["${SMDI_MSG(${SMDI_MSG_ID},type)}" == "B"]?usebusy:useunavail)
84 exten => _0XXX,n(usebusy),Set(SMDI_VM_TYPE=b)
85 exten => _0XXX,n,Goto(continue)
87 exten => _0XXX,n,(useunavil),Set(SMDI_VM_TYPE=u)
89 exten => _0XXX,n(continue),NoOp( Process the rest of the call ... )
92 ===============================================================================
93 ===== 2) Ensuring complete MWI information over SMDI ==========================
94 ===============================================================================
96 Another change has been made to ensure that MWI state is properly propagated
97 over the SMDI link. This replaces the use of externnotify=smdi for
98 voicemail.conf. The issue is that we have to poll mailboxes occasionally for
99 changes that were made using an IMAP client. So, this ability was added to
100 res_smdi. To configure this, there is a new section in smdi.conf. It looks
104 ; This section configures parameters related to MWI handling for the SMDI link.
106 ; This option configures the polling interval used to check to see if the
107 ; mailboxes have any new messages. This option is specified in seconds.
108 ; The default value is 10 seconds.
112 ; Before specifying mailboxes, you must specify an SMDI interface. All mailbox
113 ; definitions that follow will correspond to that SMDI interface. If you
114 ; specify another interface, then all definitions following that will correspond
115 ; to the new interface.
117 ; Every other entry in this section of the configuration file is interpreted as
118 ; a mapping between the mailbox ID on the SMDI link, and the local Asterisk
119 ; mailbox name. In many cases, they are the same thing, but they still must be
120 ; listed here so that this module knows which mailboxes it needs to pay
124 ; <SMDI mailbox ID>=<Asterisk Mailbox Name>[@Asterisk Voicemail Context]
126 ; If no Asterisk voicemail context is specified, "default" will be assumed.
130 ;2565551234=1234@vmcontext1
131 ;2565555678=5678@vmcontext2
135 ===============================================================================
136 ===============================================================================
137 ===============================================================================