Initial commit

This commit is contained in:
PhatPhuckDave
2024-07-22 19:58:07 +02:00
commit cd8322cc5a
11 changed files with 354 additions and 0 deletions

43
jstester/smppClient.js Normal file
View File

@@ -0,0 +1,43 @@
const smpp = require("smpp");
let message_id = 0;
const session = smpp.connect(
{
url: "smpp://0.0.0.0:6001",
auto_enquire_link_period: 10000,
debug: true,
},
function () {
session.bind_transceiver(
{
system_id: "test",
password: "test",
},
function (pdu) {
if (pdu.command_status === 0) {
// Successfully bound
console.log("sending shit");
session.submit_sm(
{
source_addr: "smpp_test_1",
destination_addr: "123123123123",
short_message: "Hello!",
data_coding: 0xc0,
},
function (pdu) {
if (pdu.command_status === 0) {
console.log(pdu.message_id);
message_id = pdu.message_id;
}
}
);
}
}
);
}
);
session.on("deliver_sm", function (pdu) {
console.log("Got deliver_sm");
session.send(pdu.response());
});