From 1af4033a7b8168a817d314352f8e00019e651282 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 29 Mar 2018 08:50:33 +0200 Subject: RTP_Emulation: Add convenience helper functions around procedure calls Change-Id: I413aa2b86c2aebe8017112926fc88af0de4d43b7 --- library/RTP_Emulation.ttcn | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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, -- cgit v1.2.3