himanshusao / smppclient

Automatically exported from code.google.com/p/smppclient
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

SubmitSmResp problem with some badly written SMSCs #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I found a SMSC which returns message id even if there is an error in submit.

For example, it returns PDU like this:
0000001a80000004000000ff01fc1fbe31393130353634333500

SMPP 3.4 specification clearly states that:
The submit_sm_resp PDU Body is not returned if the command_status field 
contains a non-zero value.

Of course, the SMSC ignores that which causes TlvException at client side.

Now, I noticed that you catch situations when SMSC returns null byte as message 
id and I wonder is it a good idea to simply ignore all bytes after sequence 
when command_status!=0?

For example, instead of:
else if (bb.length() == 1) {

at line 35 in SubmitSmppResp.java, you could put:
else if (bb.length()>0) {

and remove all remaining bytes from bb array.

Does that makes sense?

Original issue reported on code.google.com by vladimir...@gmail.com on 29 Nov 2011 at 11:12

GoogleCodeExporter commented 9 years ago

Original comment by bulat...@gmail.com on 30 Nov 2011 at 6:33

GoogleCodeExporter commented 9 years ago
I investigated your problem. I can add requested changes and it will catch 
situations with messageId on command_status!=0 . But with command_status!=0 
SMSC may return TLV's containing important information about error or something 
else. And removing all remaining bytes will be wrong decision.
So the best solution to you request is to write custom PduParser and 
SubmitSmResp processor. Now I understand, that library not well suited to 
adding custom PDU's processors. So I will help you in this if you want.

Original comment by bulat...@gmail.com on 31 Dec 2011 at 7:07