libosmogsm
0.11.0-dirty
Osmocom GSM library
|
00001 00003 #pragma once 00004 00005 #include <osmocom/core/defs.h> 00006 #include <osmocom/core/msgb.h> 00007 #include <osmocom/gsm/protocol/gsm_04_08.h> 00008 #include <osmocom/gsm/protocol/gsm_04_80.h> 00009 00015 #define GSM0480_USSD_OCTET_STRING_LEN 160 00016 00023 #define GSM0480_USSD_7BIT_STRING_LEN 182 00024 00030 #define MAX_LEN_USSD_STRING 31 00031 00032 /* deprecated */ 00033 struct ussd_request { 00034 char text[MAX_LEN_USSD_STRING + 1]; 00035 uint8_t transaction_id; 00036 uint8_t invoke_id; 00037 }; 00038 00039 /* deprecated */ 00040 int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len, 00041 struct ussd_request *request) OSMO_DEPRECATED("Use gsm0480_decode_ss_request() instead"); 00042 00047 struct ss_request { 00052 uint8_t opcode; 00058 uint8_t ss_code; 00059 00067 uint8_t ussd_text[GSM0480_USSD_OCTET_STRING_LEN]; 00068 00077 uint8_t ussd_data[GSM0480_USSD_OCTET_STRING_LEN]; 00078 uint8_t ussd_data_len; /* Length in bytes */ 00079 uint8_t ussd_data_dcs; /* Data Coding Scheme */ 00080 00085 uint8_t transaction_id; 00091 uint8_t invoke_id; 00092 }; 00093 00094 int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, 00095 struct ss_request *request); 00096 00097 struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); 00098 struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); 00099 struct msgb *gsm0480_create_notifySS(const char *text); 00100 struct msgb *gsm0480_create_ussd_notify(int level, const char *text); 00101 struct msgb *gsm0480_create_ussd_release_complete(void); 00102 00103 int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id); 00104 int gsm0480_wrap_facility(struct msgb *msg); 00105 00106 struct gsm48_hdr *gsm0480_l3hdr_push(struct msgb *msg, uint8_t proto_discr, 00107 uint8_t msg_type);