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...
- GET an "access_token" for the Extension you created (as referenced in your question)
- GET the Extension's Phone Number List
- 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.
- 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.
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