Occurs when a new incoming call is received.
| C# | Visual Basic | Visual C++ |
public static event TapiEventHandler IncomingCall
Public Shared Event IncomingCall As TapiEventHandler
public: static event TapiEventHandler^ IncomingCall { void add (TapiEventHandler^ value); void remove (TapiEventHandler^ value); }
This event occurs when a new incoming call is received on the open line. After a new incoming call is detected,
AddTapi.NET waits up to 3 seconds for Caller ID information to arrive before firing this event.
Set WaitForCallerID property to false if you want AddTapi.NET to fire this event immediately after a new call is detected.
| 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. |
The following code shows how to process IncomingCall event.
C#
TapiApp.Initialize("MyApp");
TapiApp.IncomingCall += OnIncomingCall;
...
void OnIncomingCall(object sender, TapiEventArgs args)
{
// Display a message to the user
Console.WriteLine("Incoming call from {0} on line {1}", args.Call.CallerID, args.Line.Name);
}
VB.NET
TapiApp.Initialize("MyApp")
AddHandler TapiApp.IncomingCall, AddressOf OnIncomingCall
...
Private Sub OnIncomingCall(ByVal sender As Object, ByVal args As TapiEventArgs)
' Display a message to the user
Console.WriteLine("Incoming call from {0} on line {1}", args.Call.CallerID, args.Line.Name)
End Sub
Assembly: Traysoft.AddTapi (Module: Traysoft.AddTapi)