diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-04-04 19:25:38 +0700 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-05-29 19:23:42 +0000 |
commit | fb5da89579c78d91221e517ef5aa0eb43f90cb5d (patch) | |
tree | cd8fa5b413dda25e56e3f2299faa318e2df4dae7 | |
parent | 07f075d197d7bf7befcfce419d5fef6013a764ef (diff) |
gsm0480: fix: don't overwrite the data of RELEASE_COMPLETE
According to the 3GPP TS 04.80, table 2.5 'Release complete', a
RELEASE_COMPLETE message may containg optional FACILITY element.
Meanwhile, the 0xff byte is used to indicate that there is no
decoded message (legacy field). Let's avoid overwriting of
a decoded message.
Change-Id: I0c85292222749a48ca0c4b2e93f4fa2d61468c18
-rw-r--r-- | src/gsm/gsm0480.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 636f2678..5c73e5b8 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -296,11 +296,15 @@ static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request case GSM0480_MTYPE_RELEASE_COMPLETE: LOGP(0, LOGL_DEBUG, "SS Release Complete\n"); + /** + * Indicates that there is no decoded message. + * To be overwriten by the message otherwise. + */ + req->ussd_text[0] = 0xFF; + /* Parse optional Cause and/or Facility data */ if (len >= 2) rc &= parse_ss_info_elements(&hdr->data[0], len, req); - - req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: rc &= parse_ss_info_elements(&hdr->data[0], len, req); |