File: test-sms.c

package info (click to toggle)
vvmd 1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 828 kB
  • sloc: ansic: 7,815; cpp: 138; xml: 86; sh: 38; python: 6; makefile: 4
file content (529 lines) | stat: -rw-r--r-- 21,344 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
/*
 *
 *  Visual Voicemail Daemon
 *
 *  Copyright (C) 2022, Chris Talbot <chris@talbothome.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/mman.h>

#include <glib.h>
#include <glib/gprintf.h>

#include "vvmutil.h"

static void
test_sms (gconstpointer data)
{
  struct sms_control_message *sms_msg = NULL;

  /****************OMTP***********************/
  //This is an example SYNC Message from OTMP VVM Specification:
  const char otmp_sync_sms_0[] = "//VVM:SYNC:ev=NM;id=3446456;c=1;t=v;s=01234567898;dt=02/08/200812:53 +0200;l=30";
  //This is an example STATUS Message from OTMP VVM Specification:
  const char otmp_status_sms_0[] = "//VVM:STATUS:st=N;rc=0;srv=1:10.115.67.251;tui=123;dn=999;ipt=143;spt=25;u=78236487@wirelesscarrier.com;pw=32u4yguetrr34;lang=eng|fre;g_len=25;vs_len=15;pw_len=4-6;smtp_u=super_user@wirelesscarrier.com;smtp_pw=48769463wer;pm=Y;gm=N;vtc=D;vt=1";

  /****************vvm3***********************/
  const char vzw_usa_sync_sms_0[] = "//VZWVVM:SYNC:ev=NM;id=132;c=1;t=v;s=00000000000;dt=23/06/2021 22:08 -0500;l=10;dev_t=5";
  // This is an unprovisioned status SMS
  const char vzw_usa_status_sms_0[] = "//VZWVVM:STATUS:rc=3;st=U;vmg_url=https://vmg.vzw.com/VMGIMS/VMServices";
  // This is a provisioned status SMS
  const char vzw_usa_status_sms_1[] = "//VZWVVM:STATUS:st=R;rc=0;srv=blt2lv.imsvm.com;ipt=143;u=00000000000@vzwazc.com;pw=removed;lang=1,2,3,4,5,6,7,8;g_len=60;vs_len=10;pw_len=4-7;dev_t=5;vmg_url=https://vmg.vzw.com/VMGIMS/VMServices";

  /****************cvvm***********************/
  const char t_mobile_usa_sync_sms_0[] = "//VVM:SYNC:ev=NM;id=328;c=1;t=v;s=11235556754;dt=28/07/2022 17:45 -0700;l=9";
  const char t_mobile_usa_status_sms_0[] = "//VVM:STATUS:st=R;rc=0;srv=vvm.mstore.msg.t-mobile.com;ipt=148;u=12125551234;pw=rh84hf77dh;lang=1|2|3|4;g_len=180;vs_len=10;pw_len=4-9";

  /****************AT&T Proprietary***********/
  //This is a sync SMS
  const char att_usa_sync_sms_0[] = "vvm.mobile.att.net:5400?f=0&v=1010&m=1235550000&p=&S=I&s=5433&i=143/993&t=4:1235550000:A:CMSGROUP0241238:ms06:client:31413";
  //This is an ready status SMS
  const char att_usa_status_sms_0[] = "vvm.mobile.att.net:5400?f=0&v=1010&m=1235550000&p=WFRRXlpTVVVfWTAwMDAw&P=WFRRXlpTVVVfWTAwMDAw&S=I&s=5433&i=143/993&t=4:1235550000:A:CMSGROUP024121413";
  //From AWESim (when it was an AT&T MVNO), they are blocked
  const char awesim_status_sms_0[] = "GET?AD=\"vvm.mobile.att.net:5400?v=1010&S=U&s=5433&m=1235550000\"";

  /****************iOS***********************/
  //This is from AT&T, but is a iOS status message
  const char ios_status_sms_0[] = "STATE?state=NewAccount;server=vvm.mobile.att.net;port=143;name=4:1235550000:A:CMSGROUP0241238:ms06:NAT:31413;pw=5550000";
  const char ios_status_sms_5[] = "STATE?state=NewAccount;server=vvm.mobile.att.net;port=143;pw=1234567;name=4:2015550123:A:CMSGROUP024230:ms08:IMAP4ACME:41115";

  //FreeMobile Fr, These are really iOS messages too
  //This is a provisioned status SMS (New Account)
  const char ios_status_sms_1[] = "STATE?state=NewAccount;name=1234567;server=vvm.proxad.net;port=993;pw=PASSWORD";
  //This is a provisioned status SMS (Active)
  const char ios_status_sms_2[] = "STATE?state=Active;server=vvm.proxad.net;port=993;pw=PASSWORD;name=1234567";
  //This is an unprovisioned status SMS
  const char ios_status_sms_3[] = "STATE?state=NotAvailable";
  //This is a sync SMS
  const char ios_sync_sms_0[] = "MBOXUPDATE?m=1";

  //From Vodafone AU
  // These are really iOS messages too
  const char ios_status_sms_4[] = "STATE?state=NewAccount;name=username;server=prodvvm.vodafone.com.au;port=993;pw=pass";
  const char ios_sync_sms_1[] = "MBOXUPDATE?m=17;server=prodvvm.vodafone.com.au;port=993;name=username;pw=pass";

  /*
   * 'STATE?' works for France Free Mobile, but not Vodafone au. However,
   * 'STATE' works for both. As of now, just changed all of them to 'STATE'
   * and we can work out other issues if they come up later
   * If one sent `STATE?' to vodafone au, they got back the following. Keep it around for now
   * in case it is useful later
   */
  //const char *ios_unrecognised_command_state_0 = "UNRECOGNISED?cmd=STATE?";

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (vzw_usa_sync_sms_0, "//VZWVVM", "vvm3"), ==, SMS_MESSAGE_SYNC);
  vvm_util_parse_sync_sms_message (vzw_usa_sync_sms_0, sms_msg, "vvm3");
  //ev
  g_assert_cmpint (sms_msg->sync_status_reason, ==, SYNC_SMS_NEW_MESSAGE);
  //id
  g_assert_cmpstr (sms_msg->uid, ==, "132");
  //c
  g_assert_cmpstr (sms_msg->new_mailbox_messages, ==, "1");
  //t
  g_assert_cmpint (sms_msg->mailbox_message_type, ==, MAILBOX_MESSAGE_VOICE);
  //s
  g_assert_cmpstr (sms_msg->message_sender, ==, "00000000000");
  //dt
  g_assert_cmpstr (sms_msg->message_date, ==, "23/06/2021 22:08 -0500");
  //l
  g_assert_cmpstr (sms_msg->message_length, ==, "10");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (vzw_usa_status_sms_0, "//VZWVVM", "vvm3"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (vzw_usa_status_sms_0, sms_msg, "vvm3");
  //Don't parse rc
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_UNKNOWN);
  //vmg_url
  g_assert_cmpstr (sms_msg->activate_url, ==, "https://vmg.vzw.com/VMGIMS/VMServices");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (vzw_usa_status_sms_1, "//VZWVVM", "vvm3"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (vzw_usa_status_sms_1, sms_msg, "vvm3");
  //Don't parse rc
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_READY);
  //srv
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "blt2lv.imsvm.com");
  //ipt
  g_assert_cmpstr (sms_msg->mailbox_port, ==, "143");
  //u
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "00000000000@vzwazc.com");
  //pw
  g_assert_cmpstr (sms_msg->mailbox_password, ==, "removed");
  //lang
  g_assert_cmpstr (sms_msg->language, ==, "1,2,3,4,5,6,7,8");
  //g_len
  g_assert_cmpstr (sms_msg->greeting_length, ==, "60");
  //vs_len
  g_assert_cmpstr (sms_msg->voice_signature_length, ==, "10");
  //vs_len
  g_assert_cmpstr (sms_msg->TUI_password_length, ==, "4-7");
  //vmg_url
  g_assert_cmpstr (sms_msg->activate_url, ==, "https://vmg.vzw.com/VMGIMS/VMServices");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (otmp_sync_sms_0, "//VVM", "otmp"), ==, SMS_MESSAGE_SYNC);
  vvm_util_parse_sync_sms_message (otmp_sync_sms_0, sms_msg, "otmp");
  //ev
  g_assert_cmpint (sms_msg->sync_status_reason, ==, SYNC_SMS_NEW_MESSAGE);
  //id
  g_assert_cmpstr (sms_msg->uid, ==, "3446456");
  //c
  g_assert_cmpstr (sms_msg->new_mailbox_messages, ==, "1");
  //t
  g_assert_cmpint (sms_msg->mailbox_message_type, ==, MAILBOX_MESSAGE_VOICE);
  //s
  g_assert_cmpstr (sms_msg->message_sender, ==, "01234567898");
  //dt
  g_assert_cmpstr (sms_msg->message_date, ==, "02/08/200812:53 +0200");
  //l
  g_assert_cmpstr (sms_msg->message_length, ==, "30");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (otmp_status_sms_0, "//VVM", "otmp"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (otmp_status_sms_0, sms_msg, "otmp");
  //Don't parse rc
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_NEW);
  //srv
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "1:10.115.67.251");
  //ipt
  g_assert_cmpstr (sms_msg->mailbox_port, ==, "143");
  //u
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "78236487@wirelesscarrier.com");
  //pw
  g_assert_cmpstr (sms_msg->mailbox_password, ==, "32u4yguetrr34");
  //lang
  g_assert_cmpstr (sms_msg->language, ==, "eng|fre");
  //g_len
  g_assert_cmpstr (sms_msg->greeting_length, ==, "25");
  //vs_len
  g_assert_cmpstr (sms_msg->voice_signature_length, ==, "15");
  //vs_len
  g_assert_cmpstr (sms_msg->TUI_password_length, ==, "4-6");


  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (t_mobile_usa_sync_sms_0, "//VVM", "cvvm"), ==, SMS_MESSAGE_SYNC);
  vvm_util_parse_sync_sms_message (t_mobile_usa_sync_sms_0, sms_msg, "cvvm");
  //ev
  g_assert_cmpint (sms_msg->sync_status_reason, ==, SYNC_SMS_NEW_MESSAGE);
  //id
  g_assert_cmpstr (sms_msg->uid, ==, "328");
  //c
  g_assert_cmpstr (sms_msg->new_mailbox_messages, ==, "1");
  //t
  g_assert_cmpint (sms_msg->mailbox_message_type, ==, MAILBOX_MESSAGE_VOICE);
  //s
  g_assert_cmpstr (sms_msg->message_sender, ==, "11235556754");
  //dt
  g_assert_cmpstr (sms_msg->message_date, ==, "28/07/2022 17:45 -0700");
  //l
  g_assert_cmpstr (sms_msg->message_length, ==, "9");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (t_mobile_usa_status_sms_0, "//VVM", "cvvm"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (t_mobile_usa_status_sms_0, sms_msg, "cvvm");
  //Don't parse rc
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_READY);
  //srv
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.mstore.msg.t-mobile.com");
  //ipt
  g_assert_cmpstr (sms_msg->mailbox_port, ==, "148");
  //u
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "12125551234");
  //pw
  g_assert_cmpstr (sms_msg->mailbox_password, ==, "rh84hf77dh");
  //lang
  g_assert_cmpstr (sms_msg->language, ==, "1|2|3|4");
  //g_len
  g_assert_cmpstr (sms_msg->greeting_length, ==, "180");
  //vs_len
  g_assert_cmpstr (sms_msg->voice_signature_length, ==, "10");
  //vs_len
  g_assert_cmpstr (sms_msg->TUI_password_length, ==, "4-9");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  // AT&T has pretty much identical STATUS and SYNC messages, and the SYNC
  // Messages aren't helpful, just process all as STATUS SMS
  g_assert_cmpint (vvm_util_parse_sms_message_type (att_usa_sync_sms_0, "1235550000", "AT&TUSAProprietary"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (att_usa_sync_sms_0, sms_msg, "AT&TUSAProprietary");
  //Don't parse rc
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_READY);
  //srv
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.mobile.att.net");
  //ipt
  g_assert_cmpstr (sms_msg->mailbox_port, ==, "143");
  //u
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "1235550000");
  //vs_len
  g_assert_cmpstr (sms_msg->TUI_password_length, ==, "7-15");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (att_usa_status_sms_0, "1235550000", "AT&TUSAProprietary"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (att_usa_status_sms_0, sms_msg, "AT&TUSAProprietary");
  //Don't parse rc
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_READY);
  //srv
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.mobile.att.net");
  //ipt
  g_assert_cmpstr (sms_msg->mailbox_port, ==, "143");
  //u
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "1235550000");
  //pw
  g_assert_cmpstr (sms_msg->mailbox_password, ==, "000000000000000");
  //vs_len
  g_assert_cmpstr (sms_msg->TUI_password_length, ==, "7-15");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (awesim_status_sms_0, "1235550000", "AT&TUSAProprietary"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (awesim_status_sms_0, sms_msg, "AT&TUSAProprietary");
  //Don't parse rc
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_UNKNOWN);
  //srv
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.mobile.att.net");
  //u
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "1235550000");
  //vs_len
  g_assert_cmpstr (sms_msg->TUI_password_length, ==, "7-15");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_0, "1235550000", "AT&TUSAProprietary"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_0, sms_msg, "AT&TUSAProprietary");

  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_NEW);

  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.mobile.att.net");

  g_assert_cmpstr (sms_msg->mailbox_port, ==, "143");

  g_assert_cmpstr (sms_msg->mailbox_username, ==, "1235550000");

  g_assert_cmpstr (sms_msg->mailbox_password, ==, "5550000");

  //This is only present for AT&T
  g_assert_cmpstr (sms_msg->TUI_password_length, ==, "7-15");

  vvm_util_delete_status_message (sms_msg);

  //Freemobile message
  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_1, "//VVM", "FreeMobileProprietary"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_1, sms_msg, "FreeMobileProprietary");
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_NEW);
  //server
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.proxad.net");
  //port
  g_assert_cmpstr (sms_msg->mailbox_port, ==, "993");
  //name
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "1234567");
  //password
  g_assert_cmpstr (sms_msg->mailbox_password, ==, "PASSWORD");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_2, "//VVM", "FreeMobileProprietary"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_2, sms_msg, "FreeMobileProprietary");
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_READY);
  //server
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.proxad.net");
  //port
  g_assert_cmpstr (sms_msg->mailbox_port, ==, "993");
  //name
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "1234567");
  //password
  g_assert_cmpstr (sms_msg->mailbox_password, ==, "PASSWORD");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_3, "//VVM", "FreeMobileProprietary"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_3, sms_msg, "FreeMobileProprietary");
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_BLOCKED);

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_sync_sms_0, "//VVM", "FreeMobileProprietary"), ==, SMS_MESSAGE_SYNC);
  vvm_util_parse_sync_sms_message (ios_sync_sms_0, sms_msg, "FreeMobileProprietary");
  //Mailbox Update
  g_assert_cmpint (sms_msg->sync_status_reason, ==, SYNC_SMS_MAILBOX_UPDATE);

  vvm_util_delete_status_message (sms_msg);

  //ios message
  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);


  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_0, "//vvm", "ios"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_0, sms_msg, "ios");

  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_NEW);

  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.mobile.att.net");

  g_assert_cmpstr (sms_msg->mailbox_port, ==, "143");

  g_assert_cmpstr (sms_msg->mailbox_username, ==, "1235550000");

  g_assert_cmpstr (sms_msg->mailbox_password, ==, "5550000");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_1, "//VVM", "ios"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_1, sms_msg, "ios");
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_NEW);
  //server
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.proxad.net");
  //port
  g_assert_cmpstr (sms_msg->mailbox_port, ==, "993");
  //name
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "1234567");
  //password
  g_assert_cmpstr (sms_msg->mailbox_password, ==, "PASSWORD");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_2, "//VVM", "ios"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_2, sms_msg, "ios");
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_READY);
  //server
  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.proxad.net");
  //port
  g_assert_cmpstr (sms_msg->mailbox_port, ==, "993");
  //name
  g_assert_cmpstr (sms_msg->mailbox_username, ==, "1234567");
  //password
  g_assert_cmpstr (sms_msg->mailbox_password, ==, "PASSWORD");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_3, "//VVM", "ios"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_3, sms_msg, "ios");
  //st
  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_BLOCKED);

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_4, "//vvm", "ios"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_4, sms_msg, "ios");

  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_NEW);

  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "prodvvm.vodafone.com.au");

  g_assert_cmpstr (sms_msg->mailbox_port, ==, "993");

  g_assert_cmpstr (sms_msg->mailbox_username, ==, "username");

  g_assert_cmpstr (sms_msg->mailbox_password, ==, "pass");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_status_sms_5, "//vvm", "ios"), ==, SMS_MESSAGE_STATUS);
  vvm_util_parse_status_sms_message (ios_status_sms_5, sms_msg, "ios");

  g_assert_cmpint (sms_msg->provision_status, ==, VVM_PROVISION_STATUS_NEW);

  g_assert_cmpstr (sms_msg->mailbox_hostname, ==, "vvm.mobile.att.net");

  g_assert_cmpstr (sms_msg->mailbox_port, ==, "143");

  g_assert_cmpstr (sms_msg->mailbox_username, ==, "2015550123");

  g_assert_cmpstr (sms_msg->mailbox_password, ==, "1234567");

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_sync_sms_0, "//VVM", "ios"), ==, SMS_MESSAGE_SYNC);
  vvm_util_parse_sync_sms_message (ios_sync_sms_0, sms_msg, "ios");
  //Mailbox Update
  g_assert_cmpint (sms_msg->sync_status_reason, ==, SYNC_SMS_MAILBOX_UPDATE);

  vvm_util_delete_status_message (sms_msg);

  sms_msg = g_try_new0 (struct sms_control_message, 1);
  g_assert_nonnull (sms_msg);

  g_assert_cmpint (vvm_util_parse_sms_message_type (ios_sync_sms_1, "//VVM", "ios"), ==, SMS_MESSAGE_SYNC);
  vvm_util_parse_sync_sms_message (ios_sync_sms_1, sms_msg, "ios");
  //Mailbox Update
  g_assert_cmpint (sms_msg->sync_status_reason, ==, SYNC_SMS_MAILBOX_UPDATE);

  vvm_util_delete_status_message (sms_msg);
}

int
main (int    argc,
      char **argv)
{
  g_test_init (&argc, &argv, NULL);

  g_test_add_data_func ("/vvmutil/SMS Test",
                        NULL, test_sms);


  return g_test_run ();
}