public TranscriptRecorderSession(ConferenceInvitationReceivedEventArgs e, CancellationTokenSource cts = null) { _sessionId = Constants.NextGuid(); _transcriptRecorders = new List<MediaTranscriptRecorder>(); _conversationToCallTranscriptMapping = new Dictionary<ConversationTranscriptRecorder, List<MediaTranscriptRecorder>>(); _messages = new List<Message>(); _state = TranscriptRecorderState.Active; ConversationParticipant caller = e.RemoteParticipant; // Log Conference Invitation Recv Message m = new Message("Conference Started Invitation Recieved for ConferenceUri: ", caller.DisplayName, caller.UserAtHost, caller.Uri, DateTime.Now, "null", e.Invitation.ConferenceUri, MessageType.ConferenceInfo, MessageDirection.Outgoing); this.OnMessageReceived(m); AddIncomingInvitedConference(e); }
public void AddIncomingInvitedConference(ConferenceInvitationReceivedEventArgs e, CancellationTokenSource cts = null) { if (_state != TranscriptRecorderState.Active) { NonBlockingConsole.WriteLine("Warn: AddIncomingInvitedConferece in unexpected TranscriptRecorderSession state: " + _state.ToString()); } // Log Conference Invitation Recv ConversationParticipant caller = e.RemoteParticipant; Message m = new Message("Conference Started Invite Accept Started.", caller.DisplayName, caller.UserAtHost, caller.Uri, DateTime.Now, "null", e.Invitation.ConferenceUri, MessageType.ConferenceInfo, MessageDirection.Outgoing); this.OnMessageReceived(m); e.Invitation.BeginAccept(ConferenceInvitation_AcceptCompleted, e.Invitation); }
/// <summary> /// Delegate that is called when an incoming ConferenceInvite is received. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void UserEndpoint_ConferenceInvitationReceived(object sender, ConferenceInvitationReceivedEventArgs e) { Task.Factory.StartNew(() => { try { ConferenceInvitation invite = e.Invitation; Conversation conversation = invite.Conversation; // TODO: indexing by conv id doesn't work for "public meeting recording" scenario if (_activeConversationSessions.ContainsKey(conversation)) { _activeConversationSessions[conversation].AddIncomingInvitedConference(e); } else { TranscriptRecorderSession t = new TranscriptRecorderSession(e); _activeConversationSessions.Add(conversation, t); } } catch (Exception ex) { NonBlockingConsole.WriteLine("Error: Exception thrown in UserEndpoint_ConferenceInvitationReceived: " + ex.ToString()); } finally { _waitForTranscriptSessionStarted.Set(); } }); }