Attention is currently required from: neels.
2 comments:
File src/hlr_ussd.c:
Patch Set #2, Line 146: /* do not abort, attempt to decode as if it was '1111'B */
I guess here we should rather fail? […]
I don't have a strong opinion here. Reading the AT command reference documents of other modems (mostly Ericsson ones) I see `DCS 0x00` (German) is also the default for them. Passing `,15` all the time is annoying, so I thought it would not hurt if we ignore the language in the message initiating a USSD session. The language should not really matter for the initial request message, since the charset is usually limited to `[0-9*#]`.
Patch Set #2, Line 150: req->ussd_data, (req->ussd_data_len * 8) / 7);
Could you help me understand plz: […]
I need to give you some historical context then. IIRC, prior to my patches dating back to 2018 neither the `ussd_data_dcs` field nor the `ussd_data[_len]` fields existed in `struct ss_request`. All we had is the `ussd_text` field, which may contain ASCII text or raw bytes depending on DCS. The `gsm0480_parse_facility_ie()` does call `gsm_7bit_decode_n_ussd()` internally if `DCS == 0x0f`, otherwise it does `memcpy()` raw bytes to the `ussd_text` field.
In 2018 it was decided to deprecate the `ussd_text` field and expose the raw bytes + DCS to the API user, so that the end user can perform decoding if needed and as needed. The internal call to `gsm_7bit_decode_n_ussd()` was preserved for backwards compatibility.
When adding the SS/USSD support to osmo-hlr, Harald used the old `ussd_text` field, and this is where the problem is. As I said above, despite having `text` in the name, this field may contain either an ASCII string or raw bytes. So I decided to move away from using it and migrate to `ussd_data[_len]` fields in this patch.
The simplest thing I could do is to not touch the code and keep using the old `ussd_text` field, and ensure that DCS is exactly 0x0f before doing that. But I wanted to make code more tolerant to DCS values != 0x0f and still parse the requests if the language != 15.
To view, visit change 33528. To unsubscribe, or for help writing mail filters, visit settings.