2017-01-16 39 views
0

我想连接到它连接到另一台pc的Tapi,但IENumAddress返回null。我如何指定服务器的IP?连接到TAPI 3

tobj = new TAPIClass(); 
      tobj.Initialize(); 
      IEnumAddress ea=tobj.EnumerateAddresses(); 
      ITAddress ln; 
      uint arg3=0; 
      lines=0; 

      cn=new callnotification(); 
      cn.addtolist=new callnotification.listshow(this.status); 
      tobj.ITTAPIEventNotification_Event_Event+= new TAPI3Lib.ITTAPIEventNotification_EventEventHandler(cn.Event); 
      tobj.EventFilter=(int)(TAPI_EVENT.TE_CALLNOTIFICATION| 
       TAPI_EVENT.TE_DIGITEVENT| 
       TAPI_EVENT.TE_PHONEEVENT| 
       TAPI_EVENT.TE_CALLSTATE| 
       TAPI_EVENT.TE_GENERATEEVENT| 
       TAPI_EVENT.TE_GATHERDIGITS| 
       TAPI_EVENT.TE_REQUEST); 

      for(int i=0;i<10;i++) 
      { 
       ea.Next(1,out ln,ref arg3); 
       ia[i]=ln; 
       if(ln!=null) 
       { 
        comboBox1.Items.Add(ia[i].AddressName); 
        lines++; 
       } 
       else 
        break; 
      } 

在此行中我有问题

IEnumAddress ea=tobj.EnumerateAddresses(); 
+0

要小心直接从.NET使用TAPI功能,它不能很好地与自动生成的COM互操作层以及特定对象的发布方式一起使用。有时它可以正常工作,而不会出现朦胧的问题,这取决于所使用的基础TAPI驱动程序和电话系统。 –

+0

你有什么样的pbx?在代码之前,您需要安装tsp提供程序。 –

回答

1

您不能:TAPI应用程序和TSP(= TAPI服务提供商又名TAPI的驱动程序)必须在同一台服务器上。