This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

There is two fields(rtcp.ssrc.fraction and rtcp.ssrc.cum_nr) that can have multiple instances on a single packet. I want to traverse all instances of rtcp.ssrc.fraction and then find the "matching instance" of rtcp.ssrc.cum_nr. See example below.

A packet has three RTCP messages: EXTENDED REPORT (ER), SENDER REPORT (SR), SOURCE DESCRIPTION (SD)

Both ER and SR include instances of rtcp.ssrc.fration but only SR includes an instance of rtcp.ssrc.cum_nr.

local fractions = { rtcp_fraction() }                                
local cumulatives = { rtcp_cumulative() }

print cumulatives[1].value -- Prints value of cum_nr on SENDER REPORT 
print fractions[1].value -- Prints value of fraction on EXTENDED REPORT
print fractions[2].value -- Prints value of fraction on SENDER REPORT

How can I know which fraction corresponds to the cumulative value without knowing the order of the RTCP messages on the packet?

I was hoping the cumulatives table would get filled with nil values for each message that didn't have a cum_nr value, so I could do something like what you see below, but that is not the case, so the code below would work if the SR came before the ER but if the ER comes before the SR it would match the fraction value of the ER to the cumulative of the SR.

for k,v in pairs(fractions) do 
  if cumulatives[k] ~= nil then 
    print("fraction: " .. v .. " cumulative: " .. cumulatives[k].value)
  end
end

asked 18 Apr '16, 00:11

jotica's gravatar image

jotica
6113
accept rate: 0%

edited 18 Apr '16, 04:06

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×431
×41
×9
×5

question asked: 18 Apr '16, 00:11

question was seen: 903 times

last updated: 18 Apr '16, 04:06

p​o​w​e​r​e​d by O​S​Q​A