MazWoz / jsmpp

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

String value '7363733330323631' cannot more than 9. #138

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there,
I will try to use smsLib in our application. smsLib has a dependency to
jsmpp2.1.0. If I try to send a short message with smsLib, I have to insert 
userId and password to and specific method see below:

JSMPPGateway gateway = new JSMPPGateway("smppcon", "11.22.33.44", 4200, new 
BindAttributes("userId", "password", "", BindType.TRANSMITTER));

in this case I have to insert userId and password as String but it does
not work because our smsc server is expecting hex code. Here is an example:

Application: 00 00 00 24 00 00 00 01 00 00 00 00 00 00 00 userId 00password 00 
004 00 00 00
SMSC: 00 00 00 24 00 00 00 09 00 00 00 00 00 00 00 01 35 30 30 35 33 00 69 41 
4E 35 30 30 35 33 00 00 34 00 00 00

so I tried to convert String to hex and insert it to that method as argument 
but every time I got an exception
for jsmpp like this.

java.io.IOException: Failed sending bind since some string parameter area 
invalid : C-Octet String value '7363733330323631' cannot more than 9. Actual 
length of string is 16
        at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:241)
        at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:200)
        at org.smslib.smpp.jsmpp.JSMPPGateway.startGateway(JSMPPGateway.java:144)
        at org.smslib.Service$1Starter.run(Service.java:277)

that means smpp is expecting just password in hex which are not longer than 9. 
I want to know why did you
implement this validation of length and how can I use your lib with out 
modifying it.

thank you for your time and hesitation

Saeed

Original issue reported on code.google.com by saeed.as...@gmail.com on 18 Mar 2013 at 4:16

GoogleCodeExporter commented 8 years ago
From the SMPP 3.4 spec, the password are Var max 9 C-Octet String, it means 
maximum only contains 8 characters.

Original comment by uuda...@gmail.com on 19 Mar 2013 at 6:08