Add new message type (WISe only)
In the Auron WISe, you can add custom message types. A message type has a set of properties distinct from other message types. Messages are the central data structure in the Auron WISe. Message are sent or received by channels and processed by triggers.
While the Auron SMS Server comes with a fixed set of message types, you can add your own custom message types to the Auron WISe.
Please note that to add a new message type requires some technical knowledge. If you are unsure how to do this, feel free to contact us.
For the remainder of this article we’ll assume that you’re able and authorized to connect to the Auron WISe server and database.
Message_Types table
Add a new message type to the Auron WISe by adding a new record to the Message_Types table. You’ll also need to add a data table to the WISe message database and archive database. Here’s a relation diagram:

These are the fields in the Message_Types table:
| Field name | Description |
|---|---|
| ID | Primary key and identifier. Must be an all caps string without spaces, no longer than 32 characters. For example: ‘CUSTOM_CHANNEL_TYPE’. |
| DataTable | This is the name of the table that holds message type specific data. The message type data table links to the message table. The structure of the data table describes the message type specific fields. This table does not already exist and you’ll have to create it manually. Learn more about this below. |
| Description | The display name |
| InfoUrl | (Optional) Link to a URL with more information about this channel type |
| LongDescription | The full description |
| EditorPath | (Optional) This is the path to a specialized editor for the message properties. Leave it empty to use the default message property editor. When making an editor in .Net consider referring to ‘plugin.dll’. This is an assembly that’s packed with the WISe and exports the CMessageForm class. This class can help you setup a message form in the same style as the standard WISe message types. The WISe manager starts the editor with these arguments: /ID <Message ID> /REPLY (to reply to the message with ID) /FORWARD (to forward the message with ID) /EDIT (to edit the message with ID) With no arguments the intention is to create a new message. |
| ProgramId | (Optional) Refer to a custom COM object that wraps this message for use in triggers or other scripts. To create a COM wrapper, your COM object must have: ‘SetMessageObject’ which accepts one argument, the AxMmServer.Message object. ‘GetMessageObject’ which returns the AxMmServer.Message object. |
| HasAttachments | 1 if the message supports (binary) attachments. 0 if the message doesn’t. 0 has a slight performance benefit overall. |
| SupportReply | 1 if it makes sense to reply to a message of this type. 0 if it doesn’t. For example, it makes sense to reply to an e-mail. It doesn’t make sense to reply to an alarm message. |
| SupportForward | 1 if it makes sense to forward this message. 0 if it doesn’t. |
| Icon | (Optional) This binary field contains a binary dump of a 48×48 PNG image that represents the message type. To make a binary dump of an existing .png image use this SQL command: SELECT * FROM OPENROWSET(BULK N’C:\dir\filename.png’, SINGLE_BLOB) rs |
| DisplayOrder | The location of this message type in the new message dialog in the WISe manager. A lower number is nearer to the top. |
Data table
The data table is both the storage for your custom message fields as well as the structure definition for you custom message. When creating a data table only field field is required:
MessageID INT
The following SQL data types are supported in the data table:
- DATETIMEOFFSET, DATETIME; Date values; prefer DATETIMEOFFSET
- INT; Natural numbers
- FLOAT; Real numbers
- BIT; Boolean values
- NVARCHAR, VARCHAR; Strings; prefer NVARCHAR
Arch Data Table
You message data table needs to have a sibling in the archive database. The name must be the name of your data table prefixed with ‘Arch’. For example, if you message data table is called: ‘CustomMessage’ then the archive sibling must be: ‘ArchCustomMessage’.
Please note, if you’ve configured a separate archive database, you must create this table in the archive database. If the message database and archive database are the same then it doesn’t matter.
The arch data table must have the same fields as the DataTable.
Insert View (Optional)
Insert views are an optional optimization you can use to insert into both the message table and your data table at once without causing race conditions.
The insert view is a view that joins the massage table (Messages) with your data table. Since it’s not possible to insert into such a view you’ll have to setup an insert trigger.
You can setup this insert trigger automatically by calling the stored procedure: ‘CreateInsertTriggerForMessageView’ on the view.
Example
Find an example for how to setup a custom message type in the Auron Software GitHub.
To add a custom message type we can run the following statement:
INSERT INTO Message_Types(ID, Description, LongDescription, InfoUrl, DataTable,
EditorPath, ProgramId, HasAttachments, SupportReply, SupportForward, Icon, DisplayOrder)
VALUES (
'CUSTOM_MESSAGE_TYPE', -- ID
'Custom Message Type', -- Description
'', '', -- LongDescription, InfoUrl
'Messages_CustomMessage', -- DataTable
'"MsgCustomMessage.exe"', -- EditorPath
'', -- Program ID
1, 1, 1, -- HasAttachments, SupportReply, SupportForward
NULL, 1) -- Icon, DisplayOrder
Next we’ll need to create the data table as well as the archive data table. For this example we assume that we’re archiving in the message database.
CREATE TABLE Messages_CustomMessage
(
MessageID INT NOT NULL
, TestField NVARCHAR(255)
-- Other custom fields
, CONSTRAINT pk_Messages_CustomMessage_MessageID PRIMARY KEY (MessageID)
)
CREATE TABLE ArchMessages_CustomMessage
(
MessageID INT NOT NULL
, TestField NVARCHAR(255)
-- Other custom fields
, CONSTRAINT pk_ArchMessages_CustomMessage_MessageID PRIMARY KEY (MessageID)
)
Finally we can setup the insert view and insert view trigger for our own convenience.
CREATE VIEW InsertCustomMessage AS
SELECT * FROM Messages M
INNER JOIN Messages_CustomMessage D ON M.ID = D.MessageID
EXECUTE CreateInsertTriggerForMessageView @sViewName='InsertCustomMessage',
@sDataTable='Messages_CustomMessage',
@sTypeID='CUSTOM_MESSAGE_TYPE'
Reset service and restart manager
After adding a new message type you’ll need to restart both the Auron WISe service and manager to be able to use the new message type.
We can now add and process messages of our own custom message type.