The application-specific data part of the message follows the header. The application is free to shape and size the data in the way it chooses within system-imposed limits. For every different type of data received, there may be a corresponding structure and unique message id. A complete set of messages to be received can be represented in C-language by a union of message structures as shown in the following example from a stock application.
/* Define all message structures that can be received. */
struct stockInfo {
struct mbhdr hd;
int stockId;
};
struct callerInfo {
struct mbhdr hd;
char callerName [30];
int callerId;
};
/* Define the union of all possible message structures that can be received.*/
union rcvMsg {
struct ms_univ u; /* standard message */
struct stockInfo stock;
struct callerInfo caller;
};
The example above shows the union of received message (rcvMsg). Note that this message structure is as large as the largest message expected in the application, thus it can be used to hold any message read. Similarly, the set of messages to be sent can be defined in another union.
The union example contains the message structure ms_univ, defined in mesg.h, that consists of four long integers as shown in the following example.
/* universal structure for passing a message */
struct ms_univ {
struct mbhdr hd;
long arg[4];
};
At this point, you should have defined the data to be passed between the DIP and the TSM script. Proceed to Step 2: Initialize the DIP to the System to add the C-code that initializes your DIP to the voice system.