| 56 | |
| 57 | === SMS Structure === |
| 58 | XForms sent via SMS are split into Multi-Part messages with a sequence header. This header is currently a custom 5-digit unique identifier for that particular form submission. That sequence information and unique identifier are prepended to the each part of the multi-part SMS transmission by the modified ODK Collect branch's SMS form submission code. It will look something like this: |
| 59 | * (1/3)(12345)<?xml version='1.0' ?><pr_person>... |
| 60 | * (2/3)(12345)last_name>... |
| 61 | * (3/3)(12345)-08</date_of_birth></pr_person> |
| 62 | |
| 63 | The unique identifier -- here, 12345 -- is actually significantly more random than that. |
| 64 | |
| 65 | These messages are then reassembled by the {{{tropo()}}} function in {{{controllers/msg.py}}} which calls {{{concatSMS(lastMessage, fromaddress)}}}. The reason the tropo() controller method calls concatSMS() with each new part of a multi-part message is that the messages may arrive out of order. However, when the concatSMS() method detects that all message parts of that XForms submission have been received, it will stitch those messages together (while removing the prepend), and submit them to parserdooth() as for normal messages. |