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

@aigent/ringcentral-softphone

v0.5.3

Published

## What are the differences between ringcentral-web-phone and this project?

Downloads

4

Readme

RingCentral Softphone SDK for JavaScript

What are the differences between ringcentral-web-phone and this project?

ringcentral-web-phone is designed for client side and only works with browsers.

This project was originally designed for server and desktop. It doesn't require a browser to run. It could run in browser too.

Supported features:

  • Answer inbound call
  • Make outbound call
  • Speak and listen, two way communication
  • Call control features
    • Redirect inbound call to voicemail
    • Ignore inbound call

Demos

Install

yarn add ringcentral-softphone @rc-ex/core

For node.js you also need to:

yarn add ws wrtc

Usage

  • for node.js, check here
  • for browser, check here

Get realtime inbound audio

import { nonstandard } from 'wrtc'

softphone.once('track', e => {
  const audioSink = new nonstandard.RTCAudioSink(e.track)
  audioSink.ondata = data => {
    // here you have the `data`
  }
  softphone.once('BYE', () => {
    audioSink.stop()
  })
})

The data you got via audioSink.ondata is of the following structure:

{
  samples: Int16Array [ ... ],
  bitsPerSample: 16,
  sampleRate: 48000,
  channelCount: 1,
  numberOfFrames: 480,
  type: 'data'
}

Please note that, you may get different numbers, for example, sampleRate you get might be 16000 instead of 48000.

Official demos

Setup

yarn install
cp .env.sample .env

Edit .env file to specify credentials.

  • CALLEE_FOR_TESTING is a phone number to receive testing phone calls. You don't need to specify it if you do not make outbound calls.
  • If you have WEB_SOCKET_DEBUGGING=true, then all WebSocket traffic will be printed to console.

Run

  • for node.js yarn server
  • for browser yarn browser

Test

Make a phone call to the phone number you configured in .env file. The demo app will answer the call and you can speak and listen.

Interesting Use cases

Call supervision

Let's say there is a phone call ongoing between a customer and the call agent. You can use this library to supervise this phone call to get live audio stream. You can analyze the audio stream using some AI algorithm and provide tips to the call agent in real time.

Live transcription

Use this library to supervise an existing phone call to get live audio stream. Translate the audio stream into text by invoking some speech-to-text service. Show the text to the caller and/or callee so they can see live transcription.

Play recorded audio

You can create a program to make a phone call or answer a phone call and play recorded audio. This is good for announcement purpose. This is also good for quick voicemail drop. Or you can use text-to-speech service to read text to the callee.

Todo

  • How to create a publish message
  • How to forward a call