path: root/tests
diff options
authorHarald Welte <laforge@gnumonks.org>2009-03-30 20:56:32 +0000
committerHarald Welte <laforge@gnumonks.org>2009-03-30 20:56:32 +0000
commit7e310b12ff120bdfd4b98eb52d10b013b00a2eaa (patch)
tree75e704d9e7a1c32214ecf72d59ce7076329642b2 /tests
parent93d9303331b7e103da810e851db1adb1fcf57f6d (diff)
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.
Diffstat (limited to 'tests')
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.c
index bd628d19..2b55b97f 100644
--- a/tests/sms/sms_test.c
+++ b/tests/sms/sms_test.c
@@ -80,8 +80,11 @@ int main(int argc, char** argv)
/* test 7-bit coding/decoding */
const char *input = "test text";
u_int8_t length;
- u_int8_t *coded = gsm_7bit_encode(input, &length);
- char *result = gsm_7bit_decode(coded, length);
+ u_int8_t coded[256];
+ char result[256];
+ length = gsm_7bit_encode(coded, input);
+ gsm_7bit_decode(result, coded, length);
if (strcmp(result, input) != 0) {
printf("7 Bit coding failed... life sucks\n");
printf("Wanted: '%s' got '%s'\n", input, result);