khernandez
Systems Engineer
Hi everyone,
I am developing a C# system using tapi3 for playing wav files on a created call, and I would like to know why is it that my code is not working, i can create and answer to calls but when I want to play the audio file there's an error, this is the code snippet for playing the wavs:
TAPI3Lib.ITAddress ln = null;
ln = ia[line]; // ia -> an array of ITAddresses, line -> the array position for the specified line item to make the call
ITBasicCallControl2 basicCallControl2 = (ITBasicCallControl2)bcc;
var terminal = basicCallControl2.RequestTerminal(TapiConstants.CLSID_String_FilePlaybackTerminal,
TapiConstants.TAPIMEDIATYPE_AUDIO, TERMINAL_DIRECTION.TD_CAPTURE);
ITMediaPlayback mediaPlayback = (ITMediaPlayback)terminal;
object[] wavList = new object[2];
wavList[0] = "test.wav";
mediaPlayback.PlayList = wavList;
ITMediaControl mediaControl = (ITMediaControl)mediaPlayback;
MessageBox.Show(mediaControl.MediaState.ToString());
mediaControl.Start();
The red line is where is giving the error "specified cast is not valid", I have tested some examples from internet and they give the same type of error when happens the conversion between ITBasicControl2 interface and ITerminal interface, found a managed code in c++ for handling the tapi3 SDK and when I debugged, the same type of error was occurring giving an HRESULT negative code, when I googled it it was a code of type "no supported interface".
The weird part came when I tested the same code pasted above on a Windows XP virtual machine, the "specified cas is not valid" error didn't jump, but the audio still did not play.
I have configured the Avaya tapi3 driver correctly because the call control works fine, it's only the audio part that is not working. Also the IPO user I use for the tests is a wave user ("user name starts with TAPI:"), and I have a waver user license active.
You can request any resource if needed for solving this problem.
Any help is really appreciated. Thank you.
I am developing a C# system using tapi3 for playing wav files on a created call, and I would like to know why is it that my code is not working, i can create and answer to calls but when I want to play the audio file there's an error, this is the code snippet for playing the wavs:
TAPI3Lib.ITAddress ln = null;
ln = ia[line]; // ia -> an array of ITAddresses, line -> the array position for the specified line item to make the call
ITBasicCallControl2 basicCallControl2 = (ITBasicCallControl2)bcc;
var terminal = basicCallControl2.RequestTerminal(TapiConstants.CLSID_String_FilePlaybackTerminal,
TapiConstants.TAPIMEDIATYPE_AUDIO, TERMINAL_DIRECTION.TD_CAPTURE);
ITMediaPlayback mediaPlayback = (ITMediaPlayback)terminal;
object[] wavList = new object[2];
wavList[0] = "test.wav";
mediaPlayback.PlayList = wavList;
ITMediaControl mediaControl = (ITMediaControl)mediaPlayback;
MessageBox.Show(mediaControl.MediaState.ToString());
mediaControl.Start();
The red line is where is giving the error "specified cast is not valid", I have tested some examples from internet and they give the same type of error when happens the conversion between ITBasicControl2 interface and ITerminal interface, found a managed code in c++ for handling the tapi3 SDK and when I debugged, the same type of error was occurring giving an HRESULT negative code, when I googled it it was a code of type "no supported interface".
The weird part came when I tested the same code pasted above on a Windows XP virtual machine, the "specified cas is not valid" error didn't jump, but the audio still did not play.
I have configured the Avaya tapi3 driver correctly because the call control works fine, it's only the audio part that is not working. Also the IPO user I use for the tests is a wave user ("user name starts with TAPI:"), and I have a waver user license active.
You can request any resource if needed for solving this problem.
Any help is really appreciated. Thank you.