Store incoming SMS into SQL database
* gsm_util now uses caller-allocated data (rather than callee-allocated)
* correctly parse destination address
* parse (but not transcode) non-default encodings of SMS
* reject SMS to unknown destination number
* resolve target subscriber id and store incoming SMS (without header) in 'sms' table
What we're now missing is the sending part, i.e. a regular task iterating over
all pending SMS and trying to deliver them. Also, check for pending SMS once
we get a LOCATION UPDATE.
diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h
index 84d33d2..614c63d 100644
--- a/include/openbsc/gsm_data.h
+++ b/include/openbsc/gsm_data.h
@@ -317,6 +317,17 @@
struct gsm_bts bts[GSM_MAX_BTS+1];
};
+#define SMS_HDR_SIZE 128
+#define SMS_TEXT_SIZE 256
+struct gsm_sms {
+ u_int64_t id;
+ struct gsm_subscriber *sender;
+ struct gsm_subscriber *receiver;
+
+ unsigned char header[SMS_HDR_SIZE];
+ char text[SMS_TEXT_SIZE];
+};
+
struct gsm_network *gsm_network_init(unsigned int num_bts, enum gsm_bts_type bts_type,
u_int16_t country_code, u_int16_t network_code);