libmsc/gsm_09_11.c: send GSUP PROS_SS ERROR message when needed

OsmoMSC should notify the remote SS/USSD entity if:

  - received GSUP message has unexpected session state;
  - received GSUP message has unknown session ID;
  - received GSUP message missing mandatory IE(s);
  - NCSS transaction establishment failed;
  - NCSS message delivery failed.

Change-Id: Ief9f8a197b0860072b671edfc55180f619860d9d
Related: (TTCN-3) Ie267ee174c5061cd3fc102a2824abe03d73f3aac
Related: OS#2931
This commit is contained in:
Vadim Yanitskiy 2019-06-15 14:44:46 +07:00
parent 04bbfb83d4
commit efb1f60c76
1 changed files with 4 additions and 3 deletions

View File

@ -475,7 +475,7 @@ int gsm0911_gsup_rx(struct gsup_client_mux *gcm, void *data, const struct osmo_g
/* Attempt to establish a new transaction */
trans = establish_nc_ss_trans(net, vsub, gsup_msg);
if (!trans) {
/* FIXME: send ERROR back to the HLR */
gsup_client_mux_tx_error_reply(gcm, gsup_msg, GMM_CAUSE_NET_FAIL);
return -EINVAL;
}
@ -520,7 +520,7 @@ int gsm0911_gsup_rx(struct gsup_client_mux *gcm, void *data, const struct osmo_g
default:
LOG_TRANS(trans, LOGL_ERROR, "Unexpected session state %d\n",
gsup_msg->session_state);
/* FIXME: send ERROR back to the HLR */
gsup_client_mux_tx_error_reply(gcm, gsup_msg, GMM_CAUSE_MSGT_INCOMP_P_STATE);
msgb_free(ss_msg);
return -EINVAL;
}
@ -530,7 +530,7 @@ int gsm0911_gsup_rx(struct gsup_client_mux *gcm, void *data, const struct osmo_g
if (!gsup_msg->ss_info || gsup_msg->ss_info_len < 2) {
LOG_TRANS(trans, LOGL_ERROR, "Missing mandatory Facility IE "
"for mapped 0x%02x message\n", gh->msg_type);
/* FIXME: send ERROR back to the HLR */
gsup_client_mux_tx_error_reply(gcm, gsup_msg, GMM_CAUSE_INV_MAND_INFO);
msgb_free(ss_msg);
return -EINVAL;
}
@ -553,6 +553,7 @@ int gsm0911_gsup_rx(struct gsup_client_mux *gcm, void *data, const struct osmo_g
msc_a = trans->msc_a;
if (!msc_a) {
LOG_TRANS(trans, LOGL_ERROR, "Cannot send SS message, no local MSC-A role defined for subscriber\n");
gsup_client_mux_tx_error_reply(gcm, gsup_msg, GMM_CAUSE_NET_FAIL);
msgb_free(ss_msg);
return -EINVAL;
}