diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-07-24 18:51:36 +0200 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2018-07-24 19:01:27 +0200 |
commit | c290d7292e43b1f67c61ecb4a58081545e562cb5 (patch) | |
tree | 8b3159a5b95c66a136f17c60ad36063ac0b33865 /library | |
parent | 9b0235b68d010e4638ac880018dff00f801f410c (diff) |
MGCP_Test: check payload type of received RTP packets
When an RTP packet is received, the payload type is not checked,
so we will not detect if the MGW emits packets with a wrong payload
type for some reason.
- Introduce a statistics counter that counts packets with wrong PT
- Update testcases so that they check for the statistics for wrong
PT count.
Change-Id: I83d4b04656a16ced624024245a2fcb7a0ad48a8a
Related: OS#3384
Diffstat (limited to 'library')
-rw-r--r-- | library/RTP_Emulation.ttcn | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn index 71cd8dbb..2a358a95 100644 --- a/library/RTP_Emulation.ttcn +++ b/library/RTP_Emulation.ttcn @@ -116,6 +116,8 @@ type record RtpemStats { integer num_pkts_rx_err_seq, /* number of packets received wrong timestamp */ integer num_pkts_rx_err_ts, + /* number of packets received wrong payload type */ + integer num_pkts_rx_err_pt, /* number of packets received during Rx disable */ integer num_pkts_rx_err_disabled } @@ -127,6 +129,7 @@ const RtpemStats c_RtpemStatsReset := { bytes_payload_rx := 0, num_pkts_rx_err_seq := 0, num_pkts_rx_err_ts := 0, + num_pkts_rx_err_pt := 0, num_pkts_rx_err_disabled := 0 } @@ -399,7 +402,11 @@ function f_main() runs on RTP_Emulation_CT /* process received RTCP/RTP if receiver enabled */ [g_rx_enabled] RTP.receive(tr_rtp) -> value rx_rtp { //log("RX RTP: ", rx_rtp); + /* increment counters */ + if (rx_rtp.msg.rtp.payload_type != g_cfg.tx_payload_type) { + g_stats_rtp.num_pkts_rx_err_pt := g_stats_rtp.num_pkts_rx_err_pt+1; + } g_stats_rtp.num_pkts_rx := g_stats_rtp.num_pkts_rx+1; g_stats_rtp.bytes_payload_rx := g_stats_rtp.bytes_payload_rx + lengthof(rx_rtp.msg.rtp.data); |