npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jssip_client

v0.3.0

Published

Flowroute SIP over WebSocket and WebRTC JavaScript client

Downloads

50

Readme

Flowroute JsSIP Client

Flowroute SIP over WebSocket and WebRTC JavaScript client.

It's actually is a facade for WebRTC, DOM and JsSIP APIs to easy development of Flowroute applications on frontend.

Online demo

https://demo.webrtc.flowroute.com/fr.html?cache_invalidate=xxx

Installation for usage

NPM

Available on Node Package Manager: npm install --save jssip_client

CDN

For a static script installation. Soon.

Setting up core development environment

You'll only require node (+10.x.y) (if you haven't installed it yet, use nvm). Then after clonning this repository, change directory to its root and run once:

npm install

And after this, you probably will enjoy to see a demo app with hot reloading on your browser:

npm start

This demo HTML code is pretty simple and you can use it to further developing a frontend application on any lib/framework (React, jQuery, Angular, Vue etc.) or even vanilla JavaScript.

With the UI debugging console, you can see many of actions being dispatched by the user agent and its calls, everything that is available to you.

Creating releases

For package maintainers:

./release.sh x.y.z

Where "x.y.z" is actually the version you want to release (like ./release.sh 0.0.1).

This script will change the version in package.json, build production artifacts into releases/ directory and and commit them. After this, you will want to git push these changes and, for Node maintainers, also run npm publish command.

Examples of features

First, create an instance of Flowroute client. You can pass some optional parameters to turn on the browser console SIP debugging and handle every client actions. All available param keys are available on constructor docstring (so if you use a mainstrain editor/IDE, it'll even show them for you with descriptions). Remember that these parameters are optional and you can make a call work without them, they'll be assigned to default ones.

const flowrouteClient = new FlowrouteClient({
  debug: true,
  onUserAgentAction: console.warn,
  intervalOfQualityReport: 5000,
  pointOfPresence: 'us-west-or',
});

Note that the example above is passing a param of QoS report. That's because during this interval of milliseconds, a SIP MESSAGE will be sent with WebRTC stats about the call RTC connection.

There's also a selected PoP, because many Flowroute PoPs are equiped with WebSocket/WebRTC gateways. The preferred PoP and its related edge strategy can be set using Flowroute APIs and the same ones are supported by this client, is therefore possible for a customer to control where the media should be relayed to ensure we can avoid unnecessary media relay.

Some other common parameters are callerId and password. Always check the docstring for the full list.

Having the client ready, you can start a connection with the signaling server and invoke the SIP REGISTER:

flowrouteClient.start();

After receiving the { type: 'registered' } action on onUserAgentAction callback, you're free to make calls. And it's simple as:

flowrouteClient.call({
  to: '',
  onCallAction: console.warn,
});

As always, parameters are optionals (although you can consider this to a required one, another approach is using flowrouteClient.setDID method before this and here omitting to). If you want, a audioConstraints parameter is available so you can pick, for example, a selected audio output device id.

You can easily control player volume, from 0 (mutting it) to 100 (loudest):

flowrouteClient.setOutputVolume(100);

During a call, you can get its instance and make actions with JsSIP.RTCSession API, like sending DTMFs:

flowrouteClient.getActiveCall().sendDTMF('4');
flowrouteClient.getActiveCall().sendDTMF('2');

Technical debts so far

Feel free to contribute on this:

  • answering calls
  • unit tests
  • polyfill for IE
  • easy to download and use released script versions