I have a C# Tapi application which I'm developing to send from the computer to the Toshiba CIX tapi commands which route to the phones. The line itself isn't important as that part is working. I am able to dial the phone from the application. However answering and hanging up are not working correctly. When I try to disconnct I get this error:
This implementation doesn't take advises (Exception from HRESULT: 0x80040003 (OLE_E_ADVISENOTSUPPORTED))
And when I try to answer I get:
Unable to cast COM object of type 'System.__ComObject' to interface type 'TAPI3Lib.ITBasicCallControl'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B1EFC389-9355-11D0-835C-00AA003CCABD}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
My app is based on: http://www.codeproject.com/KB/IP/devangpro.aspx I did have to make a delegate for adding items to the listbox because of a crossthread problem in order to get the app on codeproject to at least run correctly.
Here is the disconnect:
IEnumCall ec = ia[line].EnumerateCalls();
uint arg = 0;
ITCallInfo ici;
try
{
ec.Next(1,out ici,ref arg);
ITBasicCallControl bc=(ITBasicCallControl)ici;
bc.Disconnect(DISCONNECT_CODE.DC_NORMAL);
ici.ReleaseUserUserInfo();
}
catch(Exception exp)
{
MessageBox.Show("No call to disconnect!","TAPI3");
}
And here is the answer:
IEnumCall ec = ia[line].EnumerateCalls();
uint arg=0;
ITCallInfo ici;
try
{
ec.Next(1,out ici,ref arg);
ITBasicCallControl bc=(TAPI3Lib.ITBasicCallControl)ici;
if(!reject)
{
bc.Answer();
}
else
{
bc.Disconnect(DISCONNECT_CODE.DC_REJECTED);
ici.ReleaseUserUserInfo();
}
}
catch(Exception exp)
{
MessageBox.Show("There may not be any calls to answer! \n\n"+exp.ToString(),"TAPI3");
}
I change tapimediatype from audio to datamodem because I want only to see caller id in my application and it work the cause of problem may be that your modem doesn't support audio so you must change tapimediatype to another type
i was facing the same issue in my project and i had lots of search on it but does not found anything, issue was with my code this error only occur when you doing any operation without selecting any tapi line(devices).
it seems you did not select any TAPI line to make any operation.
User contributions licensed under CC BY-SA 3.0