I'm trying to write an app for S60 3rd edition which has to read, decipher and parse SMS messages stored in the Inbox folder and received from some remote device. The problem is that I can read only message body converted to the UCS-2 charset using CSmsClientMtm::Body() or CMsvStore::RestoreBodyTextL() methods. I was trying to restore binary form using CSmsMessage::EncodeIntoSinglePDUL(), CCnvCharacterSetConverter::ConvertFromUnicode(), but I've found that one UCS-2 char matches multiple binary values, so the SMS body is not restored properly and CRC doesn't match.
Any attempt to read CSmsUserData::Body() returns an empty descriptor. I'm using this code to access the raw SMS body:
I can read any message data and it's always correct, all the headers are correct, but the message body is always empty.
iSmsMtm->SwitchCurrentEntryL( entries->At(i) );
CSmsHeader &smsHdr = iSmsMtm->SmsHeader();
CSmsMessage &smsMsg = smsHdr.Message();
CSmsPDU &smsPdu = smsMsg.SmsPDU();
CSmsUserData &userData = smsPdu.UserData();
TInt bodyLength = userData.Body().Length(); // bodyLength always == 0
I was also trying to externalize all objects that can contain message body to the file and all what I've found in that file was an UCS-2 encoded message body.
Is there any way to access SMS body in raw form on S60 3rd ed phone?
I can probably intercept a new message in raw form using sockets, but I need also to parse messages stored in the Inbox folder.