Пример #1
0
        static void Main(string[] args)
        {
            RtpParticipant part = new RtpParticipant("*****@*****.**", "SENDER");

            RtpSession session = new RtpSession(ip, part, true, true);
            session.PacketTransform = new EncryptionTransform("You are a big freak!");
            //session.PacketTransform = new XorTransform();


            RtpSender sender = session.CreateRtpSender("My sender", PayloadType.Test, null);

            Stream fs = File.OpenRead("data.txt");
            int length = (int)fs.Length;
            Console.Out.WriteLine("Opening file of length: " + length);

            byte[] buffer = new byte[length];

            int bytesRead = 0;
            while (bytesRead < length)
            {
                bytesRead += fs.Read(buffer, bytesRead, Math.Min(16384, (length - bytesRead)));
            }

            for (int i = 0; i < 5; i++)
            {
                Console.Out.WriteLine("Sending buffer to address: " + ip);

                sender.Send(buffer);

                Thread.Sleep(1000);
            }

        }
Пример #2
0
        private void InitializeNetwork()
        {
            RtpEvents.ReceiverReport            += new RtpEvents.ReceiverReportEventHandler(RtpReceiverReport);
            RtpEvents.DuplicateCNameDetected    += new RtpEvents.DuplicateCNameDetectedEventHandler(DuplicateCNameDetected);

            // Create participant
            rtpParticipant = new RtpParticipant(cName, name);
            rtpParticipant.SetTool(true);

            // Create session with Participant and Rtp data
            rtpSession = new RtpSession(new IPEndPoint(IPAddress.Parse(ipAddress), port), rtpParticipant, true, true);

            // Create RtpSender
            rtpSender = rtpSession.CreateRtpSender(HostName, PayloadType.PipecleanerSignal, null, null);
        }
Пример #3
0
 public void JoinRTPSession(bool receive)
 {
     if (receive)
     {
         RegisterRtpUserEvents();
         RegisterRtpStreamEvents();
     }
     rtpSession = new RtpSession(network.GetChannel(channel), new RtpParticipant(Environment.MachineName, Environment.MachineName), true, receive);
     rtpSender = rtpSession.CreateRtpSender("VOIP Listener", PayloadType.dynamicAudio, null);
 }