1

I am using Node SMPP,i am able to send SMS to my number but i can't get delivery receipt it is delivered or not . Please refer my below code

can you please guide if anything went wrong

var smpp = require('smpp');
var session = smpp.connect('103.250.30.x', 51612);

session.bind_transceiver({
  system_id: 'makesms1',
  password: 'Prasad@1'
}, function(pdu) {
  if (pdu.command_status == 0) {
    // Successfully bound
    console.log('bound bind_transceiver')
    session.submit_sm({
        destination_addr: '90000541x0',
        short_message: new Buffer("Hi, Froxtel interview SMS/email has been sent by company only. Its not any related to freshersworld. U can contact directly company or call 08688805062/3.Please ignore the word freshersworld in sms/mail.regards Froxtel team.","utf8"),
        source_addr:'FROXTL',
        registered_delivery:1,
        data_coding:0,

    }, function(pdu) {

        if (pdu.command_status == 0) {
            // Message successfully sent
            console.log(JSON.stringify(pdu));



        }
    });
}
});

When i use nodejs shorty module it working fine and i am able to get delivery receipt . but i am unable to send long message.

should i use data_sm for long messages or other ?

mahesh
  • 332
  • 4
  • 7

1 Answers1

4

Your code looks fine for sending and processing the responses to your outgoing requests.

The delivery receipts are sent from the smpp server to your client using deliver_sm pakets and therefore you need to register an event handler:

session.on('deliver_sm', function(pdu) {
    console.log(pdu.short_message);
    session.send(pdu.response());
});
Martin
  • 640
  • 7
  • 11