71 | | For regular, non-multi-part messages, the incoming message is parsed by the parserdooth() function which uses difflib to allow users to mis-spell the keywords. In the case of multi-part messages, the tropo() function calls "concatSMS(lastMessage, fromaddress)" method to see if this is the last message in a sequence. At present, the "sequence" is highly proprietary, and integrated into the "modified jaxdroid" branch of ODK Collect mentioned [http://eden.sahanafoundation.org/wiki/UserGuidelinesMobile here]. The sequence information is combined with a 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: |
72 | | * (1/3)(12345)<?xml version='1.0' ?><pr_person>... |
73 | | * (2/3)(12345)last_name>... |
74 | | * (3/3)(12345)-08</date_of_birth></pr_person> |
75 | | |
76 | | The unique identifier -- here, 12345 -- is actually significantly more random than that. 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, obvious), and submit them to parserdooth() as before. |
| 71 | The incoming message can include mis-spelt keywords (since they are parsed by the {{{parserdooth()}}} function which uses difflib). |