Project

General

Profile

Bugs in PDU Decoder and PDU Encoder

Added by stevensu about 10 years ago

Here the log of my software:

Below are sms delivery report that cannot be decode. I tried mCore library it is decode sucessfull.
2009-11-08 00:03:37 Received:
+CDS: 29
02A30C9126984989889490118000202182901180005071820000000012

2009-11-08 00:03:38 Received:
+CDS: 29
02A40C9126182980980990118000202282901180005012820000000012

2009-11-08 00:03:39 Received:
+CDS: 29
06A50C9126187902767390118000503182901180005032820000000012

Below are SMS Submit PDU which is still bugs:

a) I want to send message to 087868213565 with status report. the SMS Center i left it empty. and the validity period is 3 hours. and when i send,it returns +CMS ERROR: 500
AT
OK
AT+CMGS=32

0071000C918087861253560000231406050400000000C834280C0F83D66171580E

+CMS ERROR: 500

b) I want to send message to +6287868213565 (Only change the number to international format) with status report. the SMS Center i left it empty. and the validity period is 3 hours. and when i send,it returns OK.
AT
OK
AT+CMGS=33

0071000D91267868283165F50000231406050400000000C834280C0F83D66171580E

+CMGS: 0

OK


Replies (32)

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin about 10 years ago

Hi Steven,

For b), please try to put the address type as non international. E.g.

pdu.AddressType = PduUtils.AddressTypeUnknown | PduUtils.AddressNumberPlanIdTelephone;

Try again with this, if this is fixed. Test again if a) still happen

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu about 10 years ago

Thank you..For b) now it is fixed. But how about a). I really don't understand for the a). Thank you.. I'm develope using vb.net. the .NET Serial port has a bug. The bug is when the port is open and i suddenly pulled out the modem and the port name is locked. Then I see in the registry the port name is still exits and not disappear but i have pulled out the modem. Do you have any solution for me to solve this? Thank you..

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin about 10 years ago

For a), the status report PDU is not valid. Not sure why you said mCore is okay.

How do you perform the testing?

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu about 10 years ago

First I send SMS with my software and decode the with your pdu. My StatusReportReceivedEvent is not fire. Then I try to get the Status Report PDU from my log.and i tried to decode with yours. And it failed to decode.then I download from mcore the i try sending message again. here is the log of mcore. about the serial port bugs.please give me a solution.please....

11/6/2009 11:05:53 AM: Verifying if port connected
11/6/2009 11:05:53 AM: Port is connected
11/6/2009 11:05:53 AM: Verifying if modem is connected
11/6/2009 11:05:53 AM: Send AT command [AT<cr>]
11/6/2009 11:05:53 AM: Send: AT<cr>
11/6/2009 11:05:53 AM: Recv: OK
11/6/2009 11:05:53 AM: Modem is connected
11/6/2009 11:05:53 AM: Setting validity period as 24H
11/6/2009 11:05:53 AM: Sending message to 087868213565 [Option: 3; Encoding: 7 bits]
11/6/2009 11:05:53 AM: Modem Command: AT+CMGS=30<cr>
11/6/2009 11:05:54 AM: PDU: 079126385100002331000C818087861253560000A712E139791E26CFC3E479983C0F93C37332
11/6/2009 11:06:02 AM: Modem Response: +CMGS: 0
11/6/2009 11:06:02 AM: Message sent [Msg ID: 0]
11/6/2009 11:06:07 AM: Recv: +CDS: 29<cr><lf>060D0D81267868283165F5901160117054829011601170848200000012
11/6/2009 11:16:37 AM: Closing port COM16
11/6/2009 11:16:37 AM: Port COM16 closed

the mcore can decode the cds...

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin about 10 years ago

This is the result of decoding the status report. I have not really tested with mcore, but the PDU is invalid as what u can observe below

PDU LENGTH IS 29 BYTES
ADDRESS OF DELIVERING SMSC
NUMBER IS : D018628786
TYPE OF NR. : Unknown
NPI : Reserved

MESSAGE HEADER FLAGS
MESSAGE TYPE : SMS DELIVER
MSGS WAITING IN SC : YES
SEND STATUS REPORT : YES
USER DATA HEADER : NO UDH
REPLY PATH : NO

ORIGINATING ADDRESS
NUMBER IS : 5091106110745280911061107482800000021
TYPE OF NR. : Abbreviated number
NPI : SMSC specific (ext. SME)

PROTOCOL IDENTIFIER (0x00)
MESSAGE ENTITIES : SME-to-SME
PROTOCOL USED : Implicit / SC-specific

DATA CODING SCHEME (0x00)
AUTO-DELETION : OFF
COMPRESSION : OFF
MESSAGE CLASS : NONE
ALPHABET USED : 7bit default

SMSC TIMESTAMP : <invalid timestamp>

