smppjs
Version:
Modern approach to smpp protocol.
28 lines • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cancelSmDTO = void 0;
const helpers_1 = require("../helpers");
const MAX_LENGTH = {
message_id: 65,
service_type: 6,
source_addr: 21,
destination_addr: 21,
};
const cancelSmDTO = ({ destinationAddr, messageId, systemTypeValue, sourceAddrTon, sourceAddrNpi, sourceAddr, destAddrTon, destAddrNpi, }) => {
const dto = {
command: {
service_type: { type: 'Cstring', value: systemTypeValue || '' },
message_id: { type: 'Cstring', value: messageId },
source_addr_ton: { type: 'Int8', value: sourceAddrTon || 0 },
source_addr_npi: { type: 'Int8', value: sourceAddrNpi || 0 },
source_addr: { type: 'Cstring', value: sourceAddr || '' },
dest_addr_ton: { type: 'Int8', value: destAddrTon || 0 },
dest_addr_npi: { type: 'Int8', value: destAddrNpi || 0 },
destination_addr: { type: 'Cstring', value: destinationAddr },
},
};
(0, helpers_1.dtoValidation)({ dto, MAX_LENGTH });
return dto;
};
exports.cancelSmDTO = cancelSmDTO;
//# sourceMappingURL=cancel_sm.js.map