question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot send SMS with over 255 chars.

See original GitHub issue

Hi, 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:closed
  • Created 7 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
notgiorgicommented, Dec 16, 2016

@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

    calculateMessageUHD(sms) {
        const info = gsm(sms)
        const cref = this.concat_ref
        return info.parts.map((part, i) => {
            
            let udh = new Buffer(6)
            udh.write(String.fromCharCode(0x5), 0) //Length of UDF
            udh.write(String.fromCharCode(0x0), 1) //Indicator for concatenated message
            udh.write(String.fromCharCode(0x3), 2) //  Subheader Length ( 3 bytes)
            udh.write(String.fromCharCode(cref), 3) //Same reference for all concatenated messages
            udh.write(String.fromCharCode(info.sms_count), 4) //Number of total messages in the concatenation
            udh.write(String.fromCharCode(i + 1), 5) //Sequence number ( used by the mobile to concatenate the split messages)

            return {
                udh: udh,
                message: part,
            }
        })
    }

then while sending submit_sm:

short_message: {
        udh: part.udh,
        message: part.message,
},
1reaction
sukhrobkhakimovcommented, Dec 2, 2016

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot save short text fields longer than 255 characters
When text longer than 255 characters is entered in a custom short text field, an error occurs.
Read more >
The text value is invalid, probably because it exceeds the 255 ...
The most common cause for this error is when the text value exceeds 255 characters, which is the limit set by SharePoint for...
Read more >
Solved: Value must be at most 255 characters
I have created the columns in SP List as Multiple lines of text. ... is exceeding 255 characters to a mutli-line text Column...
Read more >
Text Message Character Limit Need to Knows - Podium
Yes, you can send texts longer than 160 characters as MMS messages. You can also send an SMS over 160 characters, but it...
Read more >
Issue in sending mesage more than 255 characters #5 - GitHub
I'm using opensmpp for sending sms. But I'm not able to send sms more than 255 characters. Messages are not getting sent for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found