×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    9

    Tie a report to a message sent

    Hi,

    I am using a nokia 5110 as the means to send messages to various recipients. How do I match the message sent with a status report. I am not sure if the 5110 can be set up for status reports.

    Thanks,
    Dion.

  2. #2
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    221
    The SMS status report contains the reference number of the original message. You can compare both values to match the reports to the messages.

    Zamba

  3. #3
    Registered User
    Join Date
    Jun 2004
    Posts
    9
    Thanks for the reply Zamba, but I do not understand how the phone formulates the unique message id that allows me to match extract it from the mesasge and match it. Would I extract the unique id from the message before sending it, and save it somewhere, and then on receiving the status report, extract the corresponding id and try and find a match. If this is how it is done, what do I need to do in order to obtain this number(Get_MessageReference, I assume) from both the message sent, as well as the received status report.

    Thanks,
    Dion

  4. #4
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    221
    Yes, Get_MessageReference seems to be the right one.

    A bit about the reference counter:
    The reference counter in the phone is just a number that the phone usually increases with every successfully submitted message. Since by definition the ref counter is only one byte big, the counter resets to 1 after 255.
    There is also the possibility to set the reference by yourself but in normal cases let the phone do it. The phone may also reset the counter if you turn it off and on again.


    Zamba

  5. #5
    Registered User
    Join Date
    Jun 2004
    Posts
    9
    Thanks Zamba,

    What strategy is followed if the number of sent sms's is greater than 255 on any particular day? Or if at 10 the counter is reset and sms with counter 5(the first # 5) is received after the 2nd sms with counter # 5? Its a pity the timestamp on the phone isn't sent.

    Thanks,
    Dion

  6. #6
    Registered User
    Join Date
    Jun 2004
    Posts
    9
    I thought I had a solution by setting the message reference, but when I receive the status report, the messagereference is not what I set it to, but the original number, incremented by 1.

    Thanks,
    Dion.

  7. #7
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    221
    Hi Dion,

    It would be better to use more parameters for comparison. The reference number is definitely not enough. I'm thinking here of additionally saving the the destination address and a hash code (checksum) of the message. If you don't send the same message to the same people, you'll be safe with this.


    Zamba

  8. #8
    Registered User
    Join Date
    Jun 2004
    Posts
    9
    Thanks for the reply, but sending the same message to the same people might be a possibility. How do I set the messageReference manually before sending the message, as I tried setting it before sending the message, which worked, but the messageReference I get from the status report is not the same as the one I set manually before sending. If I can get this to work, 99% of my problem solved.

    Thanks,
    Dion.

  9. #9
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    221
    I just had a look in the GSM spec, which states the following about the message reference:

    "[...] The MS increments TP-Message-Reference by 1 for each SMS-SUBMIT or SMS-COMMAND being submitted. The value to be used for each SMS-SUBMIT is obtained by reading the Last-Used-TP-MR value from the SMS Status data field in the SIM (see GSM 11.11) and incrementing this value by 1. After each SMS-SUBMIT has been submitted to the network, the Last-Used-TP-MR value in the SIM is updated with the TP-MR that was used in the SMS-SUBMIT operation. [...]" (GSM 03.40)
    So if you set the MR manually, the phone first increments this number (as if it came from the SIM) and then submits the message. That's the reason why the MR of the report is one higher than the number you set. I think here you have your 99 percent. :-)

    Zamba

  10. #10
    Registered User
    Join Date
    Jun 2004
    Posts
    9
    Thanks again for you patience, Zamba, but I think we are missing the point here. I am going to try again:-

    code snippet
    ----------------
    send the message
    ...
    Msg.Set_UserDataFormat(DEFAULT_ALPHABET_7_BIT);
    Msg.Set_MessageReference(10);
    msg.Get_MessageReference(pval); >> pval is 10 at this point <<

    // Set recipient and text
    Msg.Set_OtherEndAddress(WideString('+' + NumberEdit.Text));
    MsgMemo.GetTextBuf(Buf, 160);
    Msg.Set_UserDataText(WideString(Buf));

    // Send the message
    MainForm.FSMSSend.Send(Msg);
    ...

    when receive message report
    ...
    ws := '';
    sms.Get_MessageReference(pVal);
    >> here the value for pval is for eg 140 and not 10
    >> it is as if the original value(ie 140) replaces mym anually
    >>changed value just before sending???

    if pval > 0 then begin end;

    Sms.Get_OtherEndAddress(ws);
    ...

    Regards,
    Dion.

  11. #11
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    221
    Right.

    It's nice to see some Delphi stuff here :-)

    The phone completely ignores the MR setting. May be the phone model because the 5110 is already some years old and may not support some details. Try a newer model if you still want to try to set the MR manually. That's the only idea that I currently have. :-(

  12. #12
    Registered User
    Join Date
    Jun 2004
    Posts
    9
    Does nokia release 'bios' updates for the older models? I am using a 5110 as well as a 6110.

    Thanks.

  13. #13
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    221
    I don't think so. But there are many websites who deal with mobile phones - I'm sure some of them also have firmware updates for older Nokias.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •