duongthanhtam2 / jsmpp

Automatically exported from code.google.com/p/jsmpp
Apache License 2.0
0 stars 0 forks source link

Problem with sending optional parameter RECEIPTED_MESSAGE_ID #122

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,
I have the same problem but with Tag.RECEIPTED_MESSAGE_ID. Always my wireshark 
set my deliver_sm as Malformed.
I add OptionalParameter like this:
OptionalParameter op[] = new OptionalParameter[2];
OptionalParameter op1 = new OptionalParameter.Byte(Tag.MESSAGE_STATE, (byte) 2);

OptionalParameter op2 = new 
OptionalParameter.OctetString(Tag.RECEIPTED_MESSAGE_ID.code(), 
messageId.toString().getBytes());
op[0] = op1;
op[1] = op2;
And I add it into deliver_sm
session.deliverShortMessage(..., op);
I try to add RECEIPTED_MESSAGE_ID like Int or Byte but always have the same 
result Malformed Packet:SMPP.
Please help me to carry out this problem.

Original issue reported on code.google.com by sokun...@gmail.com on 12 Mar 2012 at 4:57

GoogleCodeExporter commented 9 years ago
I try to add receipt_message_id by COctetString but it doesn't help(
 OptionalParameter op2 = new OptionalParameter.COctetString(Tag.RECEIPTED_MESSAGE_ID.code(), messageId.toString());
It always said Malformed Packet:SMPP

Original comment by sokun...@gmail.com on 12 Mar 2012 at 8:36

GoogleCodeExporter commented 9 years ago
Hi Sokun,

I have same problem with you, did you solved it?

Can you help me?

Best Regards.

Original comment by harunate...@gmail.com on 19 Jun 2014 at 3:05

GoogleCodeExporter commented 9 years ago
Hello,
Now I am using com.logica.smpp package (this library has all functionality that 
I need)

Best Regards.

Original comment by sokun...@gmail.com on 26 Jun 2014 at 10:08

GoogleCodeExporter commented 9 years ago
Hi, I found the problem and actually I have fixed it. I am using jsmpp 2.2.1 
and the fix was a small change in the class Receipted_message_id that is inside 
org.jsmpp.bean.OptionalParameter

from:
public static class Receipted_message_id extends OptionalParameter.COctetString 
{

        public Receipted_message_id(byte[] value) {
            super(Tag.RECEIPTED_MESSAGE_ID.code(), value);
        }
    }

to:
public static class Receipted_message_id extends OptionalParameter.COctetString 
{

        public Receipted_message_id(byte[] value) {
            super(Tag.RECEIPTED_MESSAGE_ID.code(), new String(value));
        }
    }

I hope that solve your issue,

bye

Original comment by cfo...@itdchile.cl on 23 Mar 2015 at 9:27