From 9aec25e464865573acc7ccde92f471a1af799cd6 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Tue, 12 Jun 2018 06:26:28 +0700 Subject: libmsc/gsm_09_11.c: properly indicate transaction errors Previously it was intended that we are always parsing the whole GSM 04.80 message, including the Invoke ID. But there is no need to do that, since we are going to forward the Facility IE payload to HLR in near future. Moreover, there was a mistake (my bad) - transaction is being established before parsing of the message, so the req structure remains uninitialized until that. Let's just send RELEASE COMPLETE message without any Cause or Facility IEs. We could indicate a problem using the first one, but according to GSM TS 04.80, the Cause IE only makes sense when "its functional handling is specified in the service description or GSM TS 09.11". Change-Id: Iecba2dccada9bbcdeb3a9dfd868719aeedc07022 --- src/libmsc/gsm_09_11.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c index 8f7e54fac..fc588f5c2 100644 --- a/src/libmsc/gsm_09_11.c +++ b/src/libmsc/gsm_09_11.c @@ -94,9 +94,9 @@ int gsm0911_rcv_nc_ss(struct gsm_subscriber_connection *conn, struct msgb *msg) LOGP(DMM, LOGL_ERROR, "Unexpected message (msg_type=%s), " "transaction is not allocated yet\n", gsm48_pdisc_msgtype_name(pdisc, msg_type)); - gsm0480_send_ussd_reject(conn, &req, - GSM_0480_PROBLEM_CODE_TAG_GENERAL, - GSM_0480_GEN_PROB_CODE_UNRECOGNISED); + gsm48_tx_simple(conn, + GSM48_PDISC_NC_SS | (tid << 4), + GSM0480_MTYPE_RELEASE_COMPLETE); return -EINVAL; } @@ -105,8 +105,9 @@ int gsm0911_rcv_nc_ss(struct gsm_subscriber_connection *conn, struct msgb *msg) pdisc, tid, new_callref++); if (!trans) { DEBUGP(DMM, " -> No memory for trans\n"); - gsm0480_send_ussd_return_error(conn, &req, - GSM0480_ERR_CODE_SYSTEM_FAILURE); + gsm48_tx_simple(conn, + GSM48_PDISC_NC_SS | (tid << 4), + GSM0480_MTYPE_RELEASE_COMPLETE); return -ENOMEM; } -- cgit v1.2.3