USER DATA PART OF SM
USER DATA LENGTH : 0 septets
USER DATA (TEXT) : <no data>

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu about 10 years ago

Hm..i also don't know why..Actually I want to learn the pdu but i have no time. The problem is only happened in AXIS Operator.Another operator work fine. mcore success decode it. One more thing, how to send message with a reply path?does your pdu support this? Thanks for your information.

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu about 10 years ago

Yes..One more thing, I try another operator. Named Telkomsel. the status report also can't be decoded...

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin about 10 years ago

To ease us to see what happened. Can you do the following

1. Use the demo program to connect to modem
2. After connected, set the logging to DEBUG mode.
3. Try sending message, and make sure the status report come back.
4. Attach here messagingtoolkit.log so that we can trace what happened.

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu about 10 years ago

Again error in decode status report...

06010D91261839434131F8901141410102829011414101028200000012...thx....

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu almost 10 years ago

Hi, I want to report again:
1.About the decode status report. I have try to send message using Sony Ericsson K810i with SIM Card A, then the status report decode successfull after that i try sending message with another modem, Sony Ericcson K320i with SIM Card B. It can't decoded. Then I try to move the Sim Card A to SE K320i and try sending again. the status report cannot be decoded. and the Sim card B move to SE K810i and it can be decoded. Why it can happened?
2. About sending message again. I face the problem sending message and the modem response OK but the message is not received by the destination number (I decode with your pdu decoder in tab menu PDU Decoder) then I try sending message with your application. and the message is received by the destination number.

I attached the sending message log that is created by your application. About the status report i'll attach it later. Thank you for your help.

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu almost 10 years ago

Hi,
I have attached the mcore log and also the messagingToolkit log. I also include the print screen. When I use the messagingToolkit demo for sending message and also i check the status report, and after sending the message and i see in the log file, there is no status report pdu (check the log and the print screen) and also status report received is not fire.

Log.rar (54.8 KB) Log.rar

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin almost 10 years ago

Hi,

The issue is due to the status report has no SMSC header.

There are 2 specifications - TS 3GPP 27.005 which specify that SMSC header must be present, and TS 3GPP 23.040 which specifies no SMSC header is present.

We have made changes to MessagingToolkit.Pdu to handle both scenario.

Please use the attached dll to replace the existing one in MessagingToolkit installation path.

After this you can try to decode the status report again using the PDU decoder.

This patch shall be included in a patch release later.

MessagingToolkit.Pdu.dll (147 KB) MessagingToolkit.Pdu.dll Patched PDU library

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu almost 10 years ago

Hi,
I have download and try it. It works but another status report can not be decoded. I attached 2 files:
1.UnreceivedMessage.log
2.FailedStatusReport.log
This Log is created by my application with your pdu library.

