New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ringcentral-softphone

Package Overview
Dependencies
Maintainers
0
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ringcentral-softphone

This is a TypeScript SDK for RingCentral Softphone. It is a complete rewrite of the [RingCentral Softphone SDK for JavaScript](https://github.com/ringcentral/ringcentral-softphone-js)

  • 1.0.0-alpha.2
  • npm
  • Socket score

Version published
Weekly downloads
23
decreased by-90.73%
Maintainers
0
Weekly downloads
 
Created
Source

RingCentral Softphone SDK for TypeScript

This is a TypeScript SDK for RingCentral Softphone. It is a complete rewrite of the RingCentral Softphone SDK for JavaScript

Users are recommended to use this SDK instead of the JavaScript SDK.

Installation

yarn install ringcentral-softphone

Where to get SIP_INFO_OUTBOUND_PROXY, SIP_INFO_USERNAME, SIP_INFO_PASSWORD and SIP_INFO_AUTHORIZATION_ID?

  1. Login to https://service.ringcentral.com
  2. Find the user/extension you want to use
  3. Check the user's "Devices & Numbers"
  4. Find a phone/device that you want to use
  5. if there is none, you need to create one. Check steps below for more details
  6. Click the "Set Up and Provision" button
  7. Click the link "Set up manually using SIP"
  8. At the bottom part of the page, you will find "Outbound Proxy", "User Name", "Password" and "Authorization ID"

Usage

import Softphone from 'ringcentral-softphone';

const softphone = new Softphone({
  outboundProxy: process.env.SIP_INFO_OUTBOUND_PROXY,
  username: process.env.SIP_INFO_USERNAME,
  password: process.env.SIP_INFO_PASSWORD,
  authorizationId: process.env.SIP_INFO_AUTHORIZATION_ID,
});

For complete examples, see demos/

domain

For UK accounts you need to explicitly specify the domain parameter:

{
  domain: 'sip.ringcentral.co.uk',
}

US accounts use sip.ringcentral.com by default if you don't specify it.

Please do not specify port number in domain.

Supported features

  • inbound call
  • outbound call
  • inbound DTMF
  • outbound DTMF
  • reject inbound call
  • cancel outbound call
  • hang up ongoing call
  • receive audio stream from peer
  • stream local audio to remote peer
  • call transfer

Notes

Audio formats

The codec used between server and client is "OPUS/48000/2". This SDK will auto decode/encode the codec to/from "uncompressed PCM".

Bit rate is 16, which means 16 bits per sample. Sample rate is 48000, which means 48000 samples per second. Encoding is "signed-integer". There are two channels

You may play saved audio by the following command:

play -t raw -b 16 -r 48000 -e signed-integer -c 2 test.wav

Invalid callee number

If you call an invalid number. The sip server will return "SIP/2.0 486 Busy Here".

This SDK will emit a "busy" event for the call session and dispose it.

You can detect such an event by:

callSession.once('busy', () => {
  console.log('cannot reach the callee number');
});

Todo

  • Try other payload types, such as OPUS
    • tried OPUS/16000, but the received packets are quite small and cannot be played
  • check the code of PJSIP and refactor the code.

Dev Notes

  • We don't need to explicitly tell remote server our local RTP port via SIP SDP message. We send a RTP message to the remote server first, so the remote server knows our IP and port. So, the port number in SDP message could be fake.
  • Ref: https://www.ietf.org/rfc/rfc3261.txt
  • Caller Id feature is not supported. P-Asserted-Identity doesn't work. I think it is by design, since hardphone cannot support it.

FAQs

Package last updated on 07 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc