Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6219889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:51:44+00:00 2026-05-24T07:51:44+00:00

I want to parse only RTP packets from a .pcap file generated from WireShark

  • 0

I want to parse only RTP packets from a .pcap file generated from WireShark using libpcap library.
I have seen number of example that works on device to get the packets using libpcap but i am not able to find any example that can extract specific packets from the .pcap file.

anyone knows link to such examples or anyone having sample code for doing this.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:51:45+00:00Added an answer on May 24, 2026 at 7:51 am

    libpcap uses the functions pcap_compile and pcap_setfilter (described here with example code) to filter packets before starting the capture loop. The filter syntax is described in the man page for TCPDump

    Filtering RTP packets presents a further challenge as they are not sent over a standard port and there is no other convenient method for detecting the protocol. The ports used for RTP are negotiated by the the control channel protocol (such as SIP) preceding the RTP setup. This example contains a SIP message where the line rport=5060 gives the UDP port used for RTP (see below).

    Detection of RTP therefore requires inspecting the SIP protocol packets (or other signalling protocol to figure out the RTP ports to filter on.

    SIP/2.0 200 OK
    Call-ID: 29858147-465b0752@29858051-465b07b2
    Contact: pel<sip:35104723@192.168.1.2:5060;line=7d36558f31367051>;q=0.500;expires=1200
    CSeq: 6 REGISTER
    From: <sip:35104723@sip.cybercity.dk>;tag=659abf
    P-Associated-URI: <sip:35104723@sip.cybercity.dk>
    To: <sip:35104723@sip.cybercity.dk>;tag=00-04087-1701bae7-76fb74995
    Via: SIP/2.0/UDP 192.168.1.2;received=80.230.219.70;rport=5060;branch=z9hG4bKnp6658824-465059f1192.168.1.2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to parse a file into an AST using Boost Spirit. The root
I am having one XML file and I want to parse only useful data
I want to parse the text line from the Wavefront OBJ file . Currently
I have a log file that I want to parse and load into a
I have a series of paragraphs that I want to parse using regular expressions,
I have a simple but huge xml file like below. I want to parse
I have a variable containing a string from which I want to parse the
I want to parse some JSON data. I'm using James Newton-King's JSON.NET library .
I have a string that I want to parse using regex. It has the
hi i have xml file whitch i want to parse, it looks something like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.