Compartir a través de


Raising Events from Application Script

  Microsoft Speech Technologies Homepage

To raise events from speech application script, use any of the following events from the Microsoft Speech Server (MSS) event-logging schema. Adding scriptable events to an application permits using the log analysis tools to filter calls based on which callers completed various tasks. This allows analysts, for example, to focus more quickly on calls where callers failed to complete specific tasks.

The event-logging schema contains over ninety event classes. The eight classes listed below are the scriptable classes. The other events are raised by MSS and logged or ignored according to the event logging settings. Use the MSSLogConfig command-line tool to configure event logging. For information on configuring event logging, see the log analysis Help file (LogAnalysis.chm), which ships with Speech Application Log Analysis Tools on the Microsoft Speech Application SDK (SASDK) CD.

Event Class Description
ErrorMessage ErrorMessage provides a way for SALT application developers to send an entry to the Windows Event log for error-level events.
WarningMessage WarningMessage provides a way for SALT application developers to send an entry to the Windows Event log for warning-level events.
InformationalMessage InformationalMessage provides a way for SALT application developers to send an entry to the Windows Event log for informational-level events.
TaskStart A task is defined by the name it is given in the TaskStart event. TaskStart provides a way for SALT application developers to send an event to the Trace log when an application attempts to initiate the defined task.
TaskProgress TaskProgress defines a way for SALT application developers to send an event to the Trace log that records the progress of a defined application task.
TaskComplete TaskComplete provides a way for SALT application developers to send an event to the Trace log when an application completes a defined task.
DebugMessage DebugMessage provides a way for SALT application developers to send application-specific messages to the Trace log in a debug environment.
TraceMessage TraceMessage defines a way for SALT application developers to send an application-specific message to the Trace log in a production environment.

Note  The log analysis reports will work best when each TaskStart event has a corresponding TaskComplete event, and vice-versa. Mismatched task events are poor practice and may skew report data.

The SALT LogMessage function is also available to log application events from script.

When a speech application is running in the SASDK, the scriptable events are raised on the development computer and messages appear in the Output pane of Speech Debugging Console. When a speech application is deployed and running in a production environment these events occur in the client, Telephony Application Services (TAS); and event text is recorded on the TAS computer in the event logs and .etl files. The same thing is true with messages from the LogMessage function: in the SASDK messages appear in the Output pane of Speech Debugging Console, while in a production environment messages appear on the TAS computer.

Examples

See the following example code using LogMessage and the scriptable events.

import Microsoft.SpeechServer.Messages;     
function QA1OnClientActive()
  {
    LogMessage("msgid_3", "Prompt database is unavailable.")
    ErrorMessage.Raise("Call Center application error: unable to open the database with the name DB554433. No calls can be taken.")
    WarningMessage.Raise("Call Center application warning: unable to open database with the name DB554433. The local data cache was used instead.")
    InformationalMessage.Raise("Call Center application: used the database with the name DB554433.")
    TaskStart.Raise("Account update")
    TaskProgress.Raise("my task name", "my progress message", "additional progress data here")
    TaskComplete.Raise("Account update", "= committed")
    DebugMessage.Raise("Executing database query for account balance.")
    TraceMessage.Raise("GetBalance() start: args: acctid=112233445566") 
    return true;
  }

The preceding sample code produces the following output in the Output pane of Speech Debugging Console.

SALT LogMessage (msgid_3): Prompt database is unavailable.
Application error: Call Center application error: unable to open the database with the name DB554433.  No calls can be taken.
Application warning: Call Center application warning: unable to open database with the name DB554433. The local data cache was used instead.
Application informational: Call Center application: used the database with the name DB554433.
Task Account update: started
Task my task name: my progress message
Task Account update: completed in state = committed
Script debug: Executing database query for account balance.
Script trace: GetBalance() start: args: acctid=112233445566

Conclusion

For more information on the event classes and the event schema see the log analysis Help file (LogAnalysis.chm), which ships with Speech Application Log Analysis Tools on the SASDK CD. The Speech Application Log Analysis Tools provide powerful task-centered reporting and analysis functionality which can be extremely useful in tuning a pilot application and monitoring the performance and usage of an application after it is deployed. For updated information on event logging, see additional logging topics on the Speech Web site.

See Also

Logging and Analysis Features