Re: COM Exception during SelectTerminalOnCall from C#
- From: "Matthias Moetje [MVP]" <moetje@xxxxxxxxxxxxxxxxxxx>
- Date: Sat, 25 Nov 2006 00:40:44 +0100
Chip,
Regarding TAPI and .NET see KB article "841712 - Telephony Application
Programming Interface (TAPI) functionality is not supported from managed
code".
For TAPI3 you should consider using Julmar's ITAPI3 wrapper for .NET.
It is very close to the TAPI3 interface:
http://www.julmar.com/blog/mark/PermaLink,guid,d503a167-04e4-4e88-9218-6deeae20d9ea.aspx
Regarding your actual problem I would suggest to go the
"classic route" for selecing a terminal instead of using the
"shortcut" version:
Enumerate all streams of a call (to see if there are any streams
present at all) and find the correct stream (match media type
and direction). Then select the terminal on the stream.
My guess is that there are no streams available (does the
TSP support audio?) but it could also be a .NET problem.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
"Chip Boling" <cboling@xxxxxxxx> wrote in message
news:cc5d8$456711ac$45493c94$24547@xxxxxxxxxxxxxx
I have recieved an error during a call to SelectTerminalOnCall that has
been posted on various newsgroups. They have been useful to get to where I
am currently at but I think I am stuck for the time being. In most of the
posts or blogs, the problem appears to be solvable but I am unable to
determine what the programmers did to solve the problem.
In the C# application, I am trying to answer the call and play a WAV file.
When the program reaches the call to 'SelectTerminalOnCall', it throws the
following exception:
2006-11-24 08:37:37,856 ERROR - bcs.tapi - Call.ReadyPlayTerminal: ***
EXCEPTION ***
System.Runtime.InteropServices.COMException (0x80004005): Unspecified
error
at TAPI3Lib.ITBasicCallControl2.SelectTerminalOnCall(ITTerminal
pTerminal)
at api.Call.ReadyPlayTerminal() in c:\source\tapicall.cs:line 513
Any help would be greatly appreciated. A copy of the code so far is below
and hopefully will help others get to at least this point.
- Chip Boling
-------------------------------------------
Note: m_CallControl was obtained from the Call property (ITCallInfo) of
the associated call notification event. A cleaned up section of code to
obtain it is below in case it is important.
ITCallNotificationEvent iEvent = (ITCallNotificationEvent)eventObj; <-
was the TAPI3Lib.TAPI_EVENT parameter in notification
ITCallInfo m_CallInfo = iEvent.Call;
Start of method with the problem is below:
-------------------------------------------
bool status = false;
ITBasicCallControl2 callControl2 = m_CallControl as ITBasicCallControl2;
if (callControl2 != null)
{
// request the terminal using right media type and direction
ITTerminal localTerm =
callControl2.RequestTerminal(TapiConstants.CLSID_String_FilePlaybackTerminal,
TapiConstants.TAPIMEDIATYPE_AUDIO,
TERMINAL_DIRECTION.TD_CAPTURE);
if (localTerm != null)
{
// prepare to put the file name
ITMediaPlayback mediaPlayback = localTerm as ITMediaPlayback;
if (mediaPlayback != null)
{
try
{
// Set the filename to play
object[] fileList = { "All Circuits Are Busy.wav" };
mediaPlayback.PlayList = fileList;
// Select the terminal
callControl2.SelectTerminalOnCall(localTerm);
// Answer the call
m_CallControl.Answer();
// Start playback.
ITMediaControl mediaControl = localTerm as ITMediaControl;
mediaControl.Start();
// Assign the terminal now terminal
m_PlayFileTerminal = localTerm;
status = true;
}
catch (Exception e)
{
if (Log.IsErrorEnabled)
{
Log.ErrorFormat("Call.ReadyPlayTerminal: *** EXCEPTION
*** {0}", e);
}
}
}
}
}
.
- Follow-Ups:
- Re: COM Exception during SelectTerminalOnCall from C#
- From: Chip Boling
- Re: COM Exception during SelectTerminalOnCall from C#
- References:
- COM Exception during SelectTerminalOnCall from C#
- From: Chip Boling
- COM Exception during SelectTerminalOnCall from C#
- Prev by Date: Re: How do I stop recording on disconnect w/ 3.1
- Next by Date: Re: TAPI and SetCommTimeouts
- Previous by thread: COM Exception during SelectTerminalOnCall from C#
- Next by thread: Re: COM Exception during SelectTerminalOnCall from C#
- Index(es):
Relevant Pages
|