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:
@@ -10,7 +10,7 @@ export default class EchoPduProcessor extends Postprocessor {
|
||||
|
||||
processPdu(session: any, pdu: any, entity?: SmppSession | undefined): Promise<any> {
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
if (!!pdu.command && pdu.command === "submit_sm") {
|
||||
if (!!pdu.command && pdu.command === "submit_sm" && !pdu.short_message.udh) {
|
||||
let echoPdu = new smpp.PDU('deliver_sm', {...pdu});
|
||||
echoPdu.source_addr = pdu.destination_addr;
|
||||
echoPdu.destination_addr = pdu.source_addr;
|
||||
@@ -19,4 +19,4 @@ export default class EchoPduProcessor extends Postprocessor {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user