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>,<station>[,timeout])
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.
34 *CLI> core show function SMDI_MSG
36 -= Info about function 'SMDI_MSG' =-
39 SMDI_MSG(<message_id>,<component>)
42 Retrieve details about an SMDI message.
45 This function is used to access details of an SMDI message that was
46 pulled from the incoming SMDI message queue using the SMDI_MSG_RETRIEVE()
48 Valid message components are:
49 station - The forwarding station
50 callerid - The callerID of the calling party that was forwarded
51 type - The call type. The value here is the exact character
52 that came in on the SMDI link. Typically, example values
53 are: D - Direct Calls, A - Forward All Calls,
54 B - Forward Busy Calls, N - Forward No Answer Calls
57 Here is an example of how to use these functions:
59 ; Retrieve the SMDI message that is associated with the number that
60 ; was called in Asterisk.
61 exten => _0XXX,1,Set(SMDI_MSG_ID=${SMDI_MSG_RETRIEVE(${EXTEN})})
63 ; Ensure that the message was retrieved.
64 exten => _0XXX,n,GotoIf($["x${SMDI_MSG_ID}" != "x"]?processcall:hangup)
65 exten => _0XXX,n(hangup),NoOp(No SMDI message retrieved for ${EXTEN})
67 ; Grab the details out of the SMDI message.
68 exten => _0XXX,n(processcall),NoOp(Message found for ${EXTEN})
69 exten => _0XXX,n,Set(SMDI_EXTEN=${SMDI_MSG(${SMDI_MSG_ID},station)})
70 exten => _0XXX,n,Set(SMDI_CID=${SMDI_MSG(${SMDI_MSG_ID},callerid)})
72 ; Map SMDI message types to the right voicemail option. If it is "B", use the
73 ; busy option. Otherwise, use the unavailable option.
74 exten => _0XXX,n,GotoIf($["${SMDI_MSG(${SMDI_MSG_ID},type)}" == "B"]?usebusy:useunavail)
76 exten => _0XXX,n(usebusy),Set(SMDI_VM_TYPE=b)
77 exten => _0XXX,n,Goto(continue)
79 exten => _0XXX,n,(useunavil),Set(SMDI_VM_TYPE=u)
81 exten => _0XXX,n(continue),NoOp( Process the rest of the call ... )
84 ===============================================================================
85 ===== 2) Ensuring complete MWI information over SMDI ==========================
86 ===============================================================================
88 Another change has been made to ensure that MWI state is properly propagated
89 over the SMDI link. This replaces the use of externnotify=smdi for
90 voicemail.conf. The issue is that we have to poll mailboxes occasionally for
91 changes that were made using an IMAP client. So, this ability was added to
92 res_smdi. To configure this, there is a new section in smdi.conf. It looks
96 ; This section configures parameters related to MWI handling for the SMDI link.
98 ; This option configures the polling interval used to check to see if the
99 ; mailboxes have any new messages. This option is specified in seconds.
100 ; The default value is 10 seconds.
104 ; Before specifying mailboxes, you must specify an SMDI interface. All mailbox
105 ; definitions that follow will correspond to that SMDI interface. If you
106 ; specify another interface, then all definitions following that will correspond
107 ; to the new interface.
109 ; Every other entry in this section of the configuration file is interpreted as
110 ; a mapping between the mailbox ID on the SMDI link, and the local Asterisk
111 ; mailbox name. In many cases, they are the same thing, but they still must be
112 ; listed here so that this module knows which mailboxes it needs to pay
116 ; <SMDI mailbox ID>=<Asterisk Mailbox Name>[@Asterisk Voicemail Context]
118 ; If no Asterisk voicemail context is specified, "default" will be assumed.
122 ;2565551234=1234@vmcontext1
123 ;2565555678=5678@vmcontext2
127 ===============================================================================
128 ===============================================================================
129 ===============================================================================