Compartir a través de


OnClientConnected Property

  Microsoft Speech Technologies Homepage

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

Usage

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

Remarks

The value of the OnClientConnected 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 the call is connected.

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

function FunctionName ( object sender , string CallID , string CallingDevice , string CalledDevice, object cstaMessageDomObject )
{
     // Client-side code referenced by AnswerCall.OnClientConnected 
}

Parameters

  • sender
    The client-side AnswerCall object.
  • CallID
    The ID of the current call.
  • networkCallingDevice
    The callers network device ID.
  • networkCalledDevice
    The recipients network device ID.
  • cstaMessageDomObject
    The Microsoft.SpeechServer.Dom.Results.Element object that contains the Smex message.

Return Value

None.

Example

The following example demonstrates an OnClientConnected routine that uses the CurrentCall object to get CallID, CalledDevice and CallingDevice properties of the call that has just been connected. In the OnClientConnected routine, these values are available as parameters, but other client-side routines can use the CurrentCall object to access any property of the CallInfo class. See Additional Client Scripting Elements for more information.

<script>
  function myClientConnected(obj, CallID, CallingDevice, CalledDevice, cstaMessageDomObject) {
    LogMessage("", "Call has been Connected: " + 
      RunSpeech.CurrentCall().Get("MonitorCrossRefID") + " - " + 
      RunSpeech.CurrentCall().Get("DeviceID") + " - " + 
      RunSpeech.CurrentCall().Get("CallID") + " - " +
      RunSpeech.CurrentCall().Get("CalledDevice") + " - " +
      RunSpeech.CurrentCall().Get("CallingDevice") );
    return true;
  }
</script>
<form id="Form1" method="post" runat="server">
  ...
  <speech:AnswerCall runat="server"
    ID="AnswerCall1" 
    autopostback="True"
    DeviceID="0"
    OnClientConnected="myClientConnected"/>
  ...
</form>

See Also

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