TapiAppCallState Event |
Namespace: Traysoft.AddTapi
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 |
---|
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. |
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); }