Partager via


Creating Speech Application Error Pages

  Microsoft Speech Technologies Homepage

Microsoft Speech Server (MSS) supports two types of error pages: application error pages and system error pages.

  • To respond to unexpected application errors, MSS provides a default application error page. Developers using the Speech Controls can take advantage of this default page with no additional work. They can also provide their own custom application error page.
  • To respond to unexpected system errors developers must create a custom system error page.

Application Error Pages

By default, when an application error occurs, the default application error page runs. However, if a developer creates and specifies a custom error page, when an application error occurs it is the custom error page that runs.

Using the Default Error Page or a Custom Error Page

The DefaultErrorPage.aspx file is installed by the Microsoft Speech Application SDK (SASDK) at \Inetpub\wwwroot\aspnet_speech\<build number>\client_script. The default application error page plays one of several text-to-speech (TTS) prompts, depending on the nature of the error.

  • If the quality of TTS messages is acceptable but different message text is needed, rename and edit the default application error page. It is best not to edit the default page itself because it is a resource used by all speech applications on the Web server.
  • If the quality of TTS messages is not adequate, replace the default page and its TTS prompts with a custom application error page containing QA controls that play recorded messages from the prompt database. The next section describes specifying a custom application error page.

Specifying a Custom Application Error Page

If a custom application error page is specified in Web.config, SES runs the custom page rather than the default application error page. To specify a custom application error page, use the appSettings tag, as shown in the following example.

<configuration>
    <appSettings>
        <add key="errorpage" value="ErrorPage.aspx" />
    </appSettings>
</configuration>

By default, the Web.config file is located in the application's root folder and is visible in the Solution Explorer window.

System Error Pages

Provide a system error page to prevent calls from disconnecting without warning in the event of an unexpected error that the platform cannot recover from, including the following:

  • Web server HTTP errors, such as 404 and 500 errors
  • Application page errors, such as a failure to create the Document Object Model or a failure to compile inline JScript code
  • JScript run-time errors
  • Problems with SES requests, such as SES becoming unavailable during a call

Specifying a System Error Page

There are two ways to specify the system error page: using the Microsoft Management Console (MMC) snap-in for MSS and using the error-page meta tag.

  • To specify the system error page in the MMC, use the Global Error Page URL setting. For more information, see Adding a Speech Application in the MSS Help file, MSS.chm.
  • To specify the system error page on an .aspx page, use a meta tag as shown in the following example.
<meta http-equiv="error-page" content="http://MyServer/MyApplication/SystemErrorPage.html"/>

The error page setting, whether made in the MMC or using the meta tag, specifies the error page that is stored in the cache. Only one system error page per SALT interpreter is stored in the cache. The setting persists until it is overridden. If the page is specified in the MMC, that setting lasts until a meta tag on an application page overrides it. The new setting persists until a different setting is encountered in a subsequent navigation.

Creating a System Error Page

The system error page should be designed so that it does not rely on external services such as SES and the Web server. To do this, record error messages in .wav files and create the system error page using SALT elements in an .html file. See the following example.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:SALT="http://www.saltforum.org/2002/SALT">
<head>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">

<object id="Speechtags" CLASSID="clsid:DCF68E5B-84A1-4047-98A4-0A72276D19CC" VIEWASTEXT></object>
<?import namespace="salt" implementation="#Speechtags" ?>
<SALT:prompt id="SystemErrorPrompt">
  <SALT:content id="PromptContent" href="http://myServer/SystemError.wav" />
</SALT:prompt>

<script language=jscript>
function fnOnLoad()
{
  SystemErrorPrompt.Start();
}
</script>

</head>
<body onload="fnOnLoad()">
</body>
</html>

The .wav file must be 8-kHz mono a-law or mu-law compressed audio. The choice between a-law or mu-law depends on the telephony standard of the locale where it is used. Store the system error page on the Web server.

Conclusion

Use the described techniques to specify and create application and system error pages. Remember that system and application error pages have different scopes, respond to different types of errors, are specified separately, and have different formats (one is .aspx and the other is .htm).

See Also

Creating Error Pages for Multi-Language Applications | Creating Speech-Enabled Web Pages