diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2023-09-27 02:49:49 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-09-27 14:38:19 +0200 |
commit | 268099e7d20a7061857797980f0e17123b4036b8 (patch) | |
tree | 71a51eff5530bd0035e42a7a662ae6b9352907c7 /mgw | |
parent | 99f9c8a14f97853f6f3152895bb73ff5e6600ec3 (diff) |
mgw: add f_TC_amr_switch_to_iuuppespin/iuup
Change-Id: I08eca9ea123029c37892d5de7c94a8ed6cc0a913
Diffstat (limited to 'mgw')
-rw-r--r-- | mgw/MGCP_Test.ttcn | 389 |
1 files changed, 277 insertions, 112 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index 73591b22..37cd1f14 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -10,6 +10,7 @@ */ module MGCP_Test { + import from Misc_Helpers all; import from Osmocom_Types all; import from MGCP_Types all; import from MGCP_Templates all; @@ -2801,42 +2802,21 @@ module MGCP_Test { setverdict(pass); } - /* create two local RTP+IuUP emulations and pass data in both directions */ - function f_tc_two_crcx_mdcx_and_iuup(charstring local_ip_a, charstring remote_ip_a, - IuUP_RabFlowCombinationList rfcl_a, - charstring local_ip_b, charstring remote_ip_b) runs on dummy_CT { - var RtpFlowData flow[2]; + /* create two local emulations and pass data in both directions */ + function f_two_crcx_mdcx_data_transfer(MgcpEndpoint ep, MgcpCallId call_id, inout RtpFlowData flow_a, + inout RtpFlowData flow_b, boolean tear_down_rtp := true) runs on dummy_CT { var RtpemStats stats[2]; var MgcpResponse resp; - var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "2@" & c_mgw_domain; - var MgcpCallId call_id := '1227'H; var integer num_pkts_tx[2]; var integer temp; - f_init(ep); - /* Create the first connection in receive only mode (RNC side, IuUP-Init active) */ - flow[0] := valueof(t_RtpFlow(local_ip_a, remote_ip_a, 96, "VND.3GPP.IUFP/16000")); - flow[0].em.portnr := 10000; - flow[0].rtp_cfg := c_RtpemDefaultCfg; - flow[0].rtp_cfg.rx_payloads[0].payload_type := flow[0].codec_descr[0].pt; - flow[0].rtp_cfg.tx_payloads[0].payload_type := flow[0].codec_descr[0].pt; - flow[0].rtp_cfg.iuup_mode := true; - flow[0].rtp_cfg.iuup_cfg.active_init := true; - flow[0].rtp_cfg.iuup_cfg.rab_flow_combs := rfcl_a; - f_flow_create(RTPEM[0], ep, call_id, "recvonly", flow[0], true); + f_flow_create(RTPEM[0], ep, call_id, "recvonly", flow_a, true); f_rtpem_mode(RTPEM[0], RTPEM_MODE_RXONLY); /* Create the second connection. This connection will be also - * in receive only mode (CN side, IuUP-Init passive) */ - flow[1] := valueof(t_RtpFlow(local_ip_b, remote_ip_b, 96, "VND.3GPP.IUFP/16000")); - flow[1].em.portnr := 20000; - flow[1].rtp_cfg := c_RtpemDefaultCfg; - flow[1].rtp_cfg.rx_payloads[0].payload_type := flow[1].codec_descr[0].pt; - flow[1].rtp_cfg.tx_payloads[0].payload_type := flow[1].codec_descr[0].pt; - flow[1].rtp_cfg.iuup_mode := true; - flow[1].rtp_cfg.iuup_cfg.active_init := false; - f_flow_create(RTPEM[1], ep, call_id, "recvonly", flow[1], true); + * in receive only mode (CN side, regular RTP) */ + f_flow_create(RTPEM[1], ep, call_id, "recvonly", flow_b, true); f_rtpem_mode(RTPEM[1], RTPEM_MODE_RXONLY); /* The first leg starts transmitting */ @@ -2872,7 +2852,7 @@ module MGCP_Test { f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR); stats[1] := f_rtpem_stats_get(RTPEM[1]); num_pkts_tx[1] := stats[1].num_pkts_tx; - f_flow_modify(RTPEM[0], ep, call_id, "sendrecv", flow[0]); + f_flow_modify(RTPEM[0], ep, call_id, "sendrecv", flow_a); f_sleep(0.5); stats[0] := f_rtpem_stats_get(RTPEM[0]); if (stats[0].num_pkts_rx_err_disabled != 0) { @@ -2891,7 +2871,7 @@ module MGCP_Test { f_rtpem_mode(RTPEM[1], RTPEM_MODE_BIDIR); stats[0] := f_rtpem_stats_get(RTPEM[0]); num_pkts_tx[0] := stats[0].num_pkts_tx; - f_flow_modify(RTPEM[1], ep, call_id, "sendrecv", flow[1]); + f_flow_modify(RTPEM[1], ep, call_id, "sendrecv", flow_b); f_sleep(2.0); stats[0] := f_rtpem_stats_get(RTPEM[0]); @@ -2913,8 +2893,44 @@ module MGCP_Test { f_rtpem_stats_err_check(stats[1]); /* Tear down */ - f_flow_delete(RTPEM[0]); - f_flow_delete(RTPEM[1], ep, call_id); + if (tear_down_rtp) { + f_flow_delete(RTPEM[0]); + f_flow_delete(RTPEM[1], ep, call_id); + } + setverdict(pass); + } + + /* create two local RTP+IuUP emulations and pass data in both directions */ + function f_tc_two_crcx_mdcx_and_iuup(charstring local_ip_a, charstring remote_ip_a, + IuUP_RabFlowCombinationList rfcl_a, + charstring local_ip_b, charstring remote_ip_b) runs on dummy_CT { + var RtpFlowData flow[2]; + var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "2@" & c_mgw_domain; + var MgcpCallId call_id := '1227'H; + + f_init(ep); + + /* Create the first connection in receive only mode (RNC side, IuUP-Init active) */ + flow[0] := valueof(t_RtpFlow(local_ip_a, remote_ip_a, 96, "VND.3GPP.IUFP/16000")); + flow[0].em.portnr := 10000; + flow[0].rtp_cfg := c_RtpemDefaultCfg; + flow[0].rtp_cfg.rx_payloads[0].payload_type := flow[0].codec_descr[0].pt; + flow[0].rtp_cfg.tx_payloads[0].payload_type := flow[0].codec_descr[0].pt; + flow[0].rtp_cfg.iuup_mode := true; + flow[0].rtp_cfg.iuup_cfg.active_init := true; + flow[0].rtp_cfg.iuup_cfg.rab_flow_combs := rfcl_a; + + /* Create the second connection. This connection will be also + * in receive only mode (CN side, IuUP-Init passive) */ + flow[1] := valueof(t_RtpFlow(local_ip_b, remote_ip_b, 96, "VND.3GPP.IUFP/16000")); + flow[1].em.portnr := 20000; + flow[1].rtp_cfg := c_RtpemDefaultCfg; + flow[1].rtp_cfg.rx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + flow[1].rtp_cfg.tx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + flow[1].rtp_cfg.iuup_mode := true; + flow[1].rtp_cfg.iuup_cfg.active_init := false; + + f_two_crcx_mdcx_data_transfer(ep, call_id, flow[0], flow[1], true); setverdict(pass); } testcase TC_two_crcx_mdcx_and_iuup() runs on dummy_CT { @@ -2937,17 +2953,87 @@ module MGCP_Test { mp_local_ipv4, mp_remote_ipv4); } + /* Test that once IuUP->RTP has been set up, if the RTP/IuUP conn is set + * as "recvonly", no more RTP/IuUP packets get out of the MGW. */ + function f_tc_two_crcx_mdcx_and_iuup_mdcx_recvonly(charstring local_ip_a, charstring remote_ip_a, + IuUP_RabFlowCombinationList rfcl_a, + charstring local_ip_b, charstring remote_ip_b) runs on dummy_CT { + var RtpFlowData flow[2]; + var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "2@" & c_mgw_domain; + var MgcpCallId call_id := '1227'H; + var RtpemStats stats[2]; + + f_init(ep); + + /* Create the first connection in receive only mode (RNC side, IuUP-Init active) */ + flow[0] := valueof(t_RtpFlow(local_ip_a, remote_ip_a, 96, "VND.3GPP.IUFP/16000")); + flow[0].em.portnr := 10000; + flow[0].rtp_cfg := c_RtpemDefaultCfg; + flow[0].rtp_cfg.rx_payloads[0].payload_type := flow[0].codec_descr[0].pt; + flow[0].rtp_cfg.tx_payloads[0].payload_type := flow[0].codec_descr[0].pt; + flow[0].rtp_cfg.iuup_mode := true; + flow[0].rtp_cfg.iuup_cfg.active_init := true; + flow[0].rtp_cfg.iuup_cfg.rab_flow_combs := rfcl_a; + + /* Create the second connection. This connection will be also + * in receive only mode (CN side, IuUP-Init passive) */ + flow[1] := valueof(t_RtpFlow(local_ip_b, remote_ip_b, 96, "VND.3GPP.IUFP/16000")); + flow[1].em.portnr := 20000; + flow[1].rtp_cfg := c_RtpemDefaultCfg; + flow[1].rtp_cfg.rx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + flow[1].rtp_cfg.tx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + flow[1].rtp_cfg.iuup_mode := true; + flow[1].rtp_cfg.iuup_cfg.active_init := false; + + f_two_crcx_mdcx_data_transfer(ep, call_id, flow[0], flow[1], false); + + /* Now validate we don't receive more RTP packets after setting it to recvonly: */ + f_rtpem_mode(RTPEM[1], RTPEM_MODE_RXONLY); + f_flow_modify(RTPEM[1], ep, call_id, "recvonly", flow[1]); + f_sleep(0.5); + stats[0] := f_rtpem_stats_get(RTPEM[1]); + f_sleep(0.5); + stats[1] := f_rtpem_stats_get(RTPEM[1]); + if (stats[1].num_pkts_rx > stats[0].num_pkts_rx) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("received ", stats[1].num_pkts_rx - stats[0].num_pkts_rx, " RTP packets from MGW on recvonly connection 1")); + } + + /* Now do the same on the IuUP port: */ + f_rtpem_mode(RTPEM[0], RTPEM_MODE_RXONLY); + f_rtpem_mode(RTPEM[1], RTPEM_MODE_TXONLY); + f_flow_modify(RTPEM[0], ep, call_id, "recvonly", flow[0]); + f_sleep(0.5); + stats[0] := f_rtpem_stats_get(RTPEM[0]); + f_sleep(0.5); + stats[1] := f_rtpem_stats_get(RTPEM[0]); + if (stats[1].num_pkts_rx > stats[0].num_pkts_rx) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("received ", stats[1].num_pkts_rx - stats[0].num_pkts_rx, " IuUP packets from MGW on recvonly connection 1")); + } + + /* Tear down */ + f_flow_delete(RTPEM[0]); + f_flow_delete(RTPEM[1], ep, call_id); + setverdict(pass); + } + testcase TC_two_crcx_mdcx_and_iuup_mdcx_recvonly() runs on dummy_CT { + var template (value) IuUP_RabFlowCombinationList rfcl := { + t_IuUP_RFC_AMR_12_2(0), + t_IuUP_RFC_AMR_SID(1), + t_IuUP_RFC_AMR_NO_DATA(2) + }; + f_tc_two_crcx_mdcx_and_iuup_mdcx_recvonly(mp_local_ipv4, mp_remote_ipv4, valueof(rfcl), + mp_local_ipv4, mp_remote_ipv4); + } + /* create two local emulations (1 RTP, 1 RTP+IuUP) and pass data in both directions */ function f_tc_two_crcx_mdcx_and_iuup_rtp(charstring local_ip_a, charstring remote_ip_a, IuUP_RabFlowCombinationList rfcl_a, charstring local_ip_b, charstring remote_ip_b) 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 := '1227'H; - var integer num_pkts_tx[2]; - var integer temp; f_init(ep); @@ -2963,8 +3049,6 @@ module MGCP_Test { flow[0].rtp_cfg.iuup_mode := true; flow[0].rtp_cfg.iuup_cfg.active_init := true; flow[0].rtp_cfg.iuup_cfg.rab_flow_combs := rfcl_a; - f_flow_create(RTPEM[0], ep, call_id, "recvonly", flow[0], true); - f_rtpem_mode(RTPEM[0], RTPEM_MODE_RXONLY); /* Create the second connection. This connection will be also * in receive only mode (CN side, regular RTP) */ @@ -2977,107 +3061,184 @@ module MGCP_Test { /* flow[0].rtp_cfg.rx_payloads[0].fixed_payload converted AMR-IuUP->AMR-BE-RTP*/ flow[1].rtp_cfg.rx_payloads[0].fixed_payload := 'f3d3ca2567ffae00607d713a0f45db225ed2938ccca60ccd066924f298f7b5b8'O; flow[1].rtp_cfg.iuup_mode := false; - f_flow_create(RTPEM[1], ep, call_id, "recvonly", flow[1], true); - f_rtpem_mode(RTPEM[1], RTPEM_MODE_RXONLY); - /* The first leg starts transmitting */ - f_rtpem_mode(RTPEM[0], RTPEM_MODE_TXONLY); + f_two_crcx_mdcx_data_transfer(ep, call_id, flow[0], flow[1], true); + setverdict(pass); + } + testcase TC_two_crcx_mdcx_and_iuup_rtp() runs on dummy_CT { + var template (value) IuUP_RabFlowCombinationList rfcl := { + t_IuUP_RFC_AMR_12_2(0), + t_IuUP_RFC_AMR_SID(1), + t_IuUP_RFC_AMR_NO_DATA(2) + }; + f_tc_two_crcx_mdcx_and_iuup_rtp(mp_local_ipv4, mp_remote_ipv4, valueof(rfcl), + mp_local_ipv4, mp_remote_ipv4); + } + /* Same as TC_two_crcx_mdcTC_two_crcx_mdcx_and_iuup_rtpx_and_iuup, but passing unordered RFCI list (ID != position) */ + testcase TC_two_crcx_mdcx_and_iuup_rtp_rfci_unordered() runs on dummy_CT { + var template (value) IuUP_RabFlowCombinationList rfcl := { + t_IuUP_RFC_AMR_12_2(1), + t_IuUP_RFC_AMR_SID(2), + t_IuUP_RFC_AMR_NO_DATA(0) + }; + f_tc_two_crcx_mdcx_and_iuup_rtp(mp_local_ipv4, mp_remote_ipv4, valueof(rfcl), + mp_local_ipv4, mp_remote_ipv4); + } + + /* Test that once IuUP->RTP has been set up, if the RTP/IuUP conn is set + * as "recvonly", no more RTP/IuUP packets get out of the MGW. */ + function f_tc_two_crcx_mdcx_and_iuup_rtp_mdcx_recvonly(charstring local_ip_a, charstring remote_ip_a, + IuUP_RabFlowCombinationList rfcl_a, + charstring local_ip_b, charstring remote_ip_b) runs on dummy_CT { + var RtpFlowData flow[2]; + var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "2@" & c_mgw_domain; + var MgcpCallId call_id := '1227'H; + var RtpemStats stats[2]; + + f_init(ep); + + /* Create the first connection in receive only mode (RNC side, IuUP-Init active) */ + flow[0] := valueof(t_RtpFlow(local_ip_a, remote_ip_a, 96, "VND.3GPP.IUFP/16000")); + flow[0].em.portnr := 10000; + flow[0].rtp_cfg := c_RtpemDefaultCfg; + flow[0].rtp_cfg.tx_payloads[0].payload_type := flow[0].codec_descr[0].pt; + flow[0].rtp_cfg.rx_payloads[0].payload_type := flow[0].codec_descr[0].pt; + flow[0].rtp_cfg.tx_payloads[0].fixed_payload := '4f28959ffeb80181f5c4e83d176c897b4a4e333298333419a493ca63ded6e0'O; + /* flow[1].rtp_cfg.rx_payloads[0].fixed_payload converted AMR-BE-RTP->AMR-IUUP*/ + flow[0].rtp_cfg.rx_payloads[0].fixed_payload := '08556d944c71a1a081e7ead204244480000ecd82b81118000097c4794e7740'O; + flow[0].rtp_cfg.iuup_mode := true; + flow[0].rtp_cfg.iuup_cfg.active_init := true; + flow[0].rtp_cfg.iuup_cfg.rab_flow_combs := rfcl_a; + + /* Create the second connection. This connection will be also + * in receive only mode (CN side, regular RTP) */ + flow[1] := valueof(t_RtpFlow(local_ip_b, remote_ip_b, 112, "AMR/8000")); + flow[1].em.portnr := 20000; + flow[1].rtp_cfg := c_RtpemDefaultCfg; + flow[1].rtp_cfg.tx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + flow[1].rtp_cfg.rx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + flow[1].rtp_cfg.tx_payloads[0].fixed_payload := '0382155b65131c68682079fab4810911200003b360ae0446000025f11e539dd0'O; + /* flow[0].rtp_cfg.rx_payloads[0].fixed_payload converted AMR-IuUP->AMR-BE-RTP*/ + flow[1].rtp_cfg.rx_payloads[0].fixed_payload := 'f3d3ca2567ffae00607d713a0f45db225ed2938ccca60ccd066924f298f7b5b8'O; + flow[1].rtp_cfg.iuup_mode := false; + + f_two_crcx_mdcx_data_transfer(ep, call_id, flow[0], flow[1], false); + + /* Now validate we don't receive more RTP packets after setting it to recvonly: */ + f_rtpem_mode(RTPEM[1], RTPEM_MODE_RXONLY); + f_flow_modify(RTPEM[1], ep, call_id, "recvonly", flow[1]); + f_sleep(0.5); + stats[0] := f_rtpem_stats_get(RTPEM[1]); f_sleep(0.5); - stats[0] := f_rtpem_stats_get(RTPEM[0]); - if (stats[0].num_pkts_rx_err_disabled != 0) { - setverdict(fail, "received packets from MGW on recvonly connection 0"); - mtc.stop; - } stats[1] := f_rtpem_stats_get(RTPEM[1]); - if (stats[1].num_pkts_rx_err_disabled != 0) { - setverdict(fail, "received packets from MGW on recvonly connection 1"); - mtc.stop; + if (stats[1].num_pkts_rx > stats[0].num_pkts_rx) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("received ", stats[1].num_pkts_rx - stats[0].num_pkts_rx, " RTP packets from MGW on recvonly connection 1")); } - /* The second leg starts transmitting a little later */ + /* Now do the same on the IuUP port: */ + f_rtpem_mode(RTPEM[0], RTPEM_MODE_RXONLY); f_rtpem_mode(RTPEM[1], RTPEM_MODE_TXONLY); - f_sleep(1.0); - stats[0] := f_rtpem_stats_get(RTPEM[0]); - if (stats[0].num_pkts_rx_err_disabled != 0) { - setverdict(fail, "received packets from MGW on recvonly connection 0"); - mtc.stop; - } - stats[1] := f_rtpem_stats_get(RTPEM[1]); - if (stats[1].num_pkts_rx_err_disabled != 0) { - setverdict(fail, "received packets from MGW on recvonly connection 1"); - mtc.stop; - } - - /* The first leg will now be switched into bidirectional - * mode, but we do not expect any data coming back yet. */ - f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR); - stats[1] := f_rtpem_stats_get(RTPEM[1]); - num_pkts_tx[1] := stats[1].num_pkts_tx; - f_flow_modify(RTPEM[0], ep, call_id, "sendrecv", flow[0]); + f_flow_modify(RTPEM[0], ep, call_id, "recvonly", flow[0]); f_sleep(0.5); stats[0] := f_rtpem_stats_get(RTPEM[0]); - if (stats[0].num_pkts_rx_err_disabled != 0) { - setverdict(fail, "received packets from MGW on recvonly connection 0"); - mtc.stop; - } - stats[1] := f_rtpem_stats_get(RTPEM[1]); - if (stats[1].num_pkts_rx_err_disabled != 0) { - setverdict(fail, "received packets from MGW on recvonly connection 1"); - mtc.stop; + f_sleep(0.5); + stats[1] := f_rtpem_stats_get(RTPEM[0]); + if (stats[1].num_pkts_rx > stats[0].num_pkts_rx) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("received ", stats[1].num_pkts_rx - stats[0].num_pkts_rx, " IuUP packets from MGW on recvonly connection 1")); } - /* When the second leg is switched into bidirectional mode - * as well, then the MGW will connect the two together and - * we should see RTP streams passing through from both ends. */ - f_rtpem_mode(RTPEM[1], RTPEM_MODE_BIDIR); - stats[0] := f_rtpem_stats_get(RTPEM[0]); - num_pkts_tx[0] := stats[0].num_pkts_tx; - f_flow_modify(RTPEM[1], ep, call_id, "sendrecv", flow[1]); - f_sleep(2.0); + /* Tear down */ + f_flow_delete(RTPEM[0]); + f_flow_delete(RTPEM[1], ep, call_id); + setverdict(pass); + } + testcase TC_two_crcx_mdcx_and_iuup_rtp_mdcx_recvonly() runs on dummy_CT { + var template (value) IuUP_RabFlowCombinationList rfcl := { + t_IuUP_RFC_AMR_12_2(0), + t_IuUP_RFC_AMR_SID(1), + t_IuUP_RFC_AMR_NO_DATA(2) + }; + f_tc_two_crcx_mdcx_and_iuup_rtp_mdcx_recvonly(mp_local_ipv4, mp_remote_ipv4, valueof(rfcl), + mp_local_ipv4, mp_remote_ipv4); + } - stats[0] := f_rtpem_stats_get(RTPEM[0]); - stats[1] := f_rtpem_stats_get(RTPEM[1]); + function f_tc_amr_switch_to_iuup(charstring local_ip_a, charstring remote_ip_a, + IuUP_RabFlowCombinationList rfcl_a, + charstring local_ip_b, charstring remote_ip_b) runs on dummy_CT { + var RtpFlowData flow[2]; + var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "2@" & c_mgw_domain; + var MgcpCallId call_id := '1227'H; - temp := stats[0].num_pkts_tx - num_pkts_tx[0] - stats[1].num_pkts_rx; - if (temp > 3 or temp < -3) { - setverdict(fail, "number of packets not within normal parameters:", temp); - mtc.stop; - } + f_init(ep); - temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx; - if (temp > 3 or temp < -3) { - setverdict(fail, "number of packets not within normal parameters:", temp); - mtc.stop; - } + /* Create the first connection in receive only mode (RNC side, IuUP-Init active) */ + flow[0] := valueof(t_RtpFlow(local_ip_a, remote_ip_a, 96, "VND.3GPP.IUFP/16000")); + flow[0].em.portnr := 10000; + flow[0].rtp_cfg := c_RtpemDefaultCfg; + flow[0].rtp_cfg.tx_payloads[0].payload_type := flow[0].codec_descr[0].pt; + flow[0].rtp_cfg.rx_payloads[0].payload_type := flow[0].codec_descr[0].pt; + flow[0].rtp_cfg.tx_payloads[0].fixed_payload := '4f28959ffeb80181f5c4e83d176c897b4a4e333298333419a493ca63ded6e0'O; + /* flow[1].rtp_cfg.rx_payloads[0].fixed_payload converted AMR-BE-RTP->AMR-IUUP*/ + flow[0].rtp_cfg.rx_payloads[0].fixed_payload := '08556d944c71a1a081e7ead204244480000ecd82b81118000097c4794e7740'O; + flow[0].rtp_cfg.iuup_mode := true; + flow[0].rtp_cfg.iuup_cfg.active_init := true; + flow[0].rtp_cfg.iuup_cfg.rab_flow_combs := rfcl_a; - f_rtpem_stats_err_check(stats[0]); - f_rtpem_stats_err_check(stats[1]); + /* Create the second connection. This connection will be also + * in receive only mode (CN side, regular RTP) */ + flow[1] := valueof(t_RtpFlow(local_ip_b, remote_ip_b, 112, "AMR/8000")); + flow[1].em.portnr := 20000; + flow[1].rtp_cfg := c_RtpemDefaultCfg; + flow[1].rtp_cfg.tx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + flow[1].rtp_cfg.rx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + flow[1].rtp_cfg.tx_payloads[0].fixed_payload := '0382155b65131c68682079fab4810911200003b360ae0446000025f11e539dd0'O; + /* flow[0].rtp_cfg.rx_payloads[0].fixed_payload converted AMR-IuUP->AMR-BE-RTP*/ + flow[1].rtp_cfg.rx_payloads[0].fixed_payload := 'f3d3ca2567ffae00607d713a0f45db225ed2938ccca60ccd066924f298f7b5b8'O; + flow[1].rtp_cfg.iuup_mode := false; + + f_two_crcx_mdcx_data_transfer(ep, call_id, flow[0], flow[1], false); + setverdict(pass); + + /* Now prevent MGW from forwarding further pkts to RTPEM[1], to avoid race conditions where RTP is sent while we reconfigure it for IuUP: */ + f_flow_modify(RTPEM[1], ep, call_id, "recvonly", flow[1]); + f_sleep(0.5); + + /* Modify the AMR side to also do IuUP */ + flow[1].codec_descr := {{ + pt := 96, + codec := "VND.3GPP.IUFP/16000", + fmtp := omit + }}; + flow[1].rtp_cfg.iuup_mode := true; /* <-- does it work to switch this on with f_flow_modify()? */ + flow[1].rtp_cfg.iuup_cfg.active_init := false; + flow[1].rtp_cfg.iuup_cfg.rab_flow_combs := rfcl_a; + flow[1].rtp_cfg.tx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + flow[1].rtp_cfg.rx_payloads[0].payload_type := flow[1].codec_descr[0].pt; + f_flow_modify(RTPEM[1], ep, call_id, "sendrecv", flow[1]); + + // ... now what + // want to verify that the RTP packets switched from AMR to IuUP, + // and that an IuUP Initialization happened by initiative of osmo-mgw. + // In the pcap, I see a switch to IuUP without Initialization, and then invalid IuUP PDUs being + // forwarded out of flow[1] (wireshark: "Unknown PDU Type(15)"). + f_sleep(3.0); /* Tear down */ f_flow_delete(RTPEM[0]); f_flow_delete(RTPEM[1], ep, call_id); setverdict(pass); } - testcase TC_two_crcx_mdcx_and_iuup_rtp() runs on dummy_CT { + testcase TC_amr_switch_to_iuup() runs on dummy_CT { var template (value) IuUP_RabFlowCombinationList rfcl := { t_IuUP_RFC_AMR_12_2(0), t_IuUP_RFC_AMR_SID(1), t_IuUP_RFC_AMR_NO_DATA(2) }; - f_tc_two_crcx_mdcx_and_iuup_rtp(mp_local_ipv4, mp_remote_ipv4, valueof(rfcl), - mp_local_ipv4, mp_remote_ipv4); + f_tc_amr_switch_to_iuup(mp_local_ipv4, mp_remote_ipv4, valueof(rfcl), + mp_local_ipv4, mp_remote_ipv4); } - /* Same as TC_two_crcx_mdcTC_two_crcx_mdcx_and_iuup_rtpx_and_iuup, but passing unordered RFCI list (ID != position) */ - testcase TC_two_crcx_mdcx_and_iuup_rtp_rfci_unordered() runs on dummy_CT { - var template (value) IuUP_RabFlowCombinationList rfcl := { - t_IuUP_RFC_AMR_12_2(1), - t_IuUP_RFC_AMR_SID(2), - t_IuUP_RFC_AMR_NO_DATA(0) - }; - f_tc_two_crcx_mdcx_and_iuup_rtp(mp_local_ipv4, mp_remote_ipv4, valueof(rfcl), - mp_local_ipv4, mp_remote_ipv4); - } - control { execute(TC_selftest()); execute(TC_auep_null()); @@ -3164,8 +3325,12 @@ module MGCP_Test { execute(TC_two_crcx_mdcx_and_iuup()); execute(TC_two_crcx_mdcx_and_iuup_rfci_unordered()); + execute(TC_two_crcx_mdcx_and_iuup_mdcx_recvonly()); execute(TC_two_crcx_mdcx_and_iuup_rtp()); execute(TC_two_crcx_mdcx_and_iuup_rtp_rfci_unordered()); + execute(TC_two_crcx_mdcx_and_iuup_rtp_mdcx_recvonly()); + + execute(TC_amr_switch_to_iuup()); execute(TC_two_crcx_mdcx_and_rtp_clearmode()); |