Class RtpdumpFileReader


  • public class RtpdumpFileReader
    extends Object
    This class represent a rtpdump file and provide an API to get the payload of the rtp packet it contains. rtpdump format : - http://www.cs.columbia.edu/irt/software/rtptools/ - https://gist.github.com/Haerezis/18e3ffc2d69c86f8463f#file-rtpdump_file_format (backup gist) rtpdump file can be generated with wireshark from RTP stream, just go to : -> Telephony -> RTP -> Show All Streams then select the RTP stream you want to record, and click on "Save As". If the RTP menu isn't found in the Telephony menu, maybe you can find it in the "Statistics" menu (in old version of Wireshark).
    Author:
    Thomas Kuntz
    • Field Detail

      • FILE_HEADER_LENGTH

        public static final int FILE_HEADER_LENGTH
        The size of the first header of the file (in bytes). The file wireshark/ui/tap-rtp-common.c , more specifically the function rtp_write_header that write the file header, show that this header is 4+4+4+2+2=16 bytes.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RtpdumpFileReader

        public RtpdumpFileReader​(String filePath)
        Initialize a new instance of RtpdumpFileReader that will the rtpdump file located by filePath.
        Parameters:
        filePath - the location of the rtpdump file this RtpdumpFileReader will read.
    • Method Detail

      • getNextPacket

        public RawPacket getNextPacket​(boolean loopFile)
                                throws IOException
        Get the next rtp packet recorded in the rtpdump file.
        Parameters:
        loopFile - if true, when the end of the rtpdump file is reached, this RtpdumpFileReader will go back at the beginning of the file and get the first packet.
        Returns:
        a RawPacket containing all the information and data of the next rtp packet recorded in the rtpdump file
        Throws:
        IOException - if loopFile was false and the end of the file is reached.