question

akif-akif4090 avatar image
akif-akif4090 asked vyshakhbabji answered

Can I place a call from browser to phone using RingOut?

Hello,

I am developing a chrome extension where I am using RingOut to place calls, as docs say that RingOut helps connect calls between two phone numbers.

Here I have from and to phoneNumbers and using Rest call I can place call. Is it necessary to configure a from phoneNumber with some direct line or will it use the browser's mic to place call?

While my task is to call from extension to some phone no.

I have created a direct phone no and 1 direct line for pc using sandbox account, I want to test a call from extension to desktop using Ringcentral RingOut.

Please help me and let me know if this approach is right or not.

Thanks

ringout
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

benjamin-dean avatar image
benjamin-dean answered benjamin-dean commented
Hey Akif,

1. Is it necessary to configure a from.phoneNumber using a direct line or will it use browser's mic to place call?

Answer:

If you are using RingOut via the API to make a call, you will need to provide a from.phoneNumber === one of the authenticated extension's valid phone numbers. See the alternative answer below for information about using WebRTC.

GET /restapi/v1.0/account/~/extension/<extensionId || ~>/phone-number 
From: https://platform[.devtest].ringcentral.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer { {YOUR_VALID_ACCESS_TOKEN}}

A successful response to GET Extension Phone Numbers will contain a "records" property, where each record is a phoneNumber which can be used in the POST Body of an HTTP Request to RingOut if the following criteria are satisfied:

  • usageType (one of) === MainCompanyNumber, CompanyNumber, DirectNumber 
  • type (one of) === VoiceFax, VoiceOnly
  • status === Normal
  • features === CallerId

2. I have created a direct phone no and 1 direct line for pc using sandbox account, I want to test a call from extension to desktop using RingCentral RingOut. What should I do?

Answer:

You cannot make a call from the extension to the desktop (if you are authenticated as the user you are calling, since you will receive a busy signal). You can however make a call from the extension (using the RingCentral Desktop Soft Phone) to an external phone number such as your cellular device or any other valid phone number in a country the authenticated extension is permitted to dial. Here are the basic instructions for this...
  1. GET an "access_token" for the Extension you created (as referenced in your question)
  2. GET the Extension's Phone Number List
  3. Filter the list and identify one of the phone number records which satisfies the criteria listed above, then cache the "phoneNumber" property of that record to use as the "from.phoneNumber" value in the POST body of your RingOut API Request to  Make a Call.
  4. Setup your POST HTTP Request, implementing the from.phoneNumber as indicated in step #3.
Alternative Answer:

You could make a phone call directly from the browser if you implement RingCentral WebRTC and the RingCentral Web Phone Client Library, but this will require additional code, an application which is configured with the necessary "VOIP Calling" API Permissions and configured to use Authorization Flow permitting users to authorize your app to obtain a valid token for interacting with the RingCentral API and services on their behalf. There is a demo application within the RingCentral Web Phone Client Library on Github you can use for testing and to inspect how to properly operate with the API it provides. Additionally, the Web Phone Client Library contains step-by-step directions on how to create and configure an application in the RingCentral Developer Portal for use with WebRTC.

Let me know if this answers your question.
2 comments
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks @Benjamin Dean for comment and help.

I have tried Ringcentral web rtc demo on my localhost,  when demo code sends post request to get access token, so i receive error in response saying: "Unauthorized for this grant type", code 0AU-251.

Note:
On other si de my app have voip calling permision, platform(browser) and authorization have auth code flow and refresh token permissions.

app_redirect_url:  http://localhost/ringcentral_webrtc_github/demo/


0 Likes 0 ·
Try adding these Redirect URLs to your app:

http://localhost:8080/demo/callback.html

http://localhost:8080/callback.html

That might solve that problem.
0 Likes 0 ·
vyshakhbabji avatar image
vyshakhbabji answered
You could pull the app from the develop branch from my repository.  https://github.com/vyshakhbabji/web-phone-1/tree/develop1  This repo is set up for 3 legged authorization. 

You will need to follow https://developer.ringcentral.com/api-docs/latest/index.html#!#AuthorizationCodeFlow   this document to set up your app on Dev Portal with redirect url. 

These links might come handy:
https://github.com/ringcentral/ringcentral-demos-oauth


1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys