aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/rtp/timestamp_rtp.lua
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-07-04 23:08:44 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-12 23:42:44 +0200
commit0b5cf1d1d40815b5b910330074ab4e234014448a (patch)
tree77eed5bde035b276b63f92c0f23e944049e59897 /contrib/rtp/timestamp_rtp.lua
parent9e3c66b1814246f6c06a6f78975f54dfe9e2cf8c (diff)
move openbsc/* to repos root
This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7
Diffstat (limited to 'contrib/rtp/timestamp_rtp.lua')
-rw-r--r--contrib/rtp/timestamp_rtp.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua
new file mode 100644
index 000000000..c18a06bed
--- /dev/null
+++ b/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