Cannot send SMS with over 255 chars.
See original GitHub issueHi, I got an issue sending SMS when I send an SMS with 280 chars. Is it possible to send message over 255 chars, If yes, Please help me how to fix it or show me what did I do wrong. Thank sa lot.
Here is my code to submit_sm:
session.submit_sm({
source_addr: 'TEST',
destination_addr: number,
short_message: message
}, function(pdu) {
if (pdu.command_status == 0) {
console.log("- submit_sm success",pdu.message_id);
session.close();
}
else{
console.log("- submit_sm fail:", pdu);
session.close();
}
});
Here is error log:
0|DMV-VNP: | TypeError: "value" argument is out of bounds
0|DMV-VNP: | at checkInt (buffer.js:1026:11)
0|DMV-VNP: | at Buffer.writeUInt8 (buffer.js:1074:5)
0|DMV-VNP: | at Object.write (/home/dmvit/testSMS/SMS/node_modules/smpp/lib/defs.js:86:11)
0|DMV-VNP: | at PDU.toBuffer (/home/dmvit/testSMS/SMS/node_modules/smpp/lib/pdu.js:175:20)
0|DMV-VNP: | at Session.send (/home/dmvit/testSMS/SMS/node_modules/smpp/lib/smpp.js:97:24)
0|DMV-VNP: | at Array.<anonymous> (/home/dmvit/testSMS/SMS/routes/index.js:42:18)
0|DMV-VNP: | at Session._extractPDUs (/home/dmvit/testSMS/SMS/node_modules/smpp/lib/smpp.js:69:40)
0|DMV-VNP: | at emitNone (events.js:86:13)
0|DMV-VNP: | at Socket.emit (events.js:185:7)
0|DMV-VNP: | at emitReadable_ (_stream_readable.js:432:10)
0|DMV-VNP: | at emitReadable (_stream_readable.js:426:7)
0|DMV-VNP: | at readableAddChunk (_stream_readable.js:187:13)
0|DMV-VNP: | at Socket.Readable.push (_stream_readable.js:134:10)
0|DMV-VNP: | at TCP.onread (net.js:548:20)
Issue Analytics
- State:
- Created 7 years ago
- Comments:11
@Sukhrob I tried, It didn’t work. I think it’s provider’s problem.
I solved problem using this answer: https://github.com/farhadi/node-smpp/issues/4#issuecomment-150810079
then while sending
submit_sm
:@habaongoc Are you testing with GSM or CDMA operator? If it is GSM, then use “message_payload” instead of “short_message”. If it is CDMA, you must send multiple messages. Please, refer to this link https://github.com/farhadi/node-smpp/issues/4