Open javadevmtl opened 2 years ago
A large message should be encoded in the message_payload optional parameter. A server should either use the shortMessage field, or the message_payload optional parameter when the shortMessage is empty.
@javadevmtl
Assuming you are implementing ServerMessageReceiverListener, and there is a method onAcceptSubmitSm , here is a sample to receive long message.
public SubmitSmResult onAcceptSubmitSm(SubmitSm submitSm, SMPPServerSession smppServerSession) throws ProcessRequestException {
OptionalParameter messagePayload = submitSm.getOptionalParameter(OptionalParameter.Tag.MESSAGE_PAYLOAD);
OptionalParameter.OctetString octateString = (OptionalParameter.OctetString) messagePayload;
String longMessage = octateString.getValueAsString();
//Or
String longMessage = new String(os.getValue(), <charset of your choice>);
}
@pmoerenhout Is this a correct way to do this?
Yes, the getValueAsString will construct the string with the system charset, so explitcitly using new String(os.getValue(),
Hi is there an example that shows on the server side how to accept a large message?