Partager via


OnClientFailed Property

  Microsoft Speech Technologies Homepage

Gets or sets the name of a client-side function that is called when the CSTA FAILED event is detected. Read/write.

Usage

ASP.NET markup: <speech:AnswerCall OnClientFailed="..." />
Get value: String = AnswerCall.OnClientFailed;
Set value: AnswerCall.OnClientFailed = String;
Data type: String
Required: No

Remarks

The value of the OnClientFailed property is the name of this custom client-side script function, without parameters or parentheses. The client-side dialog manager calls this function, using the following syntax, when CSTA returns a FAILED event.

The script block that contains this function should be placed before the control that calls the function. For more information, see "Placement of Script Blocks" in Authoring Notes.

Syntax

bool FunctionName ( object sender, string cause, object cstaMessageDomObject )
{
     // Client-side code referenced by AnswerCall.OnClientFailed 
}

Parameters

  • sender
    The client-side AnswerCall object.
  • cause
    The reason for failure returned from the telephony interface manager.
  • cstaMessageDomObject
    The Microsoft.SpeechServer.Dom.Results.Element object that contains the smex message.

Return Value

True if the dialog manager should continue on the same page, and False if it should navigate to the default error page.

Example

<script>
  function myClientConnected(obj, CallID, CallingDevice, CalledDevice, cstaMessageDomObject) {
    // OnClientConnected routine
    return true;
  }
  function myClientFailed(obj, status, cstaMessageDomObject) {
    // OnClientFailed routine
    return false;
  }
</script>
<form id="Form1" method="post" runat="server">
  ...
  <speech:AnswerCall runat="server"
    ID="AnswerCall1" 
    autopostback="True"
    CallingDevice="0"
    CalledDirectoryNumber="95551212"
    OnConnected="OnServerConnected"
    OnClientConnected="myClientConnected"
    OnClientFailed="myClientFailed" />
  ...
</form>

See Also

AnswerCall Class | AnswerCall Constructor | AnswerCall Members | AnswerCall Properties | AnswerCall Methods | AnswerCall Events | AnswerCall Remarks