diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2019-03-07 10:54:10 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-03-19 13:29:31 +0000 |
commit | 4f764ce4f3a3121269515c1dd1d12a3bbb74255b (patch) | |
tree | 492b8b2e4739e858968a60c58caf25b6e242f21d /mgw/MGCP_Test.ttcn | |
parent | c8c0b40e1bb0452340654a6042a1bfd3f506fa06 (diff) |
MGCP_Test: Test AMR octet-aligned/bandwith-efficient mode conversion
osmo-mgw now implements a conversion between the AMR octet-aligned
and banwith-efficient payload format. Lets add tests for this
Change-Id: I050bfeabfb5fdbf986d429eef3af69fe8158d56e
depends: osmo-mgw I622c01874b25f5049d4f59eb8157e0ea3cbe16ba
related: SYS#4470
Diffstat (limited to 'mgw/MGCP_Test.ttcn')
-rw-r--r-- | mgw/MGCP_Test.ttcn | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index a0a836b5..467ebfce 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -1380,6 +1380,67 @@ module MGCP_Test { setverdict(pass); } + /* create two local RTP emulations; create two connections on MGW EP, see if + * exchanged data is converted between AMR octet-aligned and bandwith + * efficient-mode */ + function f_TC_amr_x_x_rtp_conversion(octetstring pl0, octetstring pl1, charstring fmtp0, charstring fmtp1) runs on dummy_CT { + var RtpFlowData flow[2]; + var RtpemStats stats[2]; + var MgcpResponse resp; + var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "2@" & c_mgw_domain; + var MgcpCallId call_id := '1226'H; + + f_init(ep); + + /* from us to MGW */ + flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 112, "AMR/8000")); + /* bind local RTP emulation sockets */ + flow[0].em.portnr := 10000; + flow[0].rtp_cfg := c_RtpemDefaultCfg; + flow[0].rtp_cfg.tx_payload_type := flow[0].pt; + flow[0].rtp_cfg.rx_fixed_payload := pl0; + flow[0].rtp_cfg.tx_fixed_payload := pl0; + flow[0].fmtp := fmtp0; + f_flow_create(RTPEM[0], ep, call_id, "sendrecv", flow[0]); + + /* from MGW back to us */ + flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 112, "AMR/8000")); + flow[1].em.portnr := 20000; + flow[1].rtp_cfg := c_RtpemDefaultCfg; + flow[1].rtp_cfg.tx_payload_type := flow[1].pt; + flow[1].rtp_cfg.rx_fixed_payload := pl1; + flow[1].rtp_cfg.tx_fixed_payload := pl1; + flow[1].fmtp := fmtp1; + f_flow_create(RTPEM[1], ep, call_id, "sendrecv", flow[1]); + + f_rtpem_mode(RTPEM[1], RTPEM_MODE_BIDIR); + f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR); + + f_sleep(1.0); + + f_flow_delete(RTPEM[0]); + f_flow_delete(RTPEM[1], ep, call_id); + + stats[0] := f_rtpem_stats_get(RTPEM[0]); + stats[1] := f_rtpem_stats_get(RTPEM[1]); + + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); + + setverdict(pass); + } + + testcase TC_amr_oa_bwe_rtp_conversion() runs on dummy_CT { + f_TC_amr_x_x_rtp_conversion('100c4e9ba850e30d5d53d04de41e7c'O, '10d3a6ea1438c35754f41379079f'O, "octet-align=1", "octet-align=0"); + } + + testcase TC_amr_oa_oa_rtp_conversion() runs on dummy_CT { + f_TC_amr_x_x_rtp_conversion('100c4e9ba850e30d5d53d04de41e7c'O, '100c4e9ba850e30d5d53d04de41e7c'O, "octet-align=1", "octet-align=1"); + } + + testcase TC_amr_bwe_bwe_rtp_conversion() runs on dummy_CT { + f_TC_amr_x_x_rtp_conversion('10d3a6ea1438c35754f41379079f'O, '10d3a6ea1438c35754f41379079f'O, "octet-align=0", "octet-align=0"); + } /* TODO: Double-DLCX (no retransmission) */ @@ -1432,5 +1493,8 @@ module MGCP_Test { execute(TC_two_crcx_and_unsolicited_rtp()); execute(TC_two_crcx_and_one_mdcx_rtp_ho()); execute(TC_ts101318_rfc5993_rtp_conversion()); + execute(TC_amr_oa_bwe_rtp_conversion()); + execute(TC_amr_oa_oa_rtp_conversion()); + execute(TC_amr_bwe_bwe_rtp_conversion()); } } |