diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn index 728d352d1..b2360dc50 100644 --- a/library/RTP_Emulation.ttcn +++ b/library/RTP_Emulation.ttcn @@ -81,6 +81,8 @@ type component RTP_Emulation_CT { /* user-facing port for controlling the binding */ port RTPEM_CTRL_PT CTRL; + /* user-facing port for sniffing RTP frames */ + port RTPEM_DATA_PT DATA; /* configurable by user, should be fixed */ var RtpemConfig g_cfg := c_RtpemDefaultCfg; @@ -186,6 +188,10 @@ type port RTPEM_CTRL_PT procedure { RTPEM_conn_refuse_received; } with { extension "internal" }; +type port RTPEM_DATA_PT message { + inout PDU_RTP, PDU_RTCP; +} 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) {}; @@ -515,10 +521,16 @@ function f_main() runs on RTP_Emulation_CT if (g_cfg.iuup_mode) { rx_rtp.msg.rtp.data := f_IuUP_Em_rx_decaps(g_iuup_ent, rx_rtp.msg.rtp.data); } + if (DATA.checkstate("Connected")) { + DATA.send(rx_rtp.msg.rtp); + } } [g_rx_enabled] RTCP.receive(tr_rtcp) -> value rx_rtp { //log("RX RTCP: ", rx_rtp); g_stats_rtcp.num_pkts_rx := g_stats_rtcp.num_pkts_rx+1; + if (DATA.checkstate("Connected")) { + DATA.send(rx_rtp.msg.rtcp); + } } /* transmit if timer has expired */