Minor fixes

This commit is contained in:
David Majdandžić
2023-04-05 19:53:08 +02:00
parent 42493aab50
commit e0fd3a5c31
7 changed files with 19 additions and 16 deletions

View File

@@ -10,8 +10,8 @@ export default class EchoPduProcessor extends Postprocessor {
processPdu(session: any, pdu: any, entity?: SmppSession | undefined): Promise<any> {
return new Promise<any>((resolve, reject) => {
let promises = [];
if (pdu.response) {
if (!!pdu.command && pdu.command === "submit_sm") {
let promises = [];
let replyPromise = session.send(pdu.response());
let sendPromise = session.send(new smpp.PDU('deliver_sm', {
source_addr: pdu.destination_addr,
@@ -20,12 +20,12 @@ export default class EchoPduProcessor extends Postprocessor {
}));
promises.push(replyPromise);
promises.push(sendPromise);
Promise.all(promises).then((replyPdus: any) => {
resolve(replyPdus);
}).catch((error: any) => {
reject(error);
});
}
Promise.all(promises).then((replyPdus: any) => {
resolve(replyPdus);
}).catch((error: any) => {
reject(error);
});
});
}
}