To whom it may concern, I saw that with my SMSC I get null message and optional parameters contained message_state and receipt_messate_id, so I solved it with the following code :
try {
OptionalParameter[] prms = deliverSm.getOptionalParametes();
for(OptionalParameter param : prms){
byte[] bytes = param.serialize();
if (param.tag == Tag.MESSAGE_STATE.code()){
int message_state = bytes[4];
System.out.println("Message state : "+message_state);
}
else if(param.tag == Tag.RECEIPTED_MESSAGE_ID.code()){
byte[] messageIdArray = new byte[bytes.length -4];
System.arraycopy(bytes,4,messageIdArray,0,messageIdArray.length);
String message_id = new String(messageIdArray);
System.out.println("deliver_sm message_id : "+message_id);
}
}
} catch (Exception e) {
System.err.println("Failed getting delivery receipt");
e.printStackTrace();
}