Coder Social home page Coder Social logo

Comments (7)

Dexus avatar Dexus commented on June 27, 2024 1

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.

vchatterji avatar vchatterji commented on June 27, 2024 1

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.

qfox avatar qfox commented on June 27, 2024

We've fixed this with using message_payload, but I still don't understand stack trace.
Looks like internal bug.

from node-smpp.

Dexus avatar Dexus commented on June 27, 2024

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.

farhadi avatar farhadi commented on June 27, 2024

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.

qfox avatar qfox commented on June 27, 2024

@farhadi @Dexus I'm talking about a good error message instead of strange stack trace. Thanks!

from node-smpp.

PauloPhagula avatar PauloPhagula commented on June 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.