aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/contrib/rtp/rtp_replay_shared.st
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-12-13 13:18:19 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-13 13:40:09 +0100
commit8b666498838bfc46176eb20fa8b9555a7be8163c (patch)
tree090302031a282dba7693de20657c02c9748b00f8 /openbsc/contrib/rtp/rtp_replay_shared.st
parente828b661a763befd638ed2a624aecd6537587b42 (diff)
contrib/rtp: Enhance RTP replay tool
This patch adds optional parameters to pass the state file, the destination address (default 127.0.0.1), the destination port (default 4000), the source port (default 0). So it is called as follows: gst rtp_replay.st -a [FILE [HOST [SOURCEPORT [DESTPORT]]]] In addition, nonexistant FILEs are no longer created but opened read-only instead. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/contrib/rtp/rtp_replay_shared.st')
-rw-r--r--openbsc/contrib/rtp/rtp_replay_shared.st14
1 files changed, 12 insertions, 2 deletions
diff --git a/openbsc/contrib/rtp/rtp_replay_shared.st b/openbsc/contrib/rtp/rtp_replay_shared.st
index dd32aed7a..7b68c0f5e 100644
--- a/openbsc/contrib/rtp/rtp_replay_shared.st
+++ b/openbsc/contrib/rtp/rtp_replay_shared.st
@@ -42,8 +42,18 @@ Object subclass: RTPReplay [
file: aFile; yourself
]
+ RTPReplay class >> on: aFile fromPort: aPort [
+ ^ self new
+ initialize: aPort;
+ file: aFile; yourself
+ ]
+
initialize [
- socket := Sockets.DatagramSocket new.
+ self initialize: 0.
+ ]
+
+ initialize: aPort [
+ socket := Sockets.DatagramSocket local: '0.0.0.0' port: aPort.
]
file: aFile [
@@ -59,7 +69,7 @@ Object subclass: RTPReplay [
last_time := nil.
last_image := nil.
- file := FileStream open: filename.
+ file := FileStream open: filename mode: #read.
"Send the payload"
dest := Sockets.SocketAddress byName: aHost.