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
This commit is contained in:
Vadim Yanitskiy 2018-06-12 06:26:28 +07:00
parent f5b9e6cdf6
commit 9aec25e464
1 changed files with 6 additions and 5 deletions

View File

@ -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;
}