0
Answer

TAPI play wav

ariel rubynstein

ariel rubynstein

12y
3.4k
1
hi all
i am developing a TAPI server-client sln and trying to make a method to play a wav file to the phone

the 2 sample code i found both generating casting error when trying to create the ITTerminal interface
i am using this as attempt 1:
ITAddress lineAddress = myAddressAll[sta.Station];
ITCallInfo ici = (ITCallInfo)myCall;
ITTerminalSupport myTerminalSupport = (ITTerminalSupport)lineAddress;
ITTerminal myTerminalForPlayback = myTerminalSupport.CreateTerminal(TapiConstants.CLSID_String_FilePlaybackTerminal,                   TapiConstants.TAPIMEDIATYPE_AUDIO,
TERMINAL_DIRECTION.TD_CAPTURE);
ITMediaPlayback myMedia = (ITMediaPlayback)myTerminalForPlayback;               

object[] filelist = new object[2];

filelist[0] = "s:/lion2.wav";

myMedia.PlayList = filelist;

ITBasicCallControl2 myCallControl2 = (ITBasicCallControl2)myCall;

myCallControl2.SelectTerminalOnCall(myTerminalForPlayback);

ITMediaControl myMediaControl = (ITMediaControl)myTerminalForPlayback;

 myMediaControl.Start();



the highlighet line is where the error occurs
another try is like this:
ITAddress lineAddress = myAddressAll[sta.Station];
ITCallInfo ici = (ITCallInfo)myCall;
ITBasicCallControl2 myCallControl2 = (ITBasicCallControl2)ici;
ITTerminal playbackTerminal = myCallControl2.RequestTerminal(TapiConstants.CLSID_String_FilePlaybackTerminal,
TapiConstants.TAPIMEDIATYPE_AUDIO,
TERMINAL_DIRECTION.TD_CAPTURE);

both are "specific cast is not valid", about the ITTerminal

any help?
(even with payment?)
[email protected]

ariel