aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-07-16 17:02:54 +0200
committerlaforge <laforge@osmocom.org>2020-08-12 18:07:33 +0000
commite8296d285b34c4397eb0136f97453af44dfc59d4 (patch)
tree6253943023437b8f42046ac9ad778d471b5a4f75
parenta7f02c689983d0f66d415b8b91f4a011b6345ed9 (diff)
gsm_04_08_rr: block EMERGENCY SETUP when EMERGENCY CALLS are denied
If the BSC configuration is set up to deny emergency calls, make sure that an EMERGENCY SETUP will not be passed to the MSC, instead ensure that the call is released. Change-Id: Ia6eb38370ce4165d221d2ffbe1cd105c0628313c Related: OS#4548
-rw-r--r--src/osmo-bsc/gsm_04_08_rr.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index e54a93719..8bf4b2aad 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -43,6 +43,7 @@
#include <osmocom/bsc/handover_fsm.h>
#include <osmocom/bsc/gsm_08_08.h>
#include <osmocom/bsc/gsm_data.h>
+#include <osmocom/bsc/bsc_msc_data.h>
#include <osmocom/bsc/system_information.h>
#include <osmocom/bsc/bts.h>
@@ -988,6 +989,24 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
break;
}
break;
+ case GSM48_PDISC_CC:
+ /* Make sure that EMERGENCY CALLS can not be made if the
+ * VTY configuration does not permit. */
+ if (msg_type == GSM48_MT_CC_EMERG_SETUP) {
+ if (msg->lchan->ts->trx->bts->si_common.rach_control.t2 & 0x4) {
+ LOG_LCHAN(msg->lchan, LOGL_NOTICE, "MS attempts EMERGENCY SETUP although EMERGENCY CALLS"
+ " are not allowed in sysinfo (spec violation by MS!)\n");
+ lchan_release(msg->lchan, true, true, GSM48_RR_CAUSE_PREMPTIVE_REL);
+ break;
+ }
+ if (!conn->sccp.msc->allow_emerg) {
+ LOG_LCHAN(msg->lchan, LOGL_NOTICE, "MS attempts EMERGENCY SETUP, but EMERGENCY CALLS are"
+ " denied on this BSC (check BTS config!)\n");
+ lchan_release(msg->lchan, true, true, GSM48_RR_CAUSE_PREMPTIVE_REL);
+ break;
+ }
+ }
+ /* fall through */
default:
bsc_dtap(conn, link_id, msg);
break;