Comments (7)
The best Way is to learn more about smpp Protocol so you dont Need a " Good error Message". Thats my two Cents.
Am 24.03.2014 um 09:59 schrieb Alex Yaroshevich [email protected]:
@farhadi @Dexus I'm talking about a good error message instead of strange stack trace. Thanks!
β
Reply to this email directly or view it on GitHub.
from node-smpp.
Simple Method:
Use the npm below
npm install gsm
The above module also splits the message into parts:
//We need to split the message and send it in many parts
var gsm = require('gsm');
var info = gsm("Your message string here");
//This is a unique id present in each message part
var concat_ref = this.concat_ref++;
var part_id = 0;
info.parts.forEach(function(part) {
part_id++;
var 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(concat_ref), 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(part_id), 5); //Sequence number ( used by the mobile to concatenate the split messages)
var submit_pdu = {
source_addr:msg.from,
destination_addr: msg.to,
short_message: { udh:udh, message:part },
registered_delivery:1 //If you want a delivery report
};
this.getSession().submit_sm(submit_pdu, function(pdu) {
if (pdu.command_status == 0) {
console.log("SMPP Gateway[" + this.getOptions().address + "] - SUMBIT[" + submit_pdu.source_addr + ">>>" + submit_pdu.destination_addr + "] - " + pdu.message_id);
}
if(callback) {
callback(pdu);
}
}.bind(this));
}.bind(this));
from node-smpp.
We've fixed this with using message_payload, but I still don't understand stack trace.
Looks like internal bug.
from node-smpp.
no, if you try to write sms longer than you must split the message by your self. and use udh to concat.
look for a sample (with shorty): https://github.com/DeineAgenturUG/shorty/blob/master/lib/sms.js
from node-smpp.
This is not a bug.
short_message parameter in SMPP protocol is of type Octet String which is limited to 255 bytes.
message_payload TLV parameter was introduced in v3.4 to overcome this limitation.
However, some server implementations don't support messages longer than 160 bytes. In this case, as Dexus said, you need to split messages yourself using udh. (http://en.wikipedia.org/wiki/Concatenated_SMS)
node-smpp doesn't handle errors when using inappropriate parameters which caused this error to be thrown.
from node-smpp.
@farhadi @Dexus I'm talking about a good error message instead of strange stack trace. Thanks!
from node-smpp.
Questions: Why do String.fromCharCode for these fields? Aren't they supposed to go as hexadecimal values instead of what String.fromCharCode returns?
I ask because, for instance on my PC I get > String.fromCharCode(0xFF) //=> 'ΓΏ'
and I don't get why we want to do this.
Thanks in advance
from node-smpp.
Related Issues (20)
- Support for user-defined TLVs
- Addition of more example on node-smpp usage HOT 10
- error on send pdu HOT 2
- Command status codes related to official SMPP Spec Error Codes
- Getting invalid password response from SMPP Server HOT 1
- Node client crash with ECONNRESET HOT 5
- Couldn't recieve SMS from SMSC HOT 7
- Differntiate between incoming message and an incoming message that gets triggered after a message is sent using smpp HOT 2
- Error while connecting to server PDU_STATUS 15 HOT 3
- connection issue when setting up the smpp server. HOT 6
- Getting esm_class === 4 for every sent SMS HOT 2
- [Support] total received DLR and Submit response vs total sent SMS
- message_payload or UDH header HOT 1
- Client Not reciving DLR Report
- Only one message recieved when multiple messages are sent. HOT 5
- couldn't perform submit_sm although there is a binding
- Rebind on reconnecting to smsc is not working
- Support for Session Pooling.
- How to handle bind_transrecivier command status 5 HOT 5
- Session Randomly dropped by the server | ECONNRESET HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-smpp.