laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/32035 )
Change subject: fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask
......................................................................
fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask
In sccp_scoc_states, allow the state transitions present in
S_WAIT_CONN_CONF's event handler function scoc_fsm_wait_conn_conf(), and
thus fix handling of N-DISCONNECT while waiting for SCCP Conn Confirm.
Fixes this error:
DLSCCP ERROR SCCP-SCOC(1016){WAIT_CONN_CONF}: transition to state IDLE not permitted! (sccp_scoc.c:1213)
S_WAIT_CONN_CONF happens when the caller sends an N-DISCONNECT during
S_CONN_PEND_OUT -- that means, while we are waiting for a CC from the
peer, the caller ends the conn. SCCP-SCOC still waits for the CC first.
When S_WAIT_CONN_CONF expires, the intended path is state change to
S_IDLE, which then deallocates the connection. Allow this state
transition from S_WAIT_CONN_CONF to S_IDLE.
When S_WAIT_CONN_CONF receives a CC, the intended path is to send a
RELRE and state change to S_DISCONN_PEND. Allow this state transition
from S_WAIT_CONN_CONF to S_DISCONN_PEND.
Change-Id: I8145e53124cabd76bd2cee159ab01306a1afaa27
---
M src/sccp_scoc.c
1 file changed, 31 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c
index db1db23..c929ed6 100644
--- a/src/sccp_scoc.c
+++ b/src/sccp_scoc.c
@@ -1468,6 +1468,8 @@
S(SCOC_E_CONN_TMR_EXP) |
S(SCOC_E_RCOC_CREF_IND) |
S(SCOC_E_RCOC_ROUT_FAIL_IND),
+ .out_state_mask = S(S_IDLE) |
+ S(S_DISCONN_PEND),
},
};
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/32035
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I8145e53124cabd76bd2cee159ab01306a1afaa27
Gerrit-Change-Number: 32035
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Attention is currently required from: neels.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32036 )
Change subject: map_sccp: on timeout during WAIT_CC, send N-DISCONNECT to SCCP-SCOC
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/32036
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ie94fcee4e2507a55449050aab96307199aed99a2
Gerrit-Change-Number: 32036
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 24 Mar 2023 07:31:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31765 )
Change subject: hnbgw: add f_rua_expect()
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
> > An altstep cannot have a return value […]
The deeper point is that i don't really want to have an altstep that can be integrated into other altsteps, I want these functions to specifically expect a given message within a limited time, so that i get nicer test failure logging without the need to search far and wide which message may have gone missing. For this, a function is better suited than an altstep. If we ever need altsteps too, then we can find a nifty way to reduce code dup, but so far i only want those parts for which functions are suited well.
(altstep inout parameters have nontrivial limitations on the scoping.)
(i don't want to have to start a timer externally whenever calling f_rua_expect(), i want a convenient implicit timer)
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31765
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: I29e6b7659ba53efee9f676197b502f79780ead7e
Gerrit-Change-Number: 31765
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 24 Mar 2023 03:57:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/31697 )
(
6 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)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(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 269fd57..f0aca9c 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -695,6 +695,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));
@@ -759,15 +760,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 d97806d..e1d2f4d 100644
--- a/tests/msc_vlr/msc_vlr_test_call.err
+++ b/tests/msc_vlr/msc_vlr_test_call.err
@@ -761,7 +761,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)
@@ -1230,7 +1230,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: 8
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged