AddTapi.NET Developer's Manual
CallInfo Event
NamespacesTraysoft.AddTapiTapiAppCallInfo
Occurs when the call information about a call has changed.
Declaration Syntax
C#Visual BasicVisual C++
public static event TapiCallInfoEventHandler CallInfo
Public Shared Event CallInfo As TapiCallInfoEventHandler
public:
static  event TapiCallInfoEventHandler^ CallInfo {
	void add (TapiCallInfoEventHandler^ value);
	void remove (TapiCallInfoEventHandler^ value);
}
Remarks

This event is fired when a telephony service provider reports that the call information has changed. Use CallInfoState property to find out which call information item(s) has changed.

CallInfo event can be fired before AddTapi.NET reports a new call using IncomingCall or OutgoingCall event. Most applications do not need to handle CallInfo event. AddTapi.NET automatically updates TapiCall object with new call information when needed. If the WaitForCallerID property is set to false, the application can use CallInfo event to receive notification when Caller ID information becomes available.

Note:
In Windows Forms and WPF applications AddTapi.NET executes the handler of this event on the main thread of the application (the thread that called Initialize(String)). It is safe to access Windows Forms or WPF controls from the event handler without using Invoke mechanism.
Examples
The following code shows how to handle CallInfo event.

C#

            TapiApp.Initialize("MyApp");
            TapiApp.CallInfo += OnCallInfo;
            ...
            
            void OnCallInfo(object sender, TapiCallInfoEventArgs args)
            {
                // Check if caller id is available and display to the user
                if ((args.CallInfoState & TapiCallInfoState.CallerID) != 0)
                {
                   Console.WriteLine("CallerID={0}, CallerIDName={1}", args.Call.CallerID, args.Call.CallerIDName);
                }
            }
            

VB.NET

            TapiApp.Initialize("MyApp")
            AddHandler TapiApp.CallInfo, AddressOf OnCallInfo
            ...
            
            Private Sub OnCallInfo(ByVal sender As Object, ByVal args As TapiCallInfoEventArgs)
                ' Check if caller id is available and display to the user
                If args.CallInfoState And TapiCallInfoState.CallerID Then
                    Console.WriteLine("CallerID={0}, CallerIDName={1}", args.Call.CallerID, args.Call.CallerIDName)
                End If
            End Sub
            
See Also

Assembly: Traysoft.AddTapi (Module: Traysoft.AddTapi)