pdu

A PDU parser and generator for browser and node

npm install pdu
4 downloads in the last week
13 downloads in the last month

pdu.js

PDU parser and generator for node or your browser.

How to install

npm install pdu.js

How to use

First require it:

var pdu = require('pdu');

pdu.generate()

    pdu.generate({
      text:'Some text',
      receiver:999999999999, //MSISDN
      encoding:'16bit' //Or 7bit if you're sending an ascii message.
    });

returns an array of generated pdu's.

pdu.parse()

pdu.parse('06918919015000240C9189194238148900003110211052254117CAB03D3C1FCBD3703AA81D5E97E7A079D93D2FBB00');

Returns an object, containing parsed information:

{ smsc: '9891100500',
smsc_type: '91',
sender: '989124834198',
sender_type: '91',
encoding: '7bit',
time: 1357953952000,
text: 'Javascript makes sense.' }
npm loves you