Write a transient state as an intermediate delivery notification

This commit is contained in:
2026-09-04 08:38:29 +02:00
parent 2936c7060d
commit 54493c12b2
6 changed files with 35 additions and 13 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ export function parseReceipt(message: string): Receipt {
type MessageType = 'intermediate' | 'other' | 'receipt' | 'unmarked';
/** SMPP 3.4 Appendix B lists every other receipt state as final. */
const transientStates: MessageState[] = ['ENROUTE', 'SCHEDULED'];
export const transientStates: MessageState[] = ['ENROUTE', 'SCHEDULED'];
/** Written by the far-end SME, not by the MC reporting on a message we submitted. */
const smeMessageTypes: number[] = [
+4 -2
View File
@@ -5,7 +5,7 @@ import type { Result, VoidResult } from './result.ts';
import type { Session } from './session.ts';
import { UnansweredError } from './unanswered-error.ts';
import { consts } from './defs/constants.ts';
import { receiptCodes } from './dlr.ts';
import { receiptCodes, transientStates } from './dlr.ts';
import { smppDate } from './message.ts';
import { uuidv7 } from './uuid.ts';
@@ -192,7 +192,9 @@ async function sendDlr(
cmdName: 'deliver_sm',
params: {
destination_addr: sms.from,
esm_class: consts.ESM_CLASS.MC_DELIVERY_RECEIPT,
esm_class: transientStates.includes(status)
? consts.ESM_CLASS.INTERMEDIATE_DELIVERY
: consts.ESM_CLASS.MC_DELIVERY_RECEIPT,
short_message: receiptText(sms, smsId, status),
source_addr: sms.to,
},