One of the features of the ToolTalk service is callback support for messages, patterns, and filters. Callbacks are routines in your program that ToolTalk calls when a particular message arrives (message callback) or when a message matches a particular pattern you registered (pattern callback).
To tell the ToolTalk service about these callbacks, add the callback to a message or pattern before you send the message or register the pattern.