Let's me explain first. The UnreceivedMessage.log contains the sending message pdu and the status report pdu. The problem is as i see in the log the messsage is sent successfull with the reply of the status report. But the message is not received by the destination number and the status report can't be decoded (the statusReportReceivedEvents is not fire. The status report received always fired if it's failed or delivered).
I often face this problem (the message sent success and the message is not received by destination number). At the first time i face this problem, I create a Submit SMS Pdu with SMS Center address left it empty. Then the message sent success but message is not received by the destination number so i recreate a submit SMS Pdu with SMS Center address not empty. then I resend the message again and the destination number received it. The second time I face this problem is in this UnreceivedMessage.Log, I have checked the destination Phone is active.
Can you tell me why? I attached this problem in UnreceivedMessage.log and it include the PDU.

The FailedStatusReport.log
I try to send a message to Inactive Number. My status report is not fire again. As I Said my status report can fire if the report is success and failed. I want to ask you What is the integer number of Delivered Report and Failed Report? As I checked it like this IF Status = 0 then it is Delievered elseif status=64 then it failed else it pending
How to check it?Would you guide me? And to create a submit PDU with request reply from the sender?

Thank you so much....

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin almost 10 years ago

Hi,

Let's me explain first. The UnreceivedMessage.log contains the sending message pdu and the status report pdu. The problem is as i see in the log the messsage is sent successfull with the reply of the status report. But the message is not received by the destination number and the status report can't be decoded (the statusReportReceivedEvents is not fire. The status report received always fired if it's failed or delivered).

For status report cannot be decoded, please use the attached patch MessagingToolkit.Pdu and MessagingToolkit.Core libraries. Replace the existing ones with these.

I often face this problem (the message sent success and the message is not received by destination number). At the first time i face this problem, I create a Submit SMS Pdu with SMS Center address left it empty. Then the message sent success but message is not received by the destination number so i recreate a submit SMS Pdu with SMS Center address not empty. then I resend the message again and the destination number received it. The second time I face this problem is in this UnreceivedMessage.Log, I have checked the destination Phone is active.
Can you tell me why? I attached this problem in UnreceivedMessage.log and it include the PDU.

When you do not set the SMSC, it will default to the one set in the SIM. Please

- Verify that the SMSC address is correct and set in the SIM card
- Also, you can try to set to different address type to see, e.g.

pdu.AddressType = PduUtils.AddressTypeAlphanumeric | PduUtils.AddressNumberPlanIdTelephone;

I try to send a message to Inactive Number. My status report is not fire again. As I Said my status report can fire if the report is success and failed. I want to ask you What is the integer number of Delivered Report and Failed Report? As I checked it like this IF Status = 0 then it is Delievered elseif status=64 then it failed else it pending
How to check it?Would you guide me?

Please try with latest patched libraries which are updated to reflect all possible status report values

0x00 Short message delivered successfully
0x01 Forwarded, but status unknown
0x02 Replaced
0x20 Congestion, still trying
0x21 Recipient busy, still trying
0x22 No response recipient, still trying
0x23 Service rejected, still trying
0x24 QOS not available, still trying
0x25 Recipient error, still trying
0x40 RPC Error
0x41 Incompatible destination
0x42 Connection rejected
0x43 Not obtainable
0x44 QOS not available
0x45 No internetworking available
0x46 Message expired
0x47 Message deleted by sender
0x48 Message deleted by SMSC
0x49 Does not exist

And to create a submit PDU with request reply from the sender?

Using the patched version, it is easy to do so

pdu.TpRp = PduUtils.TpRpWithRp; // or PduUtils.TpRpNoRp

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu almost 10 years ago

I have tested the latest patched..All the status report has been decoded well.

I have use this code below
pdu.AddressType = PduUtils.AddressTypeAlphanumeric | PduUtils.AddressNumberPlanIdTelephone;

and when i send message it returns +CMS ERROR:500

So i changed to pdu.AddressType = PduUtils.AddressTypeUnknown | PduUtils.AddressNumberPlanIdTelephone (Your first suggestion) and it works;

Can you specify to me the status report value (Delivered,Pending and Failed). I mean 0x00 mean the message is delivered. How about another?
0x00 Short message delivered successfully = Delivered
0x01 Forwarded, but status unknown
0x02 Replaced
0x20 Congestion, still trying
0x21 Recipient busy, still trying
0x22 No response recipient, still trying
0x23 Service rejected, still trying
0x24 QOS not available, still trying
0x25 Recipient error, still trying
0x40 RPC Error
0x41 Incompatible destination = Failed
0x42 Connection rejected
0x43 Not obtainable = Failed
0x44 QOS not available = Failed
0x45 No internetworking available = Failed
0x46 Message expired = Failed
0x47 Message deleted by sender
0x48 Message deleted by SMSC
0x49 Does not exist

I have tested again in decode new message. it got an exception: Invalid TP-MTI:3. Below is the PDU:
07912618485400F9240C91261829212232000090118251520282084D74FBDC3EB7CF

And when i try sending a message with a reply path, then i checked the destination number, the message that has been received is not ask for a reply. it acts like a normal message.

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin almost 10 years ago

Please use the attached patched PDU library

For the status report value, 0 = success, those with trying you can assume are pending, the remaining as failed.

Previously you can only set the reply path bit, we modified to include the reply address. Note that we have not tested this thoroughly.

To use it, do

pdu.AddReplyPath("1234567890", PduUtils.AddressTypeDomesticFormat);

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu almost 10 years ago

I see..Ok i have downloaded it.. Thanks..

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu almost 10 years ago

Hi, I have tested and about decode new message, I think it has no problem anymore. the issue is fixed. and about the reply path, I think it's not work.
the reply path code that i used is written below:

pdu.TpRp = PduUtils.TpRpWithRp;
pdu.AddReplyPath("1234567890", PduUtils.AddressTypeDomesticFormat); // So 123456789 is not an international format number. Am i right? When I used and international number, it got error...Ok..

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin almost 10 years ago

Can you post your PDU here?

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu almost 10 years ago

Here is the pdu: 07912618485400F9F1C20B818079841701F200000B100A22080B818091122222F3B8BFD3

Thanks...

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu almost 10 years ago

Hello sir,
I want to suggest you something for improving your messaging toolkit. I don't know that you have already knwon it or not.In some phones, they don't support for the "AT+CUSD" Command. Using "ATD" instead of "AT+CUSD". so when connecting the modem, you better check for "AT+CUSD=?"

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin almost 10 years ago

Hi,

CUSD and ATD are different. One is for USSD and another is for dialling. Unless you try to send a USSD command, then the toolkit will use AT+CUSD.

RE: Bugs in PDU Decoder and PDU Encoder - Added by stevensu almost 10 years ago

I know that they are different..But some phones like siemen c55 does not support for AT+CUSD. But they use ATD for sending USSD Command. This is just a suggestion.

RE: Bugs in PDU Decoder and PDU Encoder - Added by admin almost 10 years ago

Hi,

I don't see the error message?

(1-25/32)