Edit

Share via


Call.StateChanged Event

Definition

Raised when the state of the call changes.

public:
 event EventHandler<Microsoft::Rtc::Collaboration::CallStateChangedEventArgs ^> ^ StateChanged;
public event EventHandler<Microsoft.Rtc.Collaboration.CallStateChangedEventArgs> StateChanged;
member this.StateChanged : EventHandler<Microsoft.Rtc.Collaboration.CallStateChangedEventArgs> 
Public Custom Event StateChanged As EventHandler(Of CallStateChangedEventArgs) 

Event Type

Examples

The following example shows an implementation of a call StateChanged handler.

C# CallStateChanged on AudioVideoCall

_avCall1.StateChanged += this.CallStateChanged;

private void CallStateChanged(object sender, CallStateChangedEventArgs e)
{
    Call call = sender as Call;

    switch (e.State)
    {
        case CallState.Establishing:
            if (e.TransitionReason == CallStateTransitionReason.DeflectedToTeam)
            {
                Console.WriteLine("Call from {0} deflected to team.", call.RemoteEndpoint.Uri);
            }
            break;

        case CallState.Terminating:
            // TODO: Add clean up code here.
            break;
    }
}


Remarks

Raising of this event is serialized with other events of the Conversation."

Applies to