aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-29 08:50:33 +0200
committerHarald Welte <laforge@gnumonks.org>2018-03-29 08:50:33 +0200
commit1af4033a7b8168a817d314352f8e00019e651282 (patch)
tree98ed94d9ed532d4af56fbdfb1666059ed8375d8a /library
parent8d3ea0e3ecd105d2cf363fae6b558c837e22d6c6 (diff)
RTP_Emulation: Add convenience helper functions around procedure calls
Diffstat (limited to 'library')
-rw-r--r--library/RTP_Emulation.ttcn30
1 files changed, 30 insertions, 0 deletions
diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn
index 4b8c3977..90a769cc 100644
--- a/library/RTP_Emulation.ttcn
+++ b/library/RTP_Emulation.ttcn
@@ -160,6 +160,36 @@ type port RTPEM_CTRL_PT procedure {
inout RTPEM_bind, RTPEM_connect, RTPEM_mode, RTPEM_configure, RTPEM_stats_get;
} with { extension "internal" };
+function f_rtpem_bind(RTPEM_CTRL_PT pt, in HostName local_host, inout PortNumber local_port) {
+ pt.call(RTPEM_bind:{local_host, local_port}) {
+ [] pt.getreply(RTPEM_bind:{local_host, ?}) -> param (local_port) {};
+ }
+}
+function f_rtpem_connect(RTPEM_CTRL_PT pt, in HostName remote_host, in PortNumber remote_port) {
+ pt.call(RTPEM_connect:{remote_host, remote_port}) {
+ [] pt.getreply(RTPEM_connect:{remote_host, remote_port}) {};
+ }
+}
+function f_rtpem_mode(RTPEM_CTRL_PT pt, in RtpemMode mode) {
+ pt.call(RTPEM_mode:{mode}) {
+ [] pt.getreply(RTPEM_mode:{mode}) {};
+ }
+}
+function f_rtpem_configure(RTPEM_CTRL_PT pt, in RtpemConfig cfg) {
+ pt.call(RTPEM_configure:{cfg}) {
+ [] pt.getreply(RTPEM_configure:{cfg}) {};
+ }
+}
+function f_rtpem_stats_get(RTPEM_CTRL_PT pt, boolean rtcp := false) return RtpemStats {
+ var RtpemStats stats;
+ pt.call(RTPEM_stats_get:{-, rtcp}) {
+ [] pt.getreply(RTPEM_stats_get:{?, rtcp}) -> param(stats) {};
+ }
+ return stats;
+}
+
+
+
template PDU_RTP ts_RTP(BIT32_BO_LAST ssrc, INT7b pt, LIN2_BO_LAST seq, uint32_t ts,
octetstring payload, BIT1 marker := '0'B) := {
version := 2,