2011-11-10 26 views
0

我有我開發從電腦發送到東芝CIX TAPI命令該路線的手機一個C#TAPI應用程序。線路本身並不重要,因爲該部分正在工作。我可以從應用程序撥打電話。但是,應答和掛斷不能正常工作。當我嘗試disconnct我得到這個錯誤:C#應用程序嘗試使用TAPI與東芝CIX

此實現不採取建議(從HRESULT異常:0x80040003(OLE_E_ADVISENOTSUPPORTED))

當我試着回答我得到:

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)).

我的應用程序基於: http://www.codeproject.com/KB/IP/devangpro.aspx 由於存在crossthread問題,爲了讓代碼項目上的應用程序至少正常運行,我必須做一個委託向項目列表添加項目。

這裏是斷開:

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"); 
     } 

這裏是答案:

 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"); 
     } 

回答

1

我改變tapimediatype從音頻到datamodem因爲我只想看到來電顯示在我的應用程序和它的工作 問題的原因可能是您的調制解調器不支持音頻,因此您必須將tapimediatype更改爲另一種類型

0

我正面臨相同的問題在我的項目中,我有很多的搜索,但沒有發現任何東西,問題是與我的代碼,這個錯誤只發生在你沒有選擇任何tapi線(設備)做任何操作。

看來你沒有選擇任何TAPI線路進行任何操作。

相關問題