Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13161 )
Change subject: MGCP_Test: Test AMR octet-aligned/bandwith-efficient mode conversion ...................................................................... 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 --- M mgw/MGCP_Test.ttcn M mgw/expected-results.xml 2 files changed, 67 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index a0a836b..467ebfc 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -1380,6 +1380,67 @@ 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 @@ 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()); } } diff --git a/mgw/expected-results.xml b/mgw/expected-results.xml index f5bc1a0..5c520c5 100644 --- a/mgw/expected-results.xml +++ b/mgw/expected-results.xml @@ -38,4 +38,7 @@ <testcase classname='MGCP_Test' name='TC_two_crcx_and_unsolicited_rtp' time='MASKED'/> <testcase classname='MGCP_Test' name='TC_two_crcx_and_one_mdcx_rtp_ho' time='MASKED'/> <testcase classname='MGCP_Test' name='TC_ts101318_rfc5993_rtp_conversion' time='MASKED'/> + <testcase classname='MGCP_Test' name='TC_amr_oa_bwe_rtp_conversion' time='MASKED'/> + <testcase classname='MGCP_Test' name='TC_amr_oa_oa_rtp_conversion' time='MASKED'/> + <testcase classname='MGCP_Test' name='TC_amr_bwe_bwe_rtp_conversion' time='MASKED'/> </testsuite> -- To view, visit https://gerrit.osmocom.org/13161 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I050bfeabfb5fdbf986d429eef3af69fe8158d56e Gerrit-Change-Number: 13161 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pma...@sysmocom.de> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder (1000002)