smppjs
v1.3.1
Published
Modern approach to smpp protocol.
Readme
About
This library is designed to provide a modern approach to smpp protocol, making easy interaction with the protocol.
Support
- Node version
ES6, Node >=8 - Typescript types
Getting started
Calling
const client = new Client({ interfaceVersion: 80, debug: false });Simple to call and manage.
PDU
client.bindTransceiver({ systemId: 'system', password: 'pass' });Simple and clean to call a PDU.
Examples
Basic use
const client = new Client({
interfaceVersion: 80,
debug: true,
secure: { tls: false, unsafeBuffer: false },
enquireLink: {
auto: true,
interval: 10000,
},
});
client.connect({ url: 'localhost:2775', });
client.on('connect', () => {
console.log('Connected');
client.bindTransceiver({ systemId: 'system', password: 'pass' });
client.submitSm({ esmClass: 0x00, dataCoding: 0x08, destinationAddr: '0000000000', shortMessage: { message: 'Hello!', encoding: 'ascii' } });
});Debug
You can easily receive debug information using the debug event, so you can implement the logging system according to your wishes.
const client = new Client({
interfaceVersion: 80,
// Set debug true
debug: true,
secure: { tls: false, unsafeBuffer: false },
enquireLink: {
auto: true,
interval: 10000,
},
});
client.on('debug', (data) => {
// Use your favorite logger implementation here.
console.log(data);
});