在bind_transceiver期间使用smpp-node时出错

时间:2015-10-26 20:09:42

标签: javascript node.js smpp

Farhadi,我真的很难让smpp-node工作。我在尝试你的例子时遇到这个错误。

{" command_length":16," command_id的":2147483657," command_status":13," sequence_number":1,&# 34;命令":" bind_transceiver_resp"}。我试着去做,我得到了

this.command_id = commands [command] .id;                                        ^ TypeError:无法读取属性' id'未定义的     在新的PDU(/Users/tinyiko/MyCode/MyApp/node_modules/smpp/lib/pdu.js:21:37)     在PDU.response(/Users/tinyiko/MyCode/MyApp/node_modules/smpp/lib/pdu.js:80:9)     在数组。 (/Users/tinyiko/MyCode/MyApp/sendmessage.js:12:52)     在Session._extractPDU(/Users/tinyiko/MyCode/MyApp/node_modules/smpp/lib/smpp.js:62:40)     在Socket.emit(events.js:104:17)     在emitReadable_(_stream_readable.js:424:10)     在emitReadable(_stream_readable.js:418:7)     在readableAddChunk(_stream_readable.js:174:11)     在Socket.Readable.push(_stream_readable.js:126:10)

这是我正在尝试的代码......

var smpp = require('smpp');
var session = smpp.connect('bulksms.2way.co.za', 2775);

console.log(session);

session.bind_transceiver({
  system_id: '673293',
  password: 'passwordxxx'
}, function(pdu) {
    if(pdu.command_status == 13){
    console.log("session" + pdu.command_status);
    pdu.response();
    console.log(JSON.stringify(pdu));
    }
  if (pdu.command_status == 0) {
    // Successfully bound
    console.log('bound bind_transceiver')
    session.submit_sm({
        destination_addr: '0847849574',
        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));
        }
    });
}
});

1 个答案:

答案 0 :(得分:0)

基于SMPP v5.0规范command_status = 0x0D表示:

  

绑定失败。绑定尝试的一般故障方案。这可能   由于配置错误,密码错误或其他原因。一个   MC通常会为无效的system_id返回此错误,   system_type,password或可能导致绑定的其他属性   故障。