Click or drag to resize
TapiAppCallState Event
Occurs when the state of a call has changed.

Namespace: Traysoft.AddTapi
Assembly: Traysoft.AddTapi (in Traysoft.AddTapi.dll) Version: 6.0.0.1110
Syntax
public static event TapiEventHandler CallState

Value

Type: Traysoft.AddTapiTapiEventHandler
Remarks

This event is fired when a telephony service provider reports that the state of a call has changed. Use State property to obtain new state of the call.

CallState event can be fired before AddTapi.NET reports a new call using IncomingCall or OutgoingCall event. Most applications do not need to handle CallState event and should use IncomingCall, OutgoingCall, CallConnected and CallDisconnected events instead.

Note 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 CallState event.
TapiApp.Initialize("MyApp");
TapiApp.CallState += OnCallState;
...

void OnCallState(object sender, TapiEventArgs args)
{
    TapiCallState callState = args.Call.State;
    // Display a message to the user
    Console.WriteLine("Call on line {0} transitioned to {1} state", args.Line.Name, callState);
}
See Also