Coder Social home page Coder Social logo

sip.js's Introduction

This is an experimental fork of the sip.js library authored and maintained by Kirill Mikhailov.

This forked version is intended to enable support for binary content, as needed for the transport of SMS messages (content-type equal to application/vnd.3gpp.sms).

All the changes introduced by this fork are in the sip.js module.

API changes

All APIs remain as in the original library except for the following backward compatible changes.

sip.start(options, onRequest)

A new optional property has been defined for the options object:

  • binaryTypes - array of strings specifying the content types that should be handled as binary content when parsing a message; example options.binaryTypes = ['application/vnd.3gpp.sms']. Default to the empty list.

sip.send(message[, callback])

The content property of the message object is now handled in the following manner:

  • If the specified content is a string, then the behavior of the original kirm/sip.js library is retained;
  • If the specified content is a buffer, then it is handled as binary content. This holds true regardless of whether the message object has a content-type property, and - if so - regardless of the value of the content-type property.

sip.stringify(message)

In case the message object does not have a content property or the content property is a string, then the behavior of the original kirm/sip.js library is retained. Instead, if the content property is a buffer, then it is converted into a string of hex characters so that it can be conveniently displayed/logged.

sip.parse(message[, binaryTypes])

A new optional input parameter binaryTypes has been introduced. This has exactly the same definition as the one used with sip.start (see above).

Remarks

The original kirm/sip.js library is compatible with Node.js v0.2.2 or later while - in its present experimental form - this fork restricts compatibility to Noje.js v6 or later. This restriction can be easily relaxed by reverting from the use of Buffer.from() and Buffer.alloc() to the deprecated use of the new Buffer() constructor. However, this fork also uses the Buffer.indexOf() method which is not available in Node.js versions prior to v1.5.0.

sip.js's People

Contributors

kirm avatar manur avatar teifip avatar 486 avatar bryanpaluch avatar clshortfuse avatar jpc-technologies avatar blakmatrix avatar gtheron avatar mainiak avatar kirm2 avatar nguyer avatar sweiz avatar

Watchers

 avatar

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.