C# Application attempting to use TAPI with a Toshiba CIX

0

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");
        }
c#
phone-call
tapi
asked on Stack Overflow Nov 10, 2011 by bigphildogg86 • edited Aug 22, 2017 by Vadim Kotov

2 Answers

1

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

answered on Stack Overflow Aug 4, 2012 by Mostafa Shehata
0

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.

answered on Stack Overflow Feb 14, 2017 by Asif Ghanchi

User contributions licensed under CC BY-SA 3.0