Exemplo n.º 1
0
        private void OnNewRtpParticipant(object sender, RtpEvents.RtpParticipantEventArgs ea)
        {
            if (this.rtpSession != sender)
            {
                return;
            }

            RtpParticipant participant = ea.RtpParticipant;

            Trace.WriteLine("New participant: " + participant.CName);

            // we want to ignore ourselves
            if (participant.CName != Constants.PersistenceCName)
            {
                // Make sure this isn't someone who briefly lost connectivity.
                if (!participants.ContainsKey(participant.CName))
                {
                    string newPartName = participant.Name;
                    if (newPartName == null || newPartName == String.Empty)
                    {
                        newPartName = participant.CName;
                    }

                    int participantID = DBHelper.CreateParticipant(
                        conferenceID,
                        participant.CName,
                        newPartName);

                    participants.Add(participant.CName, new ParticipantWrapper(participant, participantID));
                }

                foreach (uint ssrc in participant.SSRCs)
                {
                    OnNewRtpStream(sender, new RtpEvents.RtpStreamEventArgs(rtpSession.Streams[ssrc]));
                }
            }
        }
Exemplo n.º 2
0
 private void RtpParticipantRemoved(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     //ShowMessage(string.Format("{0} has left", ea.RtpParticipant.Name));
 }
Exemplo n.º 3
0
 // CF5 Receive data from network
 private void RtpParticipantAdded(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     listBox1.Items.Add(String.Format("{0} has joined", ea.RtpParticipant.Name));
 }
Exemplo n.º 4
0
 // CF5 Receive data from network
 private void RtpParticipantAdded(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     ShowMessage(string.Format("{0} has joined the chat session.", ea.RtpParticipant.Name));
 }
Exemplo n.º 5
0
 private void RtpParticipantAdded(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
 }
Exemplo n.º 6
0
 void RtpEvents_RtpParticipantAdded(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     Console.Out.WriteLine("Participant added {0}", ea.RtpParticipant.SSRC);
     Console.Out.WriteLine("");
 }
Exemplo n.º 7
0
 void RtpEvents_RtpParticipantDataChanged(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     Console.Out.WriteLine("Participant data changed: {0}", ea.RtpParticipant.SSRC);
     //Console.Out.WriteLine("Participant changed: " + ea.RtpParticipant.ToString());
     Console.Out.WriteLine("");
 }
Exemplo n.º 8
0
 void RtpEvents_RtpParticipantRemoved(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     Console.Out.WriteLine("Participant removed\n");
 }
Exemplo n.º 9
0
 void RtpEvents_RtpParticipantTimeout(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     Console.Out.WriteLine("Participant timeout\n");
 }
Exemplo n.º 10
0
 private void RtpParticipantRemoved(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     ShowMessage(string.Format(CultureInfo.CurrentCulture, Strings.HasLeftTheChatSession,
                               ea.RtpParticipant.Name));
 }
Exemplo n.º 11
0
        private void OnNewRtpParticipant(object sender, RtpEvents.RtpParticipantEventArgs ea)
        {
            try {
                RtpParticipant participant = ea.RtpParticipant;

                eventLog.WriteEntry("OnNewRtpParticipant: " + participant.CName,
                                    EventLogEntryType.Information, ArchiveServiceEventLog.ID.Information);

                if (this.rtpSession != sender)
                {
                    eventLog.WriteEntry("OnNewRtpParticipant: this.rtpSession and sender don't match.",
                                        EventLogEntryType.Information, ArchiveServiceEventLog.ID.Information);
                    if (this.rtpSession == null)
                    {
                        //Note this can happen because participants are added during the rtpSession constructor!!
                        eventLog.WriteEntry("OnNewRtpParticipant: this.rtpSession is null.",
                                            EventLogEntryType.Information, ArchiveServiceEventLog.ID.Information);
                    }
                    if (sender == null)
                    {
                        eventLog.WriteEntry("OnNewRtpParticipant: sender is null.",
                                            EventLogEntryType.Information, ArchiveServiceEventLog.ID.Information);
                    }
                    //return;
                }

                //eventLog.WriteEntry(string.Format(CultureInfo.CurrentCulture, "New participant: {0}", participant.CName));

                // we want to ignore ourselves
                if (participant.CName != Constants.PersistenceCName)
                {
                    // Make sure this isn't someone who briefly lost connectivity.
                    if (!participants.ContainsKey(participant.CName))
                    {
                        string newPartName = participant.Name;
                        if (newPartName == null || newPartName == String.Empty)
                        {
                            newPartName = participant.CName;
                        }

                        int participantID = DBHelper.CreateParticipant(
                            conferenceID,
                            participant.CName,
                            newPartName);

                        participants.Add(participant.CName, new ParticipantWrapper(participant, participantID));

                        eventLog.WriteEntry("OnNewRtpParticipant completed participant Add.",
                                            EventLogEntryType.Information, ArchiveServiceEventLog.ID.Information);
                    }
                    else
                    {
                        eventLog.WriteEntry("OnNewRtpParticipant already in participants hashtable ",
                                            EventLogEntryType.Information, ArchiveServiceEventLog.ID.Information);
                    }

                    foreach (uint ssrc in participant.SSRCs)
                    {
                        if (this.rtpSession == null)
                        {
                            eventLog.WriteEntry("OnNewRtpParticipant: Failed to add streams because this.rtpSession is null.",
                                                EventLogEntryType.Warning, ArchiveServiceEventLog.ID.Warning);
                        }
                        else
                        {
                            OnNewRtpStream(this.rtpSession, new RtpEvents.RtpStreamEventArgs(rtpSession.Streams[ssrc]));
                        }
                    }
                }
                else
                {
                    eventLog.WriteEntry("OnNewRtpParticipant ignoring ourself. ",
                                        EventLogEntryType.Information, ArchiveServiceEventLog.ID.Information);
                }
            }
            catch (Exception e) {
                eventLog.WriteEntry("OnNewRtpParticipant exception: " + e.ToString(),
                                    EventLogEntryType.Warning, ArchiveServiceEventLog.ID.Warning);
            }
        }