| Platform SDK: Web Telephony Engine | 
A TAPI 3.0 device supports a component called the media service provider (MSP) that controls the media stream for the device. The MSP provides a programming interface consisting of a set of COM objects that applications can use to control media transport during a call. You can access these objects from a WTE application by using scripts. For more information about the MSP, see Microsoft Telephony Overview.
An MSP object that is particularly useful in a WTE application is the Stream object. An application can use this object to retrieve information about a media stream, to start, pause, or stop the stream, and to select or unselect terminals on a stream. A WTE application can retrieve a collection of all currently available Stream objects by following these steps:
 To retrieve the Stream collection
To retrieve the Stream collection
The following example shows how to use VBScript to get the stream collection:
IIDStreamControl = "{EE3BD604-3868-11D2-A045-00C04FB6809F}"
Set myDispMapper = CreateObject("DispatchMapper.DispatchMapper.1")
Set myBasicCallControl = window.external.ITBasicCallControl
Set myStreamControl = myDispMapper.QueryDispatchInterface(IIDStreamControl, 
  myBasicCallControl)
Set myAllStreams=myStreamControl.Streams
For Each pITStream in myAllStreams
    stringOutput = "Found Stream: " & pITStream.MediaType
    MsgBox stringOutput
    window.external.LogCustomField.DefaultValue = stringOutput
    window.external.log()
    window.external.LogCustomField.DefaultValue = ""
    pITStream.StopStream
Next
The following example shows how to use JScript to get the stream collection:
IIDStreamControl = "{EE3BD604-3868-11D2-A045-00C04FB6809F}"; 
myDispMapper = new ActiveXObject("DispatchMapper.DispatchMapper.1");
myBasicCallControl = window.external.ITBasicCallControl;
myStreamControl = yDispMapper.QueryDispatchInterface(IIDStreamControl, 
  myBasicCallControl);
myAllStreams=myStreamControl.Streams; 
for (i = 1; i <= myAllStreams.Count; i++) {
    pITStream = myAllStreams.Item(i);
    stringOutput = "Stream is "+ typeof(pITStream);
    window.external.LogCustomField.DefaultValue=stringOutput;
    window.external.log();
    window.external.LogCustomField.DefaultValue = "";
    stringOutput = "Found Stream: " + pITStream.MediaType;
    window.external.LogCustomField.DefaultValue = stringOutput;
    window.external.log();
    window.external.LogCustomField.DefaultValue = "";
}