mirror of https://gerrit.osmocom.org/libosmocore
ussd: Decode interrogateSS that doesn't have test
Keith of Rhizomatica has an issue of a unrejected interrogateSS. Start with just decoding the message and printing the empty test and the code. What is kind of missing is the classification between invoke, returnResult and returnResultLast that we need to add in the long run. Change-Id: Iadfa156707a96f2a34f3948c7cc9a74435f17114
This commit is contained in:
parent
9394dbd8e0
commit
4a62dbbfa9
|
@ -34,6 +34,12 @@ static const uint8_t ussd_request[] = {
|
|||
0x01, 0x7f, 0x01, 0x00
|
||||
};
|
||||
|
||||
static const uint8_t interrogate_ss[] = {
|
||||
0x0b, 0x7b, 0x1c, 0x0d, 0xa1, 0x0b, 0x02, 0x01,
|
||||
0x03, 0x02, 0x01, 0x0e, 0x30, 0x03, 0x04, 0x01,
|
||||
0x21, 0x7f, 0x01, 0x00
|
||||
};
|
||||
|
||||
static int parse_ussd(const uint8_t *_data, int len)
|
||||
{
|
||||
uint8_t *data;
|
||||
|
@ -120,9 +126,15 @@ int main(int argc, char **argv)
|
|||
|
||||
osmo_init_logging(&info);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
gsm0480_decode_ss_request((struct gsm48_hdr *) ussd_request, size, &req);
|
||||
printf("Tested if it still works. Text was: %s\n", req.ussd_text);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
gsm0480_decode_ss_request((struct gsm48_hdr *) interrogate_ss, size, &req);
|
||||
OSMO_ASSERT(strlen((char *) req.ussd_text) == 0);
|
||||
OSMO_ASSERT(req.ss_code == 33);
|
||||
printf("interrogateSS CFU text..'%s' code %d\n", req.ussd_text, req.ss_code);
|
||||
|
||||
printf("Testing parsing a USSD request and truncated versions\n");
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
Tested if it still works. Text was: **321#
|
||||
interrogateSS CFU text..'' code 33
|
||||
Testing parsing a USSD request and truncated versions
|
||||
Result for 1 is 28
|
||||
Result for 1 is 27
|
||||
|
|
Loading…
Reference in New Issue