1

我正在使用 Node SMPP,我可以向我的号码发送短信,但我无法获得送达收据,无论是否送达。请参考我下面的代码

如果出了什么问题,你能指导一下吗

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));



        }
    });
}
});

当我使用 nodejs shorty 模块时,它工作正常,我能够获得交货收据。但我无法发送长消息。

我应该将 data_sm 用于长消息还是其他?

4

1 回答 1

4

您的代码看起来可以很好地发送和处理对您传出请求的响应。

交付收据是从 smpp 服务器使用 Deliver_sm pakets 发送到您的客户端的,因此您需要注册一个事件处理程序:

session.on('deliver_sm', function(pdu) {
    console.log(pdu.short_message);
    session.send(pdu.response());
});
于 2014-03-15T19:38:53.417 回答