MSC_ConnectionHandler: allow to use IPV4 as default

When the BSC sends a CRCX without an IP address in it, the testcase will
automatically assign an IPV6 address in the response. However, this
breaks compatibility with older versions of osmo-bsc that do not have
IPV6 support. Lets add a module parameter in order to be able to use
IPV4 as default if required.

Change-Id: I30c77abef63636bb02db12d2f2b2d79ea244b96c
This commit is contained in:
Philipp Maier 2020-09-21 14:18:36 +02:00 committed by dexter
parent 37cf40843e
commit a208389c07
2 changed files with 15 additions and 3 deletions

View File

@ -611,6 +611,8 @@ modulepar {
boolean mp_enable_osmux_test := true;
/* Value set in osmo-bsc.cfg "ms max power" */
uint8_t mp_exp_ms_power_level := 7;
boolean mp_media_mgw_offer_ipv6 := true;
}
private function f_gen_test_hdlr_pars(integer bssap_idx := 0) return TestHdlrParams {
@ -623,6 +625,7 @@ private function f_gen_test_hdlr_pars(integer bssap_idx := 0) return TestHdlrPar
}
pars.exp_ms_power_level := mp_exp_ms_power_level;
pars.mscpool.bssap_idx := bssap_idx;
pars.media_mgw_offer_ipv6 := mp_media_mgw_offer_ipv6;
return pars;
}

View File

@ -279,7 +279,14 @@ function f_rx_crcx(MgcpCommand mgcp_cmd)
var MgcpOsmuxCID osmux_cid;
var SDP_Message sdp;
var integer cid := f_get_free_mgcp_conn();
var charstring local_rtp_addr := host_mgw_rtp_v6; /* Use IPv6 by default if no remote addr is provided by client */
var charstring local_rtp_addr;
if (g_pars.media_mgw_offer_ipv6 == true) {
local_rtp_addr := host_mgw_rtp_v6; /* Use IPv6 by default if no remote addr is provided by client */
} else {
local_rtp_addr := host_mgw_rtp_v4; /* Use IPv4 by default if no remote addr is provided by client */
}
if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) {
if (cid != 0) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "MGCP wildcard EP only works in first CRCX");
@ -553,7 +560,8 @@ type record TestHdlrParams {
boolean aoip,
boolean use_osmux,
charstring host_aoip_tla,
TestHdlrParamsMSCPool mscpool
TestHdlrParamsMSCPool mscpool,
boolean media_mgw_offer_ipv6
};
/* Note: Do not use valueof() to get a value of this template, use
@ -587,7 +595,8 @@ template (value) TestHdlrParams t_def_TestHdlrPars := {
bssap_idx := 0,
rsl_idx := 0,
l3_info := omit
}
},
media_mgw_offer_ipv6 := true
}
function f_create_chan_and_exp() runs on MSC_ConnHdlr {