{"id":21406652,"url":"https://github.com/ringcentral/ringcentral-call-js","last_synced_at":"2025-07-14T00:32:39.536Z","repository":{"id":40119705,"uuid":"243201418","full_name":"ringcentral/ringcentral-call-js","owner":"ringcentral","description":"RingCentral Call aims to help developers to make and control call easily with RingCentral Web Phone and Call Control APIs. In this SDK, we use Web Phone for voice transmission, use Call Control API for call control.","archived":false,"fork":false,"pushed_at":"2025-06-26T05:34:05.000Z","size":614,"stargazers_count":10,"open_issues_count":4,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-26T06:29:53.286Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ringcentral.github.io/ringcentral-call-js/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ringcentral.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-26T07:52:22.000Z","updated_at":"2025-06-26T05:33:10.000Z","dependencies_parsed_at":"2024-11-22T16:51:33.234Z","dependency_job_id":null,"html_url":"https://github.com/ringcentral/ringcentral-call-js","commit_stats":{"total_commits":100,"total_committers":7,"mean_commits":"14.285714285714286","dds":0.39,"last_synced_commit":"3b98e44c3ad027d3b2f0134fa480bed0e75e73b3"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/ringcentral/ringcentral-call-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-call-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-call-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-call-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-call-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ringcentral","download_url":"https://codeload.github.com/ringcentral/ringcentral-call-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-call-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265227898,"owners_count":23731059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T16:41:23.405Z","updated_at":"2025-07-14T00:32:38.784Z","avatar_url":"https://github.com/ringcentral.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RingCentral Call JS SDK\n\n[![Coverage Status](https://coveralls.io/repos/github/ringcentral/ringcentral-call-js/badge.svg?branch=master)](https://coveralls.io/github/ringcentral/ringcentral-call-js?branch=master)\n[![NPM Version](https://img.shields.io/npm/v/ringcentral-call.svg?style=flat-square)](https://www.npmjs.com/package/ringcentral-call)\n[![Build Status](https://github.com/ringcentral/ringcentral-call-js/workflows/CI%20Pipeline/badge.svg?branch=master)](https://github.com/ringcentral/ringcentral-call-js/actions)\n\nRingCentral Call aims to help developers to make and control call easily with RingCentral Web Phone and Call Control APIs. In this SDK, we use Web Phone for voice transmission, use Call Control API for call control.\n\n## Key features\n\n* Call session management. Combined web phone session from WebRTC and telephony session from the Call Control API\n* Call session event. Handle telephony session event, sync status\n* Session functional API. Request call control API with function\n* Functional API to make and receive calls\n\n*Comparing with the [RingCentral Web Phone](https://github.com/ringcentral/ringcentral-web-phone/) and [Call Control SDK](https://github.com/ringcentral/ringcentral-call-control-js)*\n\n**RingCentral Web Phone**: connect user with the WebRTC and SIP based on WebSockets. Can only control the call in the current web phone device\n\n**RingCentral Call Control**: control calls with RESTful APIs, this doesn’t support voice transmission, support to control all calls in current extension user, or account level (admin).\n\n**RingCentral Call**: voice transmission with WebRTC, control calls with RESTful APIs, support to control all calls in current extension user.\n\n## Prerequisites\n\n* You will need an active RingCentral account to create RingCentral app. Don't have an account? [Get your Free RingCentral Developer Account Now!](https://developers.ringcentral.com/)\n* A RingCentral app\n    * App type: Browser-Based or Server/Web\n    * Permissions: 'Call Control', 'Read Accounts', 'Read Presence', 'Webhook Subscriptions' and 'VoIP Calling'\n\n## Install\n\nUse npm or yarn\n\n```bash\n$ yarn add @ringcentral/sdk @ringcentral/subscriptions ringcentral-call-control ringcentral-web-phone ringcentral-call\n```\n\nUse CDN scripts\n\n```html\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/es6-promise@latest/dist/es6-promise.auto.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/pubnub@latest/dist/web/pubnub.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/whatwg-fetch@latest/dist/fetch.umd.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/@ringcentral/sdk@latest/dist/ringcentral.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/@ringcentral/subscriptions@latest/dist/ringcentral-subscriptions.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/sip.js@0.13.5/dist/sip.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/ringcentral-web-phone@0.7.7/dist/ringcentral-web-phone.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/ringcentral-call@0.2.11/build/index.js\"\u003e\u003c/script\u003e\n```\n\n## Demo\n\nOnline: [Demo](https://ringcentral.github.io/ringcentral-call-js/)\n\nRun in local:\n\n```\n$ git clone https://github.com/ringcentral/ringcentral-call-js.git\n$ cd ringcentral-call-js\n$ yarn\n$ yarn build\n$ yarn start\n```\n\nOpen `http://localhost:8080/demo/`, and login with RingCentral account to test.\n\n## Usage\n\nFor this example you will also need to have [RingCentral JS SDK](https://github.com/ringcentral/ringcentral-js/tree/master/sdk#installation), [RingCentral JS Subscriptions SDK](https://github.com/ringcentral/ringcentral-js/tree/master/subscriptions#installation), [RingCentral Web Phone](https://github.com/ringcentral/ringcentral-web-phone) and [RingCentral Call Control](https://github.com/ringcentral/ringcentral-call-control) installed.\n\nCreate RingCentral Call instances:\n\n```js\nvar appClientId = '...'; \nvar appClientSecret = '...';\nvar appName = '...';\nvar appVersion = '...';\nvar rcCall;\n\nvar sdk = new RingCentral.SDK({\n  clientId: appClientId,\n  clientSecret: appClientSecret,\n  appName: appName,\n  appVersion: appVersion,\n  server: RingCentral.SDK.server.production // or .sandbox\n});\nvar subscriptions = new RingCentral.Subscriptions({ sdk });\n\nvar platform = sdk.platform();\n\nplatform\n  .login({\n    username: '...',\n    password: '...'\n  })\n  .then(function() {\n    return platform\n            .post('/restapi/v1.0/client-info/sip-provision', {\n              sipInfo: [{transport: 'WSS'}]\n            })\n  })\n  .then(function(res) {\n    return res.json();\n  })\n  .then(function(sipProvision) {\n    // create RingCentral web phone instance\n    var rcWebPhone = new RingCentral.WebPhone(sipProvision, {\n      appKey: appClientId,\n      appName: 'RingCentral Call Demo',\n      appVersion: '0.0.1'\n    });\n\n    // create RingCentral call instance\n    rcCall = new RingCentralCall({ webphone: rcWebPhone, sdk: sdk, subscriptions: subscriptions });\n    return rcCall;\n  })\n```\n\n## API\n\n### Initialize\n\nFirstly, we need to create [RingCentral JS SDK](https://github.com/ringcentral/ringcentral-js#installation) instance and [RingCentral Web Phone](https://github.com/ringcentral/ringcentral-web-phone#application) instance. Then pass them when initialize RingCentral Call instance:\n\n```js\nvar rcCall = new RingCentralCall({ webphone: rcWebPhone, sdk: sdk });\n```\n\n### Make a Call\n\nSwitch a call from other device\n\n```js\nconst session = await rcCall.makeCall({\n  type: 'webphone',\n  toNumber: 'phone number',\n  fromNumber: 'from number',\n})\n```\n\n### Switch Call\n\nSwitch a call voice into current web phone instance from other devices\n\n```js\nconst telephonySessionId = rcCall.sessions[0].id;\nconst session = await rcCall.switchCall(telephonySessionId);\n```\n\n### Events\n\n### New call session event\n\n```js\nvar session = null;\n\nrcCall.on('new', (newSession) =\u003e {\n  session = newSession;\n});\n```\n\n### Webphone registered event\n\n```js\nrcCall.on('webphone-registered', function () {\n  //  web phone feature is ready\n});\n```\n\n### Call control ready event\n\n```js\nrcCall.on('call-control-ready', function () {\n  //  call control feature is ready\n});\n```\n\n### Sessions List\n\n```js\nvar sessions = rcCall.sessions;\n```\n\n### Session API\n\n#### Hangup a call\n\n```js\nsession.hangup().then(...)\n```\n\n#### Hold a call\n\n```js\nsession.hold().then(...)\n```\n\n#### Unhold a call\n\n```js\nsession.unhold().then(...)\n```\n\n#### To voicemail\n\n```js\nsession.toVoicemail().then(...)\n```\n\n#### Reject a call\n\n```js\nsession.reject().then(...)\n```\n\n#### Answer a call\n\n```js\nsession.answer().then(...)\n```\n\n#### Forward a call\n\n```js\nsession.forward('forward number').then(...)\n```\n\n#### Transfer a call\n\n```js\nsession.transfer('transfer number').then(...)\n```\n\n#### Mute a call\n\n```js\nsession.mute().then(...)\n```\n\n#### Unmute a call\n\n```js\nsession.unmute().then(...)\n```\n\n### Session Event\n\nStatus changed event\n\n```js\nsession.on('status', ({ party }) =\u003e {\n  // console.log(part)\n});\n```\n\n## TODO\n\n- [ ] Conference Call Support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringcentral%2Fringcentral-call-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fringcentral%2Fringcentral-call-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringcentral%2Fringcentral-call-js/lists"}