aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-02-05 19:17:31 +0100
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-02-09 18:34:40 +0100
commitdd466cfa59ee9af114c83df34e4bd74450503db2 (patch)
tree8d660bf6dd05ecfa070f3a3f3ed2c7bd5b96f586 /src
parentdbb3c723a40bdd789a171defcf075162b2e01d62 (diff)
fix _gsm48_cc_trans_free(): send MNCC REL.ind on Clear Request
Calling gsm48_cc_tx_release() before mncc_release_ind() has a side effect: the former may change CC state to GSM_CSTATE_RELEASE_REQ. This makes the later send MNCC_REL_CNF instead of MNCC_REL_IND, so if one of the call leg disconnects due to RF failure, the other one will not be terminated correctly. Makes both TC_{mo,mt}_call_clear_request TTCN-3 test cases pass. Change-Id: I3ad4a99757878de3796027325627c87d9a4e93f1 Related: Id16969fe0de04445d1320a96d35cf1d48cc8cf09 Related: SYS#5340
Diffstat (limited to 'src')
-rw-r--r--src/libmsc/gsm_04_08_cc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index ed29e8494..704e5964e 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -272,6 +272,13 @@ void _gsm48_cc_trans_free(struct gsm_trans *trans)
/* send release to L4, if callref still exists */
if (trans->callref) {
+ /* Send MNCC REL.ind (cause='Resource unavailable') */
+ if (trans->cc.mncc_initiated) {
+ mncc_release_ind(trans->net, trans, trans->callref,
+ GSM48_CAUSE_LOC_PRN_S_LU,
+ GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
+ }
+
/* FIXME: currently, a CC trans that would not yet be in state GSM_CSTATE_RELEASE_REQ fails to send a
* CC Release to the MS if it gets freed here. Hack it to do so. */
if (trans->cc.state != GSM_CSTATE_RELEASE_REQ) {
@@ -280,11 +287,6 @@ void _gsm48_cc_trans_free(struct gsm_trans *trans)
mncc_set_cause(&rel, GSM48_CAUSE_LOC_PRN_S_LU, GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
gsm48_cc_tx_release(trans, &rel);
}
- /* Resource unavailable */
- if (trans->cc.mncc_initiated)
- mncc_release_ind(trans->net, trans, trans->callref,
- GSM48_CAUSE_LOC_PRN_S_LU,
- GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
/* This is a final freeing of the transaction. The MNCC release may have triggered the
* T308 release timer, but we don't have the luxury of graceful CC Release here. */
gsm48_stop_cc_timer(trans);