diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-05-18 10:46:03 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-05-18 10:48:02 +0200 |
commit | bea9a1206b18f954a7d3b2de496ab7cbfd0bb3b9 (patch) | |
tree | d93a47ddcb4eebf7efe133494e617fc28d6dae71 | |
parent | 2c9ea91317db1e81dc179fa31765468fdd3da1bc (diff) |
rtp: Add lua script to split a trace by SSRC/streams
This can be used to replay RTP streams with more or less the
same timing as the original one.
-rw-r--r-- | openbsc/contrib/rtp/timestamp_rtp.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/openbsc/contrib/rtp/timestamp_rtp.lua b/openbsc/contrib/rtp/timestamp_rtp.lua new file mode 100644 index 000000000..c18a06bed --- /dev/null +++ b/openbsc/contrib/rtp/timestamp_rtp.lua @@ -0,0 +1,28 @@ +print("Ni hao") + + +do + local tap = Listener.new("ip", "rtp") + local rtp_ssrc = Field.new("rtp.ssrc") + local frame_time = Field.new("frame.time_relative") + local rtp = Field.new("rtp") + + function tap.packet(pinfo, tvb, ip) + local ip_src, ip_dst = tostring(ip.ip_src), tostring(ip.ip_dst) + local rtp_data = rtp() + local filename = "rtp_ssrc" .. rtp_ssrc() "_src_" .. ip_src .. "_to_" .. ip_dst .. ".state" + local f = io.open(filename, "a") + + f:write(tostring(frame_time()) .. " ") + f:write(tostring(rtp_data.value)) + f:write("\n") + f:close() + end + + function tap.draw() + print("DRAW") + end + function tap.reset() + print("RESET") + end +end |