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
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index c372709..3d6538a 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -279,7 +279,14 @@
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 @@
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 @@
bssap_idx := 0,
rsl_idx := 0,
l3_info := omit
- }
+ },
+ media_mgw_offer_ipv6 := true
}
function f_create_chan_and_exp() runs on MSC_ConnHdlr {