aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-08-08 16:03:15 +0200
committerHarald Welte <laforge@gnumonks.org>2009-08-08 16:03:15 +0200
commit76042188e09d2ea5f138474ade70e1f74f317aea (patch)
treee5575789a35674ee676ece472b75394d2e283f76 /openbsc/include/openbsc
parent1d014a5dfc45fb09cec28a7327b36ae53458ca8e (diff)
first 'working' SMS implementation
we now have the full path from the MS into the database (SUBMIT), as well as back from the database to the MS (DELIVER). The database gets correctly updated once a SMS has been successfully delivered. What's still missing is the periodic scan over all undelivered messages, trying to deliver them to the respective MS. So far, you have to manually trigger this on the telnet interface with 'sms send pending 1'
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_04_11.h23
-rw-r--r--openbsc/include/openbsc/gsm_data.h16
-rw-r--r--openbsc/include/openbsc/gsm_subscriber.h2
-rw-r--r--openbsc/include/openbsc/signal.h7
-rw-r--r--openbsc/include/openbsc/transaction.h1
5 files changed, 20 insertions, 29 deletions
diff --git a/openbsc/include/openbsc/gsm_04_11.h b/openbsc/include/openbsc/gsm_04_11.h
index 54b44c003..c59df41cc 100644
--- a/openbsc/include/openbsc/gsm_04_11.h
+++ b/openbsc/include/openbsc/gsm_04_11.h
@@ -109,29 +109,6 @@ enum sms_alphabet {
DCS_8BIT_DATA,
};
-/* SMS submit PDU */
-struct sms_submit {
- u_int8_t *smsc;
- u_int8_t mti:2; /* message type indicator */
- u_int8_t vpf:2; /* validity period format */
- u_int8_t msg_ref; /* message reference */
- u_int8_t pid; /* protocol identifier */
- u_int8_t dcs; /* data coding scheme */
- u_int8_t *vp; /* validity period */
- u_int8_t ud_len; /* user data length */
- u_int8_t *user_data; /* user data */
-
- /* interpreted */
- u_int8_t mms:1; /* more messages to send */
- u_int8_t srr:1; /* status report request */
- u_int8_t udhi:1; /* user data headre indication */
- u_int8_t rp:1; /* request for reply path */
- enum sms_alphabet alphabet;
- char dest_addr[20+1]; /* DA LV is 12 bytes max, i.e. 10 bytes BCD == 20 bytes string */
- unsigned long validity_mins;
- char decoded[256];
-};
-
/* GSM 03.40 / Chapter 9.2.3.1: TP-Message-Type-Indicator */
#define GSM340_SMS_DELIVER_SC2MS 0x00
#define GSM340_SMS_DELIVER_REP_MS2SC 0x00
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 7c776131a..663c8698b 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -361,13 +361,17 @@ struct gsm_sms {
struct gsm_subscriber *receiver;
unsigned long validity_minutes;
- unsigned char reply_path_req;
- unsigned char status_rep_req;
- unsigned char protocol_id;
- unsigned char data_coding_scheme;
+ u_int8_t reply_path_req;
+ u_int8_t status_rep_req;
+ u_int8_t ud_hdr_ind;
+ u_int8_t protocol_id;
+ u_int8_t data_coding_scheme;
+ u_int8_t msg_ref;
+ char dest_addr[20+1]; /* DA LV is 12 bytes max, i.e. 10 bytes
+ * BCD == 20 bytes string */
+ u_int8_t user_data_len;
+ u_int8_t user_data[SMS_TEXT_SIZE];
- unsigned int header_len;
- unsigned char header[SMS_HDR_SIZE];
char text[SMS_TEXT_SIZE];
};
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index f1822308d..3efb20c03 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -67,6 +67,8 @@ struct gsm_subscriber *subscr_get_by_imsi(struct gsm_network *net,
const char *imsi);
struct gsm_subscriber *subscr_get_by_extension(struct gsm_network *net,
const char *ext);
+struct gsm_subscriber *subscr_get_by_id(struct gsm_network *net,
+ unsigned long long id);
int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason);
void subscr_put_channel(struct gsm_lchan *lchan);
void subscr_get_channel(struct gsm_subscriber *subscr,
diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h
index 1b96a6026..dea634462 100644
--- a/openbsc/include/openbsc/signal.h
+++ b/openbsc/include/openbsc/signal.h
@@ -46,6 +46,13 @@ enum signal_paging {
S_PAGING_COMPLETED,
};
+/* SS_SMS signals */
+enum signal_sms {
+ S_SMS_SUBMITTED, /* A SMS has been successfully submitted to us */
+ S_SMS_DELIVERED, /* A SMS has been successfully delivered to a MS */
+ S_SMS_SMMA, /* A MS tells us it has more space available */
+};
+
/* SS_ABISIP signals */
enum signal_abisip {
S_ABISIP_BIND_ACK,
diff --git a/openbsc/include/openbsc/transaction.h b/openbsc/include/openbsc/transaction.h
index ad6fe35be..5678c83e7 100644
--- a/openbsc/include/openbsc/transaction.h
+++ b/openbsc/include/openbsc/transaction.h
@@ -44,6 +44,7 @@ struct gsm_trans {
enum gsm411_rp_state rp_state;
struct timer_list timer;
+ struct gsm_sms *sms;
} sms;
};
};