Fix issue with jobs not being assigned a command
This commit is contained in:
@@ -18,8 +18,6 @@ export class Center extends SmppSession {
|
||||
_password: string;
|
||||
_id: number;
|
||||
_status: string = this.STATUS[0];
|
||||
_defaultSingleJob: Job;
|
||||
_defaultMultipleJob: Job;
|
||||
port: number;
|
||||
|
||||
pduProcessors: PduProcessor[] = [];
|
||||
@@ -44,6 +42,32 @@ export class Center extends SmppSession {
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
_defaultSingleJob: Job;
|
||||
|
||||
get defaultSingleJob(): Job {
|
||||
return this._defaultSingleJob;
|
||||
}
|
||||
|
||||
set defaultSingleJob(job: Job) {
|
||||
if (job.pdu && !job.pdu.command) {
|
||||
job.pdu.command = 'deliver_sm';
|
||||
}
|
||||
super.defaultSingleJob = job;
|
||||
}
|
||||
|
||||
_defaultMultipleJob: Job;
|
||||
|
||||
get defaultMultipleJob(): Job {
|
||||
return this._defaultMultipleJob;
|
||||
}
|
||||
|
||||
set defaultMultipleJob(job: Job) {
|
||||
if (job.pdu && !job.pdu.command) {
|
||||
job.pdu.command = 'deliver_sm';
|
||||
}
|
||||
super.defaultMultipleJob = job;
|
||||
}
|
||||
|
||||
sendMultiple(job: Job): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.validateSessions(reject);
|
||||
@@ -106,13 +130,13 @@ export class Center extends SmppSession {
|
||||
|
||||
serialize(): object {
|
||||
return {
|
||||
id: this.id,
|
||||
id: this._id,
|
||||
port: this.port,
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
status: this.status,
|
||||
defaultSingleJob: this.defaultSingleJob.serialize(),
|
||||
defaultMultipleJob: this.defaultMultipleJob.serialize(),
|
||||
username: this._username,
|
||||
password: this._password,
|
||||
status: this._status,
|
||||
defaultSingleJob: this._defaultSingleJob.serialize(),
|
||||
defaultMultipleJob: this._defaultMultipleJob.serialize(),
|
||||
processors: this.pduProcessors.map(p => p.serialize()),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user