Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESTCOM-1927: Workaround, hardcode submit_sm encoding to UTF-8 #2877

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ private void inbound(final Object message) throws IOException {
if(request.getSmppEncoding().equals(CharsetUtil.CHARSET_UCS_2)) {
encoding = SmsSessionRequest.Encoding.UCS_2;
} else {
//FIXME: unused, due to hardcoded encoding in SmppMessageHandler
//quick fix for https://telestax.atlassian.net/browse/RESTCOMM-1927
encoding = SmsSessionRequest.Encoding.GSM;
}
// Store the last sms event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,18 @@ public PduResponse firePduRequestReceived(PduRequest pduRequest) {

DeliverSm deliverSm = (DeliverSm) pduRequest;
try {
String decodedPduMessage = CharsetUtil.CHARSET_MODIFIED_UTF8.decode(deliverSm.getShortMessage());
String decodedPduMessage;
String destSmppAddress = deliverSm.getDestAddress().getAddress();
String sourceSmppAddress = deliverSm.getSourceAddress().getAddress();
Charset charset;
if (DataCoding.DATA_CODING_UCS2 == deliverSm.getDataCoding()) {
charset = CharsetUtil.CHARSET_UCS_2;
} else {
charset = CharsetUtil.CHARSET_GSM;
//FIXME: quick fix for https://telestax.atlassian.net/browse/RESTCOMM-1927
charset = CharsetUtil.CHARSET_UTF_8;
}
//FIXME: Workaround RESTCOMM-1927
decodedPduMessage = charset.decode(deliverSm.getShortMessage());
//send received SMPP PDU message to restcomm
try {
sendSmppMessageToRestcomm(decodedPduMessage, destSmppAddress, sourceSmppAddress, charset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ public void outbound(SmppOutboundMessageEntity request) throws SmppInvalidArgume
textBytes = CharsetUtil.encode(request.getSmppContent(), CharsetUtil.CHARSET_UCS_2);
} else {
submit0.setDataCoding(DataCoding.DATA_CODING_GSM7);
textBytes = CharsetUtil.encode(request.getSmppContent(), request.getSmppEncoding());

//FIXME: quick fix for https://telestax.atlassian.net/browse/RESTCOMM-1927
textBytes = CharsetUtil.encode(request.getSmppContent(), CharsetUtil.CHARSET_UTF_8);
}

//TODO reverted from https://telestax.atlassian.net/browse/RESTCOMM-1595 as it caused SMS loop at SMSC
Expand Down