internal void RaiseTranscriptRecorderSessionChanged(ConferenceSession conference) { NonBlockingConsole.WriteLine("Raising TranscriptRecorderSessionShutdown event. SessionId: {0}. ConferenceUri: {1}", this.SessionId.ToString(), (conference == null) ? "null" : conference.ConferenceUri); try { if (this.TranscriptRecorderSessionChanged != null) { TranscriptRecorderSessionChangedEventArgs args = new TranscriptRecorderSessionChangedEventArgs(this); this.TranscriptRecorderSessionChanged.Invoke(this, args); } } catch (Exception e) { NonBlockingConsole.WriteLine("Error: Exception occured in TranscriptRecorderSessionChanged(). Conference: {0}. {1}.", conference.ConferenceUri, e.ToString()); } }
void TranscriptRecorder_OnTranscriptRecorderSessionChanged(object sender, TranscriptRecorderSessionChangedEventArgs e) { NonBlockingConsole.WriteLine("TranscriptRecorder_OnTranscriptRecorderSessionChanged event. SessionId: {0}. ConversationId: {1}. ConferenceId: {2}", e.SessionId.ToString(), (e.Conversation == null) ? "null" : e.Conversation.Id, (e.Conference == null) ? "null" : e.Conference.ConferenceUri); TranscriptRecorderSession session = null; if ((e.Conversation != null) && (e.Conference != null) && _activeConversationSessions.TryGetValue(e.Conversation, out session)) { // Add TranscriptRecorderSession to conference table (if no entry for this Conference already exists) lock (s_lock) { if (!_activeConferenceSessions.ContainsKey(e.Conference)) { NonBlockingConsole.WriteLine("TranscriptRecorder_OnTranscriptRecorderSessionChanged: Adding TranscriptRecorderSession for Conference entry: {0}.", e.Conference.ConferenceUri); _activeConferenceSessions.Add(e.Conference, session); // If successfully added TranscriptRecorderSession to conference table, remove from conversation table if (_activeConversationSessions.ContainsKey(e.Conversation)) { NonBlockingConsole.WriteLine("TranscriptRecorder_OnTranscriptRecorderSessionChanged: Removing TranscriptRecorderSession for Conversation entry: {0}.", e.Conversation.Id); _activeConversationSessions.Remove(e.Conversation); } } } // lock } else { NonBlockingConsole.WriteLine("[Warn] TranscriptRecorder_OnTranscriptRecorderSessionChanged called on invalid Conversation or Conference. Ignoring event."); } }