aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/gsm_04_08_cc.c
diff options
context:
space:
mode:
authorKeith Whyte <keith@rhizomatica.org>2019-08-08 15:43:40 +0200
committergsmevent admin <admin@gsmevent.box>2019-08-24 15:48:42 +0200
commit5b47ac2bf6c97cc4fbbbd5567bcec61478a2eb55 (patch)
treed24d641c9b77c0b58539e3cc28ba695a05021198 /src/libmsc/gsm_04_08_cc.c
parent9e6ec575879050db9878e31fe801017222be5542 (diff)
Implement a global switch on the network to disable call waiting.cccamp2019
Add a network -> callwaiting VTY command as boolean. When this is enabled (default) there is no change to operation previous to this commit. When this switch is disabled with "no call-waiting" in vty then when a call arrives, we will check if we have an active call transaction for this subscriber, no matter if it is establishing, established, or alerting, in any of these cases we will return USER BUSY to the calling party. Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae
Diffstat (limited to 'src/libmsc/gsm_04_08_cc.c')
-rw-r--r--src/libmsc/gsm_04_08_cc.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index c941a7a29..71871bfaa 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1904,6 +1904,25 @@ static int mncc_tx_to_gsm_cc(struct gsm_network *net, const union mncc_msg *msg)
GSM48_CAUSE_LOC_PRN_S_LU,
GSM48_CC_CAUSE_DEST_OOO);
}
+
+ /* Find valid conn */
+ msc_a = msc_a_for_vsub(vsub, true);
+
+ /* If subscriber is BUSY and we do not DO call in call aka "call-waiting" */
+ if (!net->call_waiting && msc_a) {
+ struct gsm_trans *existing_cc_trans = trans_find_by_type(msc_a, TRANS_CC);
+ if (existing_cc_trans && existing_cc_trans->cc.state != GSM_CSTATE_NULL) {
+ LOG_TRANS_CAT(existing_cc_trans, DCC, LOGL_NOTICE,
+ "rx '%s' for subscriber %s with trans state (%s)"
+ " rejecting with USER_BUSY\n",
+ get_mncc_name(msg->msg_type), data->called.number,
+ gsm48_cc_state_name(existing_cc_trans->cc.state));
+ return mncc_release_ind(net, NULL, data->callref,
+ GSM48_CAUSE_LOC_PRN_S_LU,
+ GSM48_CC_CAUSE_USER_BUSY);
+ }
+ }
+
/* Create transaction */
trans = trans_alloc(net, vsub, TRANS_CC,
TRANS_ID_UNASSIGNED, data->callref);
@@ -1917,9 +1936,6 @@ static int mncc_tx_to_gsm_cc(struct gsm_network *net, const union mncc_msg *msg)
return -ENOMEM;
}
- /* Find valid conn */
- msc_a = msc_a_for_vsub(vsub, true);
-
/* If subscriber has no conn */
if (!msc_a) {