Fix issue where center set to echo would echo every message part

Now echo simply does not work with long messages
This commit is contained in:
2023-05-02 13:09:00 +02:00
parent 85dfc6f565
commit 03716404f0
2 changed files with 8 additions and 8 deletions

View File

@@ -115,11 +115,11 @@ export default abstract class SmppSession {
doSendPdu(pdu: PDU, session: any): Promise<any> {
return new Promise<any>((resolve, reject) => {
// let characterSizeBits: number = LongSmsProcessor.getCharacterSizeForEncoding(pdu);
// let maxMessageLength: number = LongSmsProcessor.maxMessageSizeBits / characterSizeBits;
// if (!!pdu.short_message && pdu.short_message.length > maxMessageLength) {
// pdu.short_message = pdu.short_message.substring(0, maxMessageLength);
// }
let characterSizeBits: number = LongSmsProcessor.getCharacterSizeForEncoding(pdu);
let maxMessageLength: number = LongSmsProcessor.maxMessageSizeBits / characterSizeBits;
if (!!pdu.short_message && pdu.short_message.length > maxMessageLength) {
pdu.short_message = pdu.short_message.substring(0, maxMessageLength);
}
session.send(pdu, (reply: any) => resolve(reply));
this.eventEmitter.emit(this.EVENT.ANY_PDU_TX, pdu);
});
@@ -224,4 +224,4 @@ export default abstract class SmppSession {
this.logger.log1(`PDU processor: ${processor.constructor.name}-${this.id} already attached to session`);
}
}
}
}