libosmogsm  0.9.3
Osmocom GSM library
include/osmocom/gsm/gsm0480.h
00001 #pragma once
00002 
00003 #include <osmocom/core/defs.h>
00004 #include <osmocom/core/msgb.h>
00005 #include <osmocom/gsm/protocol/gsm_04_08.h>
00006 #include <osmocom/gsm/protocol/gsm_04_80.h>
00007 
00008 #define MAX_LEN_USSD_STRING     31
00009 
00010 /* deprecated */
00011 struct ussd_request {
00012         char text[MAX_LEN_USSD_STRING + 1];
00013         uint8_t transaction_id;
00014         uint8_t invoke_id;
00015 };
00016 
00017 /* deprecated */
00018 int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len,
00019                                 struct ussd_request *request) OSMO_DEPRECATED("Use gsm0480_decode_ss_request() instead");
00020 
00021 struct ss_request {
00022         uint8_t opcode;
00023         uint8_t ss_code;
00024         uint8_t ussd_text[MAX_LEN_USSD_STRING + 1];
00025         uint8_t transaction_id;
00026         uint8_t invoke_id;
00027 };
00028 
00029 int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len,
00030                                 struct ss_request *request);
00031 
00032 struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text);
00033 struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text);
00034 struct msgb *gsm0480_create_notifySS(const char *text);
00035 
00036 int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id);
00037 int gsm0480_wrap_facility(struct msgb *msg);