private void SessionWindowName_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (this.AVSession != null && this.AVSession.IsActive)
{
if (this.AVSession.State == MyInviteSession.InviteState.INCOMING)
{
this.soundService.StopRingTone();
}
else if (this.AVSession.State == MyInviteSession.InviteState.INPROGRESS)
{
this.soundService.StopRingBackTone();
}
this.AVSession.HangUpCall();
}
if (this.ChatSession != null && this.ChatSession.IsActive)
{
this.ChatSession.HangUp();
}
lock (this.fileTransferSessions)
{
this.fileTransferSessions.ForEach((x) =>
{
if (x != null && x.IsActive)
{
x.HangUp();
}
});
}
}