Added support for flash messages

This commit is contained in:
2015-06-16 17:58:39 +02:00
parent 2f65fd118b
commit 96a9e2c46a
4 changed files with 24 additions and 7 deletions
+8 -5
View File
@@ -405,13 +405,16 @@ function objToPdu(obj, callback) {
// If param "short_message" exists, encode it and set parameter "data_coding" accordingly
if (obj.params.short_message !== undefined && ! Buffer.isBuffer(obj.params.short_message)) {
// Detect encoding
obj.params.data_coding = defs.encodings.detect(obj.params.short_message);
log.silly('larvitsmpp: lib/utils.js: objToPdu() - data_coding "' + obj.params.data_coding + '" detected');
// Detect encoding if is not set already
if (obj.params.data_coding === undefined) {
obj.params.data_coding = defs.encodings.detect(obj.params.short_message);
// Now set the hex value
obj.params.data_coding = defs.consts.ENCODING[obj.params.data_coding];
log.silly('larvitsmpp: lib/utils.js: objToPdu() - data_coding "' + obj.params.data_coding + '" detected');
// Now set the hex value
obj.params.data_coding = defs.consts.ENCODING[obj.params.data_coding];
}
// Acutally encode the string
shortMsg = obj.params.short_message;