//Just to record the state transitions in the console. void ConferenceSession_ParticipantEndpointAttendanceChanged(object sender, ParticipantEndpointAttendanceChangedEventArgs <ConferenceParticipantEndpointProperties> e) { ConferenceSession confSession = sender as ConferenceSession; // Log each participant as s/he gets added/deleted from the ConferenceSession's roster. foreach (KeyValuePair <ParticipantEndpoint, ConferenceParticipantEndpointProperties> pair in e.Joined) { NonBlockingConsole.WriteLine("{0} is notified of participant joining the conference: {1}", confSession.Conversation.LocalParticipant.UserAtHost, pair.Key.Participant.UserAtHost); Message m = new Message("Participant joined conference.", pair.Key.Participant.DisplayName, pair.Key.Participant.UserAtHost, pair.Key.Participant.Uri, MessageType.ConferenceInfo, _conversation.Id, _conference.ConferenceUri, MessageDirection.Incoming); _transcriptRecorder.OnMessageReceived(m); } foreach (KeyValuePair <ParticipantEndpoint, ConferenceParticipantEndpointProperties> pair in e.Left) { NonBlockingConsole.WriteLine("{0} is notified of participant leaving the conference: {1}", confSession.Conversation.LocalParticipant.UserAtHost, pair.Key.Participant.UserAtHost); Message m = new Message("Participant left conference.", pair.Key.Participant.DisplayName, pair.Key.Participant.UserAtHost, pair.Key.Participant.Uri, MessageType.ConferenceInfo, _conversation.Id, _conference.ConferenceUri, MessageDirection.Incoming); _transcriptRecorder.OnMessageReceived(m); } NonBlockingConsole.WriteLine(""); }
private void ParticipantEndpointAttendanceChanged( object sender, ParticipantEndpointAttendanceChangedEventArgs <AudioVideoMcuParticipantEndpointProperties> e) { if (m_customerTracker != null) { m_customerTracker.ParticipantEndpointAttendanceChanged(sender, e); } if (m_primaryTracker != null) { m_primaryTracker.ParticipantEndpointAttendanceChanged(sender, e); } }
/// <summary> /// Indicates what to do when a new attendee is detected and when an /// attendee departs. /// </summary> /// <param name="sender">The Av Mcu session raising the event.</param> /// <param name="e">The AV Mcu Participant endpoint attendance changed /// event arguments object.</param> private void AudioVideoMcuSession_ParticipantEndpointAttendanceChanged(object sender, ParticipantEndpointAttendanceChangedEventArgs <AudioVideoMcuParticipantEndpointProperties> e) { foreach (var joiningParticipant in e.Joined) { var joiningParticipantEndpoint = joiningParticipant.Key; // If this participant is hidden on the roster, and therefore a // trusted application, move onto the next joining participant. if (joiningParticipantEndpoint.Participant.RosterVisibility == ConferencingRosterVisibility.Hidden) { continue; } if (!_trustedParticipantCalls.ContainsKey(joiningParticipant.Key.Uri)) { Console.WriteLine("Detected a new participant on the AVMCU Session with the displayname " + "{0}.", joiningParticipant.Key.Participant.DisplayName); EstablishAvCallAndAudioRouteForNewAttendee(joiningParticipant.Key); } } foreach (var departingParticipant in e.Left) { if (_trustedParticipantCalls.ContainsKey(departingParticipant.Key.Uri)) { Console.WriteLine("Detected a departing participant on the AVMCU Session with the " + "displayname {0}.", departingParticipant.Key.Participant.DisplayName); // Terminate the call that the trusted app has listening for // DTMF from the user. AudioVideoCall departingParticipantAvCall = _trustedParticipantCalls[departingParticipant .Key.Uri]; if (CallState.Terminating != departingParticipantAvCall.State && CallState.Terminated != departingParticipantAvCall.State) { departingParticipantAvCall.BeginTerminate(CallTerminationCompleted, departingParticipantAvCall); } // Remove the call from the collection. _trustedParticipantCalls.Remove(departingParticipant.Key.Uri); _trustedParticipantCallIDToParticipantUriStore.Remove(departingParticipantAvCall.CallId); } } }
private void AudioVideoMcuSession_ParticipantEndpointAttendanceChanged(object sender, ParticipantEndpointAttendanceChangedEventArgs<AudioVideoMcuParticipantEndpointProperties> e) { throw new NotImplementedException(); }
private void InstantMessagingMcuSession_ParticipantEndpointAttendanceChanged(object sender, ParticipantEndpointAttendanceChangedEventArgs<InstantMessagingMcuParticipantEndpointProperties> e) { throw new NotImplementedException(); }
//Just to record the state transitions in the console. void ConferenceSession_ParticipantEndpointAttendanceChanged(object sender, ParticipantEndpointAttendanceChangedEventArgs<ConferenceParticipantEndpointProperties> e) { ConferenceSession confSession = sender as ConferenceSession; // Log each participant as s/he gets added/deleted from the ConferenceSession's roster. foreach (KeyValuePair<ParticipantEndpoint, ConferenceParticipantEndpointProperties> pair in e.Joined) { NonBlockingConsole.WriteLine("{0} is notified of participant joining the conference: {1}", confSession.Conversation.LocalParticipant.UserAtHost, pair.Key.Participant.UserAtHost); Message m = new Message("Participant joined conference.", pair.Key.Participant.DisplayName, pair.Key.Participant.UserAtHost, pair.Key.Participant.Uri, MessageType.ConferenceInfo, _conversation.Id, _conference.ConferenceUri, MessageDirection.Incoming); _transcriptRecorder.OnMessageReceived(m); } foreach (KeyValuePair<ParticipantEndpoint, ConferenceParticipantEndpointProperties> pair in e.Left) { NonBlockingConsole.WriteLine("{0} is notified of participant leaving the conference: {1}", confSession.Conversation.LocalParticipant.UserAtHost, pair.Key.Participant.UserAtHost); Message m = new Message("Participant left conference.", pair.Key.Participant.DisplayName, pair.Key.Participant.UserAtHost, pair.Key.Participant.Uri, MessageType.ConferenceInfo, _conversation.Id, _conference.ConferenceUri, MessageDirection.Incoming); _transcriptRecorder.OnMessageReceived(m); } NonBlockingConsole.WriteLine(""); }
// avmcu attendance changed. private void AudioVideoMcuSession_ParticipantEndpointAttendanceChanged(object sender, ParticipantEndpointAttendanceChangedEventArgs <AudioVideoMcuParticipantEndpointProperties> e) { // If any participant leaves we tear down the conversation. if (e.Left.Count > 0) { bool needTermination = false; foreach (var kv in e.Left) { if (kv.Key.Participant.RosterVisibility == ConferencingRosterVisibility.Visible) { needTermination = true; break; } } if (needTermination) { this.BeginTerminate((asyncResult) => { this.EndTerminate(asyncResult); }, null); } } }
private void AudioVideoMcuSession_ParticipantEndpointAttendanceChanged(object sender, ParticipantEndpointAttendanceChangedEventArgs <AudioVideoMcuParticipantEndpointProperties> e) { throw new NotImplementedException(); }
private void InstantMessagingMcuSession_ParticipantEndpointAttendanceChanged(object sender, ParticipantEndpointAttendanceChangedEventArgs <InstantMessagingMcuParticipantEndpointProperties> e) { throw new NotImplementedException(); }