Add busy status to center

This commit is contained in:
David Majdandžić
2023-03-31 21:57:14 +02:00
parent d920fd75d7
commit de5faa4ac9

View File

@@ -13,6 +13,7 @@ export class Center extends SmppSession {
"WAITING CONNECTION", "WAITING CONNECTION",
"CONNECTING", "CONNECTING",
"CONNECTED", "CONNECTED",
"BUSY"
]; ];
_username: string; _username: string;
_password: string; _password: string;
@@ -88,9 +89,11 @@ export class Center extends SmppSession {
let count = job.count || 1; let count = job.count || 1;
let interval = 1 / (job.perSecond || 1); let interval = 1 / (job.perSecond || 1);
this.setStatus(3);
this.sendTimer.setInterval(() => { this.sendTimer.setInterval(() => {
if (count > 0 && counter >= count) { if (count > 0 && counter >= count) {
this.cancelSendInterval(); this.cancelSendInterval();
this.setStatus(2);
} else { } else {
this.sendPdu(job.pdu, true); this.sendPdu(job.pdu, true);
counter++; counter++;