From ea730327d10ea79d50829487474d43344bad5a62 Mon Sep 17 00:00:00 2001 From: Tobias Engel Date: Sat, 28 Dec 2013 17:03:14 +0100 Subject: 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 --- openbsc/src/libmsc/ussd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openbsc/src/libmsc/ussd.c b/openbsc/src/libmsc/ussd.c index b413c83ba..7f01eae71 100644 --- a/openbsc/src/libmsc/ussd.c +++ b/openbsc/src/libmsc/ussd.c @@ -51,7 +51,15 @@ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg) 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)) { -- cgit v1.2.3