ussd: Reject and release unhandled SS requests/interrogation
In case the unpack of a USSD request is failing the channel would
remain open and the phone would not receive a response. Simply
reject the interrogation.
Example interrogation:
0000 1b 7b 1c 0d a1 0b 02 01 01 02 01 0e 30 03 04 01
0010 11 7f 01 00
diff --git a/openbsc/src/libmsc/ussd.c b/openbsc/src/libmsc/ussd.c
index b413c83..7f01eae 100644
--- a/openbsc/src/libmsc/ussd.c
+++ b/openbsc/src/libmsc/ussd.c
@@ -51,7 +51,15 @@
memset(&req, 0, sizeof(req));
gh = msgb_l3(msg);
rc = gsm0480_decode_ussd_request(gh, msgb_l3len(msg), &req);
- if (req.text[0] == '\0') /* Release-Complete */
+ if (!rc) {
+ DEBUGP(DMM, "Unhandled SS\n");
+ rc = gsm0480_send_ussd_reject(conn, msg, &req);
+ msc_release_connection(conn);
+ return rc;
+ }
+
+ /* Release-Complete */
+ if (req.text[0] == '\0')
return 0;
if (!strcmp(USSD_TEXT_OWN_NUMBER, (const char *)req.text)) {