aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-06-08 17:13:44 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-06-08 17:13:44 +0700
commit635f98cf31d20008b9726ef82ba87e172c49f264 (patch)
treeb3a845c0984e0f159d935643243edd230bcd0149 /include
parent5046db98b106a3c583d7fe296e0748f1bde34629 (diff)
libmsc/ussd.c: FIX: properly indicate errors
There are error and problem codes defined by GSM TS 04.80: - Error codes are used when a message is structured correctly, but something is wrong in context of the current operation. Usually they are carried by 'Return Error' component. - Problem codes are used when something is wrong with the message structure, or with carried values. They are carried by 'Reject' component. There are three groups of them (see table 3.13): - General Problem Codes (table 3.14), - Invoke Problem Codes (table 3.15), - Return Result Problem Codes (table 3.16), - Return Error Problem Codes (table 3.17). The first group is general purpose, and can be sent in response to any kind of message, excluding 'Reject' itself. Other ones are bound to specific component types, such as 'Invoke', 'Return Result' and 'Return Error'. For some reason, a 'Reject' component with the general problem code 'GSM_0480_GEN_PROB_CODE_UNRECOGNISED' was always used in OsmoMSC. Even when the message structure is correct. Let's properly indicate errors in the following way: - 'Reject' with GSM_0480_GEN_PROB_CODE_UNRECOGNISED when the gsm0480_decode_ss_request() fails to decode a message. It can only return 0 or 1, so it's hard to guess which exact part of message caused the error. - 'Return Error' with GSM0480_ERR_CODE_ILLEGAL_SS_OPERATION when the operation code is not related to USSD. - 'Return Error' with GSM0480_ERR_CODE_UNEXPECTED_DATA_VALUE when the requested USSD code is unhandled (not supported). There is a TTCN-3 testcase for this: https://gerrit.osmocom.org/9470/ Change-Id: I800e7ec98dc9d0bca2d45a8b8255d60253d63e14
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/msc/gsm_04_80.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h
index dedf2438a..fb057c8db 100644
--- a/include/osmocom/msc/gsm_04_80.h
+++ b/include/osmocom/msc/gsm_04_80.h
@@ -9,8 +9,12 @@ struct gsm_subscriber_connection;
int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn,
const char* response_text,
const struct ss_request *req);
+int gsm0480_send_ussd_return_error(struct gsm_subscriber_connection *conn,
+ const struct ss_request *req,
+ uint8_t error_code);
int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn,
- const struct ss_request *request);
+ const struct ss_request *req,
+ uint8_t error_tag, uint8_t error_code);
int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level,
const char *text);