| C# | Visual Basic | Visual 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); }
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 you set WaitForCallerID property to false, your application can use CallInfo event to receive notification when Caller ID information becomes available.
| In Windows Forms application 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 controls from the event handler without using Invoke mechanism. |
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
Assembly: Traysoft.AddTapi (Module: Traysoft.AddTapi)