Add protocolid and ucs2 processors

This commit is contained in:
2023-06-07 13:33:38 +02:00
parent a492b3bd72
commit a1e7d3f885
11 changed files with 778 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
import SmppSession from "../../../SmppSession";
import Preprocessor from "../Preprocessor";
export default class ProtocolId2DigitProcessor extends Preprocessor {
applicableCommands: string[] = ['submit_sm', 'deliver_sm'];
constructor(type: string) {
super(type);
}
protected doProcess(session: any, pdu: any, entity?: SmppSession | undefined): Promise<any> {
return new Promise<any>((resolve, reject) => {
pdu.protocol_id = 16;
});
}
}

View File

@@ -0,0 +1,16 @@
import SmppSession from "../../../SmppSession";
import Preprocessor from "../Preprocessor";
export default class ProtocolId3DigitProcessor extends Preprocessor {
applicableCommands: string[] = ['submit_sm', 'deliver_sm'];
constructor(type: string) {
super(type);
}
protected doProcess(session: any, pdu: any, entity?: SmppSession | undefined): Promise<any> {
return new Promise<any>((resolve, reject) => {
pdu.protocol_id = 2048;
});
}
}

View File

@@ -0,0 +1,17 @@
import SmppSession from "../../../SmppSession";
import Preprocessor from "../Preprocessor";
import {PDU} from "../../../CommonObjects";
export default class ProtocolId4DigitProcessor extends Preprocessor {
applicableCommands: string[] = ['submit_sm', 'deliver_sm'];
constructor(type: string) {
super(type);
}
protected doProcess(session: any, pdu: PDU, entity?: SmppSession | undefined): Promise<any> {
return new Promise<any>((resolve, reject) => {
pdu.data_coding = 2048;
});
}
}

View File

@@ -0,0 +1,16 @@
import SmppSession from "../../../SmppSession";
import Preprocessor from "../Preprocessor";
export default class ProtocolIdProcessor extends Preprocessor {
applicableCommands: string[] = ['submit_sm', 'deliver_sm'];
constructor(type: string) {
super(type);
}
protected doProcess(session: any, pdu: any, entity?: SmppSession | undefined): Promise<any> {
return new Promise<any>((resolve, reject) => {
pdu.protocol_id = 4;
});
}
}

View File

@@ -0,0 +1,17 @@
import SmppSession from "../../../SmppSession";
import Preprocessor from "../Preprocessor";
import {PDU} from "../../../CommonObjects";
export default class UCS2Preprocessor extends Preprocessor {
applicableCommands: string[] = ['submit_sm', 'deliver_sm'];
constructor(type: string) {
super(type);
}
protected doProcess(session: any, pdu: PDU, entity?: SmppSession | undefined): Promise<any> {
return new Promise<any>((resolve, reject) => {
pdu.data_coding = 8;
});
}
}