sanoopsivan / jsmpp

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

Sending an SMS to port (Midlet push registry) does not work. #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello, 

I'm trying to send an SMS to a port with jsmpp. I use submitShortMessage()
method with the following optional parameter: 

Int destiantionPort = new Int(Tag.DESTINATION_PORT, Integer.parseInt(5000));

which I pass to the sumbitShortMessage method. 

The SMPP frame captured with wireshark shows the optional parameter
"Destination Port" to 0x0000 

0000   00 00 5e 00 01 02 00 05 9a 3c 78 00 08 00 45 00
0010   00 ae 01 9c 40 00 80 06 c8 45 0a 0a 02 32 ac 10
0020   78 1c 09 6e 10 e1 76 81 79 55 0a 80 80 06 50 18
0030   44 d2 66 00 00 00 00 00 00 86 00 00 00 04 00 00
0040   00 00 00 00 00 02 43 4d 54 00 00 09 32 33 34 32
0050   00 02 01 36 30 38 37 36 35 33 35 38 00 00 00 00
0060   00 00 00 00 11 00 4d 4f 50 45 4e 54 43 50 3b 30
0070   2e 39 2e 30 3b 50 6c 61 63 65 62 6f 6f 6b 3b 68
0080   74 74 70 3a 2f 2f 73 65 72 76 69 6e 74 2e 64 65
0090   69 6d 6f 73 2d 73 70 61 63 65 2e 63 6f 6d 3a 34
00a0   39 31 35 35 2f 61 6a 6f 62 2f 31 32 33 34 35 36
00b0   3b 31 3b 31 02 0b 00 04 00 00 13 88

Debugging the code I've followed the optional parameter until the
PduByteBuffer class, keeping the value "5000" as far as my knowledge
permits me. But somewhere the value is lost, and is not sent properly to
the SMPP server. 

Or am I missing something? 

Original issue reported on code.google.com by felix.pedrera on 22 Jan 2009 at 2:43

GoogleCodeExporter commented 8 years ago
hi felix,

I could not reproduce this issue. Your value 5000 (decimal) equals 1388 
(hexadecimal)
which you can find at the end of your wireshark output. And I guess the value 
|020b|
0004|00001388| is a Tag-Length-Value (TLV) structure with Tag=020b (optional
parameter) Length=0004 (which means the value has 4 bytes) and the Value=00 00 
13 88
(4 Bytes which equal 5000 in decimal).

Could this help or did I misunderstand your question?

Regards Werner

Original comment by wernerkl...@gmx.at on 10 Mar 2009 at 3:15

GoogleCodeExporter commented 8 years ago
Hello,

As per the SMPP specification for destination port,
Tag -> 2 bytes
Length-> 2 bytes
Value -> 2 bytes

so instead of 

Int destiantionPort = new Int(Tag.DESTINATION_PORT, Integer.parseInt(5000));

use 

Short destiantionPort = new Short(Tag.DESTINATION_PORT, Short.parseShort(5000));

This should help solve the invalid parameter problem.

Regards,

Abhishek

Original comment by abhishek...@gmail.com on 11 Sep 2009 at 6:51

GoogleCodeExporter commented 8 years ago
Hhytt

Original comment by t.leongarza@gmail.com on 18 Dec 2013 at 8:36