TAPI_EVENT.TE_CALLINFOCHANGE 事件从未发生

发布于 2024-12-13 13:45:49 字数 1972 浏览 0 评论 0原文

我的过滤器包含下面的所有内容。我想在接到电话时查看每个事件。这些都发生了:

--- incoming call
callhub
callnotification
callstate
address
--- incoming call disconnected
callhub
callstate

我想获取来电显示。当线路连接到我的手机时,我可以看到被叫 ID。但它没有触发 TAPI_EVENT.TE_CALLINFOCHANGE 事件。

        tapiObj.EventFilter = (int)(TAPI_EVENT.TE_ACDGROUP |
                                     TAPI_EVENT.TE_ADDRESSDEVSPECIFIC |
                                     TAPI_EVENT.TE_AGENT |
                                     TAPI_EVENT.TE_AGENTHANDLER |
                                     TAPI_EVENT.TE_AGENTSESSION |
                                     TAPI_EVENT.TE_ASRTERMINAL |
                                     TAPI_EVENT.TE_CALLHUB |
                                     TAPI_EVENT.TE_CALLMEDIA |
                                     TAPI_EVENT.TE_DIGITEVENT |
                                     TAPI_EVENT.TE_FILETERMINAL |
                                     TAPI_EVENT.TE_GATHERDIGITS |
                                     TAPI_EVENT.TE_GENERATEEVENT |
                                     TAPI_EVENT.TE_PHONEDEVSPECIFIC |
                                     TAPI_EVENT.TE_PHONEEVENT |
                                     TAPI_EVENT.TE_PRIVATE |
                                     TAPI_EVENT.TE_QOSEVENT |
                                     TAPI_EVENT.TE_QUEUE |
                                     TAPI_EVENT.TE_REQUEST |
                                     TAPI_EVENT.TE_TAPIOBJECT |
                                     TAPI_EVENT.TE_TONEEVENT |
                                     TAPI_EVENT.TE_TONETERMINAL |
                                     TAPI_EVENT.TE_TTSTERMINAL |
                                     TAPI_EVENT.TE_ADDRESS |
                                     TAPI_EVENT.TE_CALLINFOCHANGE |
                                     TAPI_EVENT.TE_CALLSTATE |
                                     TAPI_EVENT.TE_CALLNOTIFICATION);

My filter is contains everything on below. I wanted to see every event while an incoming phone call. And these are happened:

--- incoming call
callhub
callnotification
callstate
address
--- incoming call disconnected
callhub
callstate

I want to get caller id. I can see the called id while line connected to my phone. But it is not firing TAPI_EVENT.TE_CALLINFOCHANGE event.

        tapiObj.EventFilter = (int)(TAPI_EVENT.TE_ACDGROUP |
                                     TAPI_EVENT.TE_ADDRESSDEVSPECIFIC |
                                     TAPI_EVENT.TE_AGENT |
                                     TAPI_EVENT.TE_AGENTHANDLER |
                                     TAPI_EVENT.TE_AGENTSESSION |
                                     TAPI_EVENT.TE_ASRTERMINAL |
                                     TAPI_EVENT.TE_CALLHUB |
                                     TAPI_EVENT.TE_CALLMEDIA |
                                     TAPI_EVENT.TE_DIGITEVENT |
                                     TAPI_EVENT.TE_FILETERMINAL |
                                     TAPI_EVENT.TE_GATHERDIGITS |
                                     TAPI_EVENT.TE_GENERATEEVENT |
                                     TAPI_EVENT.TE_PHONEDEVSPECIFIC |
                                     TAPI_EVENT.TE_PHONEEVENT |
                                     TAPI_EVENT.TE_PRIVATE |
                                     TAPI_EVENT.TE_QOSEVENT |
                                     TAPI_EVENT.TE_QUEUE |
                                     TAPI_EVENT.TE_REQUEST |
                                     TAPI_EVENT.TE_TAPIOBJECT |
                                     TAPI_EVENT.TE_TONEEVENT |
                                     TAPI_EVENT.TE_TONETERMINAL |
                                     TAPI_EVENT.TE_TTSTERMINAL |
                                     TAPI_EVENT.TE_ADDRESS |
                                     TAPI_EVENT.TE_CALLINFOCHANGE |
                                     TAPI_EVENT.TE_CALLSTATE |
                                     TAPI_EVENT.TE_CALLNOTIFICATION);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妄想挽回 2024-12-20 13:45:49

最近我在做tapi。这是示例代码......

 cn=new callnotification();
 tobj.ITTAPIEventNotification_Event_Event+= new 
 TAPI3Lib.ITTAPIEventNotification_EventEventHandler(cn.Event);
  tobj.EventFilter = (int)(TAPI_EVENT.TE_CALLNOTIFICATION | TAPI_EVENT.TE_REQUEST | 
             TAPI_EVENT.TE_CALLINFOCHANGE |
                TAPI_EVENT.TE_DIGITEVENT|
                TAPI_EVENT.TE_PHONEEVENT|
                TAPI_EVENT.TE_CALLSTATE|
                TAPI_EVENT.TE_GENERATEEVENT|
                TAPI_EVENT.TE_CALLINFOCHANGE |TAPI_EVENT.TE_ADDRESS
                );



class callnotification:TAPI3Lib.ITTAPIEventNotification
{
    public delegate void listshow(string str);
    public listshow addtolist;
    string callerid;


    public void Event(TAPI3Lib.TAPI_EVENT te,object eobj)
    {
        switch(te)
        {

            case TAPI3Lib.TAPI_EVENT.TE_DIGITEVENT:
                TAPI3Lib.ITDigitDetectionEvent dd=(TAPI3Lib.ITDigitDetectionEvent)eobj;
                addtolist("Dialed digit"+dd.ToString());
                break;
            case TAPI3Lib.TAPI_EVENT.TE_GENERATEEVENT:
                TAPI3Lib.ITDigitGenerationEvent dg=(TAPI3Lib.ITDigitGenerationEvent)eobj;
                MessageBox.Show("digit dialed!");
                addtolist("Dialed digit"+dg.ToString());
                break;
            case TAPI3Lib.TAPI_EVENT.TE_PHONEEVENT:
                addtolist("A phone event!");
                break;
            case TAPI3Lib.TAPI_EVENT.TE_GATHERDIGITS:
                addtolist("Gather digit event!");
                break;
            case TAPI3Lib.TAPI_EVENT.TE_CALLSTATE:
                TAPI3Lib.ITCallStateEvent a=(TAPI3Lib.ITCallStateEvent)eobj;
                TAPI3Lib.ITCallInfo b=a.Call;

                try
                {
                    callerid = b.get_CallInfoString(CALLINFO_STRING.CIS_CALLEDIDNUMBER);

                    addtolist("Successfully Disconnect");

                }
                catch (Exception e)
                {

                    addtolist(e.Message);
                }

            switch(b.CallState)
            {
                case TAPI3Lib.CALL_STATE.CS_INPROGRESS:
                    addtolist("INPROGRESS" );  
                                            break;
                case TAPI3Lib.CALL_STATE.CS_DISCONNECTED:
                    addtolist("Disconnected");
                    break;
                case TAPI3Lib.CALL_STATE.CS_OFFERING:
                    addtolist("A party wants to communicate with you!");
                    break;
                case TAPI3Lib.CALL_STATE.CS_IDLE:
                    addtolist("Call is created!");
                    break;

            }
            break;
            case TAPI3Lib.TAPI_EVENT.TE_CALLNOTIFICATION: 
                addtolist("call notification event has occured");
                 break;
        }
    }
}

Recently i worked on tapi. Here is the sample code.....

 cn=new callnotification();
 tobj.ITTAPIEventNotification_Event_Event+= new 
 TAPI3Lib.ITTAPIEventNotification_EventEventHandler(cn.Event);
  tobj.EventFilter = (int)(TAPI_EVENT.TE_CALLNOTIFICATION | TAPI_EVENT.TE_REQUEST | 
             TAPI_EVENT.TE_CALLINFOCHANGE |
                TAPI_EVENT.TE_DIGITEVENT|
                TAPI_EVENT.TE_PHONEEVENT|
                TAPI_EVENT.TE_CALLSTATE|
                TAPI_EVENT.TE_GENERATEEVENT|
                TAPI_EVENT.TE_CALLINFOCHANGE |TAPI_EVENT.TE_ADDRESS
                );



class callnotification:TAPI3Lib.ITTAPIEventNotification
{
    public delegate void listshow(string str);
    public listshow addtolist;
    string callerid;


    public void Event(TAPI3Lib.TAPI_EVENT te,object eobj)
    {
        switch(te)
        {

            case TAPI3Lib.TAPI_EVENT.TE_DIGITEVENT:
                TAPI3Lib.ITDigitDetectionEvent dd=(TAPI3Lib.ITDigitDetectionEvent)eobj;
                addtolist("Dialed digit"+dd.ToString());
                break;
            case TAPI3Lib.TAPI_EVENT.TE_GENERATEEVENT:
                TAPI3Lib.ITDigitGenerationEvent dg=(TAPI3Lib.ITDigitGenerationEvent)eobj;
                MessageBox.Show("digit dialed!");
                addtolist("Dialed digit"+dg.ToString());
                break;
            case TAPI3Lib.TAPI_EVENT.TE_PHONEEVENT:
                addtolist("A phone event!");
                break;
            case TAPI3Lib.TAPI_EVENT.TE_GATHERDIGITS:
                addtolist("Gather digit event!");
                break;
            case TAPI3Lib.TAPI_EVENT.TE_CALLSTATE:
                TAPI3Lib.ITCallStateEvent a=(TAPI3Lib.ITCallStateEvent)eobj;
                TAPI3Lib.ITCallInfo b=a.Call;

                try
                {
                    callerid = b.get_CallInfoString(CALLINFO_STRING.CIS_CALLEDIDNUMBER);

                    addtolist("Successfully Disconnect");

                }
                catch (Exception e)
                {

                    addtolist(e.Message);
                }

            switch(b.CallState)
            {
                case TAPI3Lib.CALL_STATE.CS_INPROGRESS:
                    addtolist("INPROGRESS" );  
                                            break;
                case TAPI3Lib.CALL_STATE.CS_DISCONNECTED:
                    addtolist("Disconnected");
                    break;
                case TAPI3Lib.CALL_STATE.CS_OFFERING:
                    addtolist("A party wants to communicate with you!");
                    break;
                case TAPI3Lib.CALL_STATE.CS_IDLE:
                    addtolist("Call is created!");
                    break;

            }
            break;
            case TAPI3Lib.TAPI_EVENT.TE_CALLNOTIFICATION: 
                addtolist("call notification event has occured");
                 break;
        }
    }
}
余生再见 2024-12-20 13:45:49
Private Sub tapiGenerate_Event(ByVal sender As Object, _
       ByVal e As TapiDigitGenerationEventArgs) Handles MyTAPI.TE_GENERATEEVENT
        Label4.Text = "GENERATE EVENT"
    End Sub

Private Sub tapiSpecific_Event(ByVal sender As Object, _
  ByVal e As TapiAddressDeviceSpecificEventArgs) Handles MyTAPI.TE_ADDRESSDEVSPECIFIC
    Label4.Text = "ADDRESS EVENT"
End Sub

Private Sub tapiObject_Event(ByVal sender As Object, _
  ByVal e As TapiObjectEventArgs) Handles MyTAPI.TE_TAPIOBJECT
    Label4.Text = "TAPI OBJECT EVENT"
End Sub
Private Sub tapiDigit_Event(ByVal sender As Object, _
  ByVal e As TapiDigitDetectionEventArgs) Handles MyTAPI.TE_DIGITEVENT
        Label4.Text = "DIGIT EVENT"
    End Sub

你需要这些活动。我一开始也遇到过同样的问题。如果没有这些事件,CallInfo 将不会被触发。

抱歉,我也忘记了这一点:

Dim m_TAPI As New JulMar.Tapi3.TTapi
        m_TAPI.Initialize()
        MyTAPI = m_TAPI
        m_TAPI = Nothing
        For Each Phone As TPhone In MyTAPI.Phones
            For Each Address As TAddress In MyTAPI.Addresses()
                If Address.State = ADDRESS_STATE.AS_INSERVICE Then
                    If Address.AddressName.ToLower.StartsWith("cisco") Then
                        Try
                           Address.OpenAndMonitor(TAPIMEDIATYPES.AUDIO)
                        Catch ex As Exception
                            Address.Close()
                            Address.OpenAndMonitor(TAPIMEDIATYPES.AUDIO)
                        End Try
                        Label2.Text = Label2.Text & vbNewLine & Address.AddressName.ToLower & Address.State.ToString
                        If Address.AddressName.ToLower.Contains("6591") Then
                            TapiAddress = Address
                        End If
                    End If
                End If
            Next Address
        Next Phone

也需要触发。

 Address.OpenAndMonitor(TAPIMEDIATYPES.AUDIO)
Private Sub tapiGenerate_Event(ByVal sender As Object, _
       ByVal e As TapiDigitGenerationEventArgs) Handles MyTAPI.TE_GENERATEEVENT
        Label4.Text = "GENERATE EVENT"
    End Sub

Private Sub tapiSpecific_Event(ByVal sender As Object, _
  ByVal e As TapiAddressDeviceSpecificEventArgs) Handles MyTAPI.TE_ADDRESSDEVSPECIFIC
    Label4.Text = "ADDRESS EVENT"
End Sub

Private Sub tapiObject_Event(ByVal sender As Object, _
  ByVal e As TapiObjectEventArgs) Handles MyTAPI.TE_TAPIOBJECT
    Label4.Text = "TAPI OBJECT EVENT"
End Sub
Private Sub tapiDigit_Event(ByVal sender As Object, _
  ByVal e As TapiDigitDetectionEventArgs) Handles MyTAPI.TE_DIGITEVENT
        Label4.Text = "DIGIT EVENT"
    End Sub

You need these events. I have had the same issue in the beginning. Without these events CallInfo will not be triggered.

Sorry I also forgot this:

Dim m_TAPI As New JulMar.Tapi3.TTapi
        m_TAPI.Initialize()
        MyTAPI = m_TAPI
        m_TAPI = Nothing
        For Each Phone As TPhone In MyTAPI.Phones
            For Each Address As TAddress In MyTAPI.Addresses()
                If Address.State = ADDRESS_STATE.AS_INSERVICE Then
                    If Address.AddressName.ToLower.StartsWith("cisco") Then
                        Try
                           Address.OpenAndMonitor(TAPIMEDIATYPES.AUDIO)
                        Catch ex As Exception
                            Address.Close()
                            Address.OpenAndMonitor(TAPIMEDIATYPES.AUDIO)
                        End Try
                        Label2.Text = Label2.Text & vbNewLine & Address.AddressName.ToLower & Address.State.ToString
                        If Address.AddressName.ToLower.Contains("6591") Then
                            TapiAddress = Address
                        End If
                    End If
                End If
            Next Address
        Next Phone

Is needed also to trigger.

 Address.OpenAndMonitor(TAPIMEDIATYPES.AUDIO)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文