Coder Social home page Coder Social logo

roave / shorty Goto Github PK

View Code? Open in Web Editor NEW
92.0 13.0 52.0 979 KB

An asynchronous SMPP client and server built on Node.js. Shorty is sponsored and maintained by SMS Cloud, a subsidiary of Roave

Home Page: http://roave.com/

License: GNU General Public License v3.0

JavaScript 100.00%

shorty's Introduction

Shorty - SMPP Client / Server

Version 0.5.4 Created by Evan Coury and Ben Youngblood

Introduction

Shorty is a lightweight, high performance SMPP client and server built on Node.js (v0.6.x). Shorty is sponsored and maintained by SMS Cloud, a subsidiary of Roave.

Usage

New documentation coming Soon(tm).

License

Shorty is released under the terms of the GNU General Public License (GPL) Version 3. See COPYING file for details.

shorty's People

Contributors

aomitayo avatar bjyoungblood avatar evandotpro avatar thefrozenfire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shorty's Issues

Feature Request: Support deliver_sm_resp PDUs

Currently, deliver_sm PDUs arrive with registered_delivery bits are all set to 0, meaning no deliver_sm_resp is required from the ESME. While it is not necessary to change this to request deliver_sm_resp PDUs, support for response PDUs would be nice.

I currently receive and store messages in a database, and when the database is reachable I send back an ESME_ROK response PDU. However, should the database be inaccessible, I would like to be able to send back an ESME_RDELIVERYFAILURE response PDU and have shorty retry message delivery for up to 60 minutes (1 hour).

Bad PDU Parsing

Hi,
Thank you very much for your good job. However, there is problems with pdu parsing. As far as know, short message may come from either short_message or message_payload fields. Message_payload is not parsed and system has null for short message.

release 0.5.4 to npm

Hi guys, would you mind releasing the newest version 0.5.4 to npm registry? Thank you.

Client: automatically detect charset and convert and split sms by charset with overlenght to concat sms

my idee is that the client should automatically convert the charset (ie UTF-8 with only GSM 03.38 chars) to GSM 03.38 or if need (Unicode with other chars as in GSM 03.38) to USC2 charset.

If the message lenght is longer than 160/70(USC2) than split to messages with 153/63 chars.

with header support like in php-smpp
https://github.com/onlinecity/php-smpp/blob/master/smppclient.class.php#L280

CSMS_8BIT_UDH = 153 chars in concat mode
CSMS_16BIT_TAGS = 152 chars in concat mode
CSMS_PAYLOAD = for me unknown; not possible to test with my partners

some encodings in smpp (5.0)
https://github.com/farhadi/node-smpp/blob/master/lib/defs.js#L227

example like:
apihard@791e1b1

Clarity on Authourization regarding ESME server connections.

With reference to the methods below. How exactly does authourization of ESME to the SMPP server occur.
I would wish to call an API on my ruby app to cross check info and balance as part of authourization and go on to send submit message

self.handleBind = function(pdu) {
switch (pdu.command_id) {
case smpp.commands.bind_receiver:
self.bind_type = smpp.RECEIVER;
break;
case smpp.commands.bind_transceiver:
self.bind_type = smpp.TRANSCEIVER;
break;
case smpp.commands.bind_transmitter:
self.bind_type = smpp.TRANSMITTER;
break;
}

    // Ask the callback (if there is one) if the credentials are okay
    if (self.listeners('bind').length > 0) {
        self.emit('bind', self, pdu, function(status) {
            self.bindAuthorization(pdu, status);
        });
    } else {
        self.bindAuthorization(pdu, "ESME_ROK");
    }
};

self.bindAuthorization = function(pdu, status) {
    var newPdu, command;

    switch (self.bind_type) {
        case smpp.RECEIVER:
            command = "bind_receiver_resp";
            break;
        case smpp.TRANSMITTER:
            command = "bind_transmitter_resp";
            break;
        case smpp.TRANSCEIVER:
            command = "bind_transceiver_resp";
            break;
    }

    newPdu = {
        command: command,
        command_status: status,
        sequence_number: pdu.sequence_number,
        fields: {
            system_id: self.config.system_id
        },
        optional_params: {}
    };

    // Create a new PDU with our response
    if (status === "ESME_ROK") {
        self.system_id = pdu.system_id.toString('ascii');
        self.bound = true;
        self.socket.setTimeout(self.config.timeout * 1000);
        self.socket.on('timeout', self.enquire_link);
    } else {
        self.bound = false;
        self.bind_type = smpp.UNBOUND;
    }

    self.sendPdu(newPdu);

    self.emit('bindSuccess', self, pdu);
};

TypeError: In PDU writer

TypeError: Argument must be a string
at Object.exports.write (/storage/work/SMSMessenger/repos/com.swiftforge.smsmessenger.exchange/node_modules/shorty/lib/pdu-writer.js:193:38)

binary vcard sms

Hey have some one a example to send a vcard as binary?

Or a example to send all the binary data?

Thx

PDU Parser short_message Field Issue

To anyone facing issues with the PDU Parser's (pdu-parser.js) short_message field:

   else if (field.type === "string") {

        var length = result[field.length_field];

        var temp = new Buffer(length);

        // buffer.copy(temp, 0, offset, offset + field.length);
        // field.length is undefined
        // the author should have used length which he defined above
        buffer.copy(temp, 0, offset, offset + length);

        result[field.name] = temp;
        offset += length;

    }

High Traffic Performance Increase

If we want to connect to multiple SMPP servers, using a single clustered node.js app would it be advisable to create multiple Shorty client instances in each worker?

What are the performance implications here, and would it even be a good idea to open multiple sockets per worker to each single SMPP server? (Suggested pull request #22)

Would also be interested in completing TRANSMITTER and RECEIVER functionality that do not appear currently available in Shorty. Seems to be the right model according to this article:

SMPP Connection Types – Sender, Receiver, Transceiver
The type of connection that you use will depend on the preferences and policies of your SMPP service provider. Separate “sender” and “receiver” connections generally offer the best performance under extreme loads, however your provider may wish for you to use a “transceiver” connection to reduce the connection overhead on their server.

Handling concatenated SMS in submit_sm

Hi

Can you guide how can we handle concatenated SMS in submit_sm >. I don't want to use payload here. I am not able to recognize the concatenation flag .

Please advise.

PDU Parser fails when parsing type "string"

Parsing an incomming (deliver_sm) sms, the library crashed with the following error:

RangeError: out of range index
    at RangeError (native)
    at Object.exports.parse (.\node_modules\shorty\lib\pdu-parser.js:163:20)
    at Object.exports.fromBuffer (.\node_modules\shorty\lib\data-handler.js:76:22)
...

It seems that even though in the comment of the function it is explicitly stated

the length of the string will be specified by the value parsed in the field named by length_field

, the copy call in line 163 is still using field.length, instead of the determined length in line 161.
But field.length is undefined in that case.

Changing line 163 from
buffer.copy(temp, 0, offset, offset + field.length);
to
buffer.copy(temp, 0, offset, offset + length);
seems to fix the issue.

SMPP gatewey Developement

Hi,

I use shorty in my sms application for conneccto to SMPP v3.4 Server. I looking for contributors and testers.

My Appplication Scriptbox

Regards.

how set system-username

I worte a SMPP application with nodejs and shorty,

I try to connect to an carrier, but i can't set system-username,
How make it?...

With kannel the config is :

group=smsc
smsc=smpp
smsc-id=azur8800
interface-version=34
host=xxx.xxx.xxx.xxx
port=2775
transceiver-mode = 1
system-id=samtosa
smsc-username=oshimin
smsc-password=XXXXXXX
system-type=default

My config with shorty is :

{
    "smpp": [
        {
            "mode":         "transceiver",
            "host":         "xxx.xxx.xxx.xxx",
            "port":         2775,
            "system_id":    "oshimin",
            "password":     "XXXXXXX",
            "interface_version" : 34,
            "system_type":  "default",
            "addr_ton":     0,
            "addr_npi":     1,
            "addr_range":   "",
            "timeout":      30,
            "client_keepalive":  false,
            "client_reconnect_interval": 2000,
            "strict":       1
        }
    ],
    "debug":    true,
}

For kannel all is ok but for shorty i can't connect to the carrier, please help me.

Unable to unbind a client manually

when i connect to smpp it falls error to "bindFailure" event
and giving pdu ={ command_length: 21,
command_id: 2147483650,
command_status: 5,
sequence_number: 2 }

here command_status means my client already binded to server..

to resolve this i did this

shorty_Promotional_TX.on('bindFailure', function (pdu) {
shorty_Promotional_TX.unbind();
console.log(pdu)
});

but no fruit comes .. so how to unbind forcefully if already connected to smpp

npm version update

Hello,

Can you release a new 0.5.1 version with the current master branch code?

It fixes 348544d typo.

Thank you.

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.