Read a peer's submit and receipt message ids into one notation before comparing them
This commit is contained in:
@@ -3,6 +3,7 @@ import type { OnRequest } from './session-options.ts';
|
||||
import type { PduObject } from './pdu.ts';
|
||||
import type { Session } from './session.ts';
|
||||
import type { SmppLog } from './log.ts';
|
||||
import type { SmsIdFormat } from './sms-id.ts';
|
||||
import { Reassembler, decodeSegments } from './reassembly.ts';
|
||||
import { bindCommands, defaults } from './session-options.ts';
|
||||
import { concatInfo } from './udh.ts';
|
||||
@@ -18,6 +19,7 @@ export type IncomingRequestsOptions = {
|
||||
maxReassembly?: number | undefined;
|
||||
onRequest?: OnRequest | undefined;
|
||||
reassemblyTimeout?: number | undefined;
|
||||
receiptIdFormat?: SmsIdFormat | undefined;
|
||||
session: Session;
|
||||
systemId?: string | undefined;
|
||||
};
|
||||
@@ -28,6 +30,7 @@ export class IncomingRequests {
|
||||
private readonly log: SmppLog;
|
||||
private readonly onRequest: OnRequest | undefined;
|
||||
private readonly reassembler: Reassembler;
|
||||
private readonly receiptIdFormat: SmsIdFormat | undefined;
|
||||
private readonly session: Session;
|
||||
private readonly systemId: string;
|
||||
|
||||
@@ -41,6 +44,7 @@ export class IncomingRequests {
|
||||
maxOctets: options.maxOctets,
|
||||
timeout: options.reassemblyTimeout ?? defaults.reassemblyTimeout,
|
||||
});
|
||||
this.receiptIdFormat = options.receiptIdFormat;
|
||||
this.session = options.session;
|
||||
this.systemId = options.systemId ?? defaults.systemId;
|
||||
}
|
||||
@@ -97,7 +101,7 @@ export class IncomingRequests {
|
||||
|
||||
/** SMPP carries a mobile-originated message and a delivery receipt on the same command. */
|
||||
private async onDeliverSm(pduObj: PduObject): Promise<void> {
|
||||
const dlr = dlrFromPdu(pduObj);
|
||||
const dlr = dlrFromPdu(pduObj, this.receiptIdFormat);
|
||||
|
||||
if (!dlr) {
|
||||
this.onMessage(pduObj);
|
||||
|
||||
Reference in New Issue
Block a user