aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-02-15 11:43:59 +0100
committerMax <msuraev@sysmocom.de>2017-02-21 16:24:37 +0000
commita66d8cfcb530240b5eebdb8f3ad10aaa027bcbde (patch)
tree67a1a10217fd84a262d705a5f60d4c78bc6926c9 /openbsc
parenta1613695d1472e61c85706a8daeb2f83ba5364dd (diff)
Handle DSD from HLR
Handle Delete Subscriber Data GSUP message from HLR to disable Packet Services for a given IMSI. Change-Id: I6b9b494fa58bcb95bd550c49f8204f00f8fdf628 Related: OS#1645
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/gprs/gprs_subscriber.c34
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c3
2 files changed, 27 insertions, 10 deletions
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c
index d3e2ea748..57f73c5da 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -357,6 +357,26 @@ static int gprs_subscr_handle_gsup_upd_loc_res(struct gsm_subscriber *subscr,
return 0;
}
+static int gprs_subscr_handle_gsup_dsd_req(struct gsm_subscriber *subscr,
+ struct osmo_gsup_message *gsup_msg)
+{
+ struct osmo_gsup_message gsup_reply = {0};
+
+ if (gsup_msg->cn_domain != OSMO_GSUP_CN_DOMAIN_PS) {
+ LOGGSUBSCRP(LOGL_ERROR, subscr,
+ "Rx GSUP message %s not supported for CS\n",
+ osmo_gsup_message_type_name(gsup_msg->message_type));
+ gsup_reply.cause = GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL;
+ gsup_reply.message_type = OSMO_GSUP_MSGT_DELETE_DATA_ERROR;
+ } else {
+ gsm0408_gprs_access_cancelled(subscr->sgsn_data->mm,
+ GMM_CAUSE_GPRS_NOTALLOWED);
+ gsup_reply.message_type = OSMO_GSUP_MSGT_DELETE_DATA_RESULT;
+ }
+
+ return gprs_subscr_tx_gsup_message(subscr, &gsup_reply);
+}
+
static int gprs_subscr_handle_gsup_isd_req(struct gsm_subscriber *subscr,
struct osmo_gsup_message *gsup_msg)
{
@@ -644,7 +664,8 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg)
}
LOGGSUBSCRP(LOGL_INFO, subscr,
- "Received GSUP message of type 0x%02x\n", gsup_msg.message_type);
+ "Received GSUP message %s\n",
+ osmo_gsup_message_type_name(gsup_msg.message_type));
switch (gsup_msg.message_type) {
case OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST:
@@ -680,18 +701,13 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg)
break;
case OSMO_GSUP_MSGT_DELETE_DATA_REQUEST:
- LOGGSUBSCRP(LOGL_ERROR, subscr,
- "Rx GSUP message type %d not yet implemented\n",
- gsup_msg.message_type);
- gprs_subscr_tx_gsup_error_reply(subscr, &gsup_msg,
- GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL);
- rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL;
+ rc = gprs_subscr_handle_gsup_dsd_req(subscr, &gsup_msg);
break;
default:
LOGGSUBSCRP(LOGL_ERROR, subscr,
- "Rx GSUP message type %d not valid at SGSN\n",
- gsup_msg.message_type);
+ "Rx GSUP message %s not valid at SGSN\n",
+ osmo_gsup_message_type_name(gsup_msg.message_type));
if (OSMO_GSUP_IS_MSGT_REQUEST(gsup_msg.message_type))
gprs_subscr_tx_gsup_error_reply(
subscr, &gsup_msg, GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL);
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index 0aa142ff9..ff07978c0 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -634,7 +634,8 @@ static void test_subscriber_gsup(void)
/* Inject DeleteSubscrData GSUP message */
last_updated_subscr = NULL;
rc = rx_gsup_message(delete_data_req, sizeof(delete_data_req));
- OSMO_ASSERT(rc == -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL);
+ if (rc != -GMM_CAUSE_SEM_INCORR_MSG)
+ printf("Unexpected response to DSD: %d\n", rc);
OSMO_ASSERT(last_updated_subscr == NULL);
/* Inject wrong LocCancelReq GSUP message */