0

I am trying to read packets from a pcap file using PcapDotNet. This file contains captured RTP packets as below.

enter image description here

In my code I have to extract G711 and H264 packets and write to different files. How can I find this information?

    private static void DispatcherHandler(Packet packet)
    {            
        UdpDatagram udp = null;
        udp = packet.IpV4.Udp;
        Datagram  datagram = udp.Payload;
        if (!nProto.ContainsKey(packet.IpV4.Protocol))
            nProto.Add(packet.IpV4.Protocol, 1);
        else
            nProto [packet.IpV4.Protocol]++;

        String sourceIP = packet.Ethernet.IpV4.Source.ToString();
        String destIP = packet.Ethernet.IpV4.Destination.ToString();

        String srcPort = udp.SourcePort.ToString();
        String destPort = udp.DestinationPort.ToString();

        String info = ?
        Console.WriteLine();            
    }
brickner
  • 6,595
  • 3
  • 41
  • 54
Manjoor
  • 4,091
  • 10
  • 43
  • 67
  • 1
    Apologies if you already know this, but PcapDotNet does not support RTP parsing yet so it would be a solution (https://github.com/PcapDotNet/Pcap.Net/issues/50) – c3st7n Aug 16 '17 at 15:19
  • I didn't know this. I am going to look into data and see if there are some information available – Manjoor Aug 16 '17 at 15:30

0 Answers0