Farhadi, i am really having a tough time here getting the smpp-node to work. i get this error when trying your example.
{"command_length":16,"command_id":2147483657,"command_status":13,"sequence_number":1,"command":"bind_transceiver_resp"}. I tried to do and i get
this.command_id = commands[command].id; ^ TypeError: Cannot read property 'id' of undefined at new PDU (/Users/tinyiko/MyCode/MyApp/node_modules/smpp/lib/pdu.js:21:37) at PDU.response (/Users/tinyiko/MyCode/MyApp/node_modules/smpp/lib/pdu.js:80:9) at Array. (/Users/tinyiko/MyCode/MyApp/sendmessage.js:12:52) at Session._extractPDUs (/Users/tinyiko/MyCode/MyApp/node_modules/smpp/lib/smpp.js:62:40) at Socket.emit (events.js:104:17) at emitReadable_ (_stream_readable.js:424:10) at emitReadable (_stream_readable.js:418:7) at readableAddChunk (_stream_readable.js:174:11) at Socket.Readable.push (_stream_readable.js:126:10)
This is the code i am trying...
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));
}
});
}
});