public override async Task OnEnteringState()
{
Context.SendToPeer(RelayMessageTags.VoipHangup, "");
if (Context.PeerConnection != null)
{
Context.PeerConnection.Close();
Context.PeerConnection = null;
Context.PeerId = null;
}
StopTracks(Context.LocalStream?.GetTracks());
Context.LocalStream?.Stop();
Context.LocalStream = null;
StopTracks(Context.RemoteStream?.GetTracks());
Context.RemoteStream?.Stop();
Context.RemoteStream = null;
Context.ResetRenderers();
var idleState = new VoipState_Idle();
await Context.SwitchState(idleState);
}