neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31711 )
Change subject: msc: detect RTP to CN failure in call tests
......................................................................
msc: detect RTP to CN failure in call tests
When CN RTP is missing, the X2 timer will fire after all other call
signalling looks successful. So far we establish an MT call, wait three
seconds and directly disconnect, long before X2 or X2427 can fire.
Make X2 shorter. (By means of f_vty_config() from ttcn, so that we don't
need to edit various osmo-msc.cfg in various repositories. The short
timer is always critical for the test to be accurate.)
Add proper function to detect premature disconnect. Otherwise we just
get a cryptic message like "Couldn't find MnccExpect for incoming call"
because of MNCC messaging after the unexpected release event.
Change-Id: I3ccf541360cc8440e664f0e29494b9ce7b6f8943
---
M hnbgw/HNBGW_Tests.ttcn
M msc/BSC_ConnectionHandler.ttcn
2 files changed, 54 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/11/31711/1
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index 9b9b94e..8d39550 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -469,6 +469,10 @@
f_vty_transceive(HNBGWVTY, "enable");
/* TODO: CTRL? */
+
+ /* Configure the MGCP timeout so that a failure to set up all RTP streams triggers within the time that we keep
+ * an otherwise established call open. */
+ f_vty_config(MSCVTY, "msc", "timer mgw X2 3");
}
/* global altstep for global guard timer; */
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index fe9187c..d96ae0b 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -1349,6 +1349,33 @@
setverdict(pass);
}
+function f_call_keep_open(inout CallParameters cpars, float open_time := 5.0)
+runs on BSC_ConnHdlr {
+ log("Hold the call for some time");
+
+ timer T := open_time;
+ T.start;
+ alt {
+ [] MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref));
+ [] MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref));
+ [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id)));
+ [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id)));
+ [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND);
+ [] BSSAP.receive(tr_BSSMAP_ClearCommand);
+ [] BSSAP.receive(tr_BSSMAP_ClearCommandCSFB);
+ [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?));
+
+ [] T.timeout {
+ log("Call stayed open for ", open_time, " seconds, all is well.")
+ setverdict(pass);
+ return;
+ }
+ }
+
+ setverdict(fail, "An unexpected release event disconnected the active call prematurely");
+ mtc.stop;
+}
+
/* Reply to a received CRCX with an OK (or the reply configured in cpars), using the given parameters.
* Return true when an OK reply was sent, false otherwise.
* Count occurence of Osmux, include Osmux parameters in the reply if necessary. */
@@ -1797,8 +1824,7 @@
f_mt_call_establish(cpars);
- log("Hold the call for some time");
- f_sleep(3.0);
+ f_call_keep_open(cpars);
log("Hangup");
f_call_hangup(cpars, true);
@@ -1811,8 +1837,7 @@
f_mo_call_establish(cpars);
- log("Hold the call for some time");
- f_sleep(3.0);
+ f_call_keep_open(cpars);
log("Hangup");
f_call_hangup(cpars, false);
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31711
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3ccf541360cc8440e664f0e29494b9ce7b6f8943
Gerrit-Change-Number: 31711
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/31693 )
Change subject: IuCS: remove IuUP LOOPBACK hack
......................................................................
IuCS: remove IuUP LOOPBACK hack
Since osmo-mgw now supports IuUP properly, and since we indicate IUFP in
the MGCP CRCX towars an IuCS RAN [1], we should no longer place the MGW
endpoint in loopback mode to hack up an IuUP Initialization.
This hack should have been removed along with [1].
[1] IUFP sent to MGW since this commit:
commit 3a02d298049149f126fecc51e8445392cdb3b950
Refs: 1.8.0-13-g3a02d2980
Announce IuFP audio codec for UTRAN conns in CRCX towards MGW
I7aca671e00ed27ac03f0d106b5a6b665a9bed4c1
Change-Id: I6446c64421e3e13e2b829293d031c98b99cd39a7
---
M src/libmsc/msc_a.c
1 file changed, 21 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/93/31693/1
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index a5ab2fb..e74a425 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1755,12 +1755,6 @@
MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE,
MSC_EV_CALL_LEG_RTP_COMPLETE);
OSMO_ASSERT(cl);
-
- /* HACK: We put the connection in loopback mode at the beginning to
- * trick the hNodeB into doing the IuUP negotiation with itself.
- * This is a hack we need because osmo-mgw does not support IuUP yet, see OS#2459. */
- if (msc_a->c.ran->type == OSMO_RAT_UTRAN_IU)
- cl->crcx_conn_mode[RTP_TO_RAN] = MGCP_CONN_LOOPBACK;
}
if (net->use_osmux != OSMUX_USAGE_OFF) {
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/31693
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I6446c64421e3e13e2b829293d031c98b99cd39a7
Gerrit-Change-Number: 31693
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/31694 )
Change subject: add ran_infra.force_mgw_codecs_to_ran
......................................................................
add ran_infra.force_mgw_codecs_to_ran
Indicate in the ran_infra data structure whether a RAN needs specific
codecs to be set up on the RAN facing MGW endpoint.
This allows setting forced RAN codecs as first-class citizen in the
ran_infra data structure, instead of special cases in the code (for IuUP
on IuCS).
Will be used in subsequent commit
I37f65c36af2679ecba1040a11a9aa0eb9481d817, submitted separately for
easier readability.
Change-Id: I37f65c36af2679ecba1040a11a9aa0eb9481d817
---
M include/osmocom/msc/ran_infra.h
M src/libmsc/msc_a.c
M src/libmsc/ran_infra.c
M tests/msc_vlr/msc_vlr_tests.c
4 files changed, 47 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/31694/1
diff --git a/include/osmocom/msc/ran_infra.h b/include/osmocom/msc/ran_infra.h
index 38c424f..262a9c8 100644
--- a/include/osmocom/msc/ran_infra.h
+++ b/include/osmocom/msc/ran_infra.h
@@ -4,6 +4,7 @@
#include <osmocom/gsm/gsup.h>
#include <osmocom/msc/sccp_ran.h>
#include <osmocom/msc/ran_msg.h>
+#include <osmocom/msc/sdp_msg.h>
struct osmo_tdef;
@@ -25,6 +26,10 @@
const ran_dec_l2_t ran_dec_l2;
const ran_encode_t ran_encode;
struct sccp_ran_inst *sri;
+ /* To always set up the MGW endpoint facing the RAN side with specific codecs, list those here. Otherwise leave
+ * empty (to use the result of codecs filtering). This exists for IuCS, to always set the MGW endpoint facing
+ * RAN to IUFP, to decapsulate the IuUP headers. */
+ struct sdp_audio_codecs force_mgw_codecs_to_ran;
};
extern struct ran_infra msc_ran_infra[];
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 4c7f763..7db1d0a 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1791,6 +1791,8 @@
return osmo_fsm_inst_dispatch(msc_a->c.fi, MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE, cl->rtp[RTP_TO_RAN]);
if (msc_a->c.ran->type == OSMO_RAT_UTRAN_IU) {
+ /* FUTURE: ran_infra->force_mgw_codecs_to_ran is intended to be used here instead of the special
+ * condition on OSMO_RAT_UTRAN_IU and the mgcp_codecs value CODEC_IUFP */
codec = CODEC_IUFP;
codec_ptr = &codec;
} else {
diff --git a/src/libmsc/ran_infra.c b/src/libmsc/ran_infra.c
index c0eaa1a..35dfd61 100644
--- a/src/libmsc/ran_infra.c
+++ b/src/libmsc/ran_infra.c
@@ -108,6 +108,16 @@
.ran_dec_l2 = ran_iu_decode_l2,
.ran_encode = ran_iu_encode,
#endif
+ .force_mgw_codecs_to_ran = {
+ .count = 1,
+ .codec = {
+ {
+ .payload_type = 96,
+ .subtype_name = "VND.3GPP.IUFP",
+ .rate = 16000,
+ },
+ },
+ },
},
[OSMO_RAT_EUTRAN_SGS] = {
.type = OSMO_RAT_EUTRAN_SGS,
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 6b80452..b0c60ed 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -408,6 +408,16 @@
.log_subsys = DIUCS,
.tdefs = msc_tdefs_utran,
.ran_encode = dont_ran_encode,
+ .force_mgw_codecs_to_ran = {
+ .count = 1,
+ .codec = {
+ {
+ .payload_type = 96,
+ .subtype_name = "VND.3GPP.IUFP",
+ .rate = 16000,
+ },
+ },
+ },
},
};
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/31694
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I37f65c36af2679ecba1040a11a9aa0eb9481d817
Gerrit-Change-Number: 31694
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/31697 )
Change subject: [codecs filter] use filter result in MT DTAP CC Setup
......................................................................
[codecs filter] use filter result in MT DTAP CC Setup
So far, we just forwarded the Bearer Capabilities received in MNCC from
the remote MO call leg, and omitted Bearer Cap if the remote call leg
did not provide any.
Instead, always include Bearer Cap, and compose it from the codecs
filter result. Hence the Bearer Cap is now an intersection of MS, BSS
and remote call leg, instead of just the remote call leg.
Related: SYS#5066
Change-Id: I9586221ef56352b7ce4b2604ae0dc04554145a78
---
M src/libmsc/gsm_04_08_cc.c
M tests/msc_vlr/msc_vlr_test_call.c
M tests/msc_vlr/msc_vlr_test_call.err
3 files changed, 58 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/31697/1
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index aaec0db..45c7b31 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -639,6 +639,7 @@
struct gsm48_hdr *gh;
struct gsm_mncc *setup = arg;
int rc, trans_id;
+ struct gsm_mncc_bearer_cap bearer_cap;
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -703,15 +704,42 @@
codec_filter_run(&trans->cc.codecs);
LOG_TRANS(trans, LOGL_DEBUG, "codecs: %s\n", codec_filter_to_str(&trans->cc.codecs));
- /* NEAR FUTURE: upcoming patch will use the codecs filter to determine the Bearer Cap to send to the MS.
- * So far just gathering information in the new codecs filter. */
- /* bearer capability */
- if (setup->fields & MNCC_F_BEARER_CAP) {
- /* Create a copy of the bearer capability in the transaction struct, so we
- * can use this information later */
- memcpy(&trans->bearer_cap, &setup->bearer_cap, sizeof(trans->bearer_cap));
- gsm48_encode_bearer_cap(msg, 0, &setup->bearer_cap);
+ /* Compose Bearer Capability information that reflects only the codecs (Speech Versions) remaining after
+ * intersecting MS, BSS and remote call leg restrictions. To store in trans for later use, and to include in
+ * the outgoing CC Setup message. */
+ bearer_cap = (struct gsm_mncc_bearer_cap){
+ .speech_ver = { -1 },
+ };
+ sdp_audio_codecs_to_bearer_cap(&bearer_cap, &trans->cc.codecs.result.audio_codecs);
+ rc = bearer_cap_set_radio(&bearer_cap);
+ if (rc) {
+ LOG_TRANS(trans, LOGL_ERROR, "Error composing Bearer Capability for CC Setup\n");
+ trans_free(trans);
+ msgb_free(msg);
+ return rc;
}
+ /* Create a copy of the bearer capability in the transaction struct, so we can use this information later */
+ /* TODO: we should be able to drop trans->bearer_cap, replaced by the codecs filter. Verify this.
+ * So far let's just store it there like previous code did. */
+ trans->bearer_cap = bearer_cap;
+ /* If no resulting codecs remain, error out. We cannot find a codec that matches both call legs. If the MGW were
+ * able to transcode, we could use non-identical codecs on each conn of the MGW endpoint, but we are aiming for
+ * finding a matching codec. */
+ if (bearer_cap.speech_ver[0] == -1) {
+ LOG_TRANS(trans, LOGL_ERROR, "%s: no codec match possible: %s\n",
+ get_mncc_name(setup->msg_type), codec_filter_to_str(&trans->cc.codecs));
+
+ /* incompatible codecs */
+ rc = mncc_release_ind(trans->net, trans, trans->callref,
+ GSM48_CAUSE_LOC_PRN_S_LU,
+ GSM48_CC_CAUSE_INCOMPAT_DEST /* TODO: correct cause code? */);
+ trans->callref = 0;
+ trans_free(trans);
+ msgb_free(msg);
+ return rc;
+ }
+ gsm48_encode_bearer_cap(msg, 0, &bearer_cap);
+
/* facility */
if (setup->fields & MNCC_F_FACILITY)
gsm48_encode_facility(msg, 0, &setup->facility);
diff --git a/tests/msc_vlr/msc_vlr_test_call.c b/tests/msc_vlr/msc_vlr_test_call.c
index 06602f7..6c7a8ad 100644
--- a/tests/msc_vlr/msc_vlr_test_call.c
+++ b/tests/msc_vlr/msc_vlr_test_call.c
@@ -316,7 +316,7 @@
VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d");
btw("MS sends SecurityModeControl acceptance, VLR accepts, sends CC Setup");
- dtap_expect_tx("0305" /* CC: Setup */);
+ dtap_expect_tx("0305" /* CC: Setup */ "04 07 60 04 05 0b 06 08 87" /* Bearer Cap */);
ms_sends_security_mode_complete(1);
btw("MS confirms call, we create a RAN-side RTP and forward MNCC_CALL_CONF_IND");
@@ -419,7 +419,7 @@
VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d");
btw("MS sends SecurityModeControl acceptance, VLR accepts, sends CC Setup");
- dtap_expect_tx("0305" /* CC: Setup */);
+ dtap_expect_tx("0305" /* CC: Setup */ "04 07 60 04 05 0b 06 08 87" /* Bearer Cap */);
ms_sends_security_mode_complete(1);
btw("MS confirms call, we create a RAN-side RTP and forward MNCC_CALL_CONF_IND");
diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err
index e3127ef..f5a6540 100644
--- a/tests/msc_vlr/msc_vlr_test_call.err
+++ b/tests/msc_vlr/msc_vlr_test_call.err
@@ -765,7 +765,7 @@
DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) new state NULL -> CALL_PRESENT
DIUCS msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: Sending DTAP: CC GSM48_MT_CC_SETUP
DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: RAN encode: DTAP on UTRAN-Iu
-- DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 0305
+- DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 030504076004050b060887
- DTAP matches expected message
DMSC dummy_msc_i(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){0}: Received Event MSC_I_EV_FROM_A_FORWARD_ACCESS_SIGNALLING_REQUEST
DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - Paging: now used by 3 (attached,CC,active-conn)
@@ -1236,7 +1236,7 @@
DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) new state NULL -> CALL_PRESENT
DIUCS msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: Sending DTAP: CC GSM48_MT_CC_SETUP
DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: RAN encode: DTAP on UTRAN-Iu
-- DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 0305
+- DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 030504076004050b060887
- DTAP matches expected message
DMSC dummy_msc_i(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){0}: Received Event MSC_I_EV_FROM_A_FORWARD_ACCESS_SIGNALLING_REQUEST
DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - Paging: now used by 3 (attached,CC,active-conn)
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/31697
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I9586221ef56352b7ce4b2604ae0dc04554145a78
Gerrit-Change-Number: 31697
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange