Hi Team, We are using Ringcentral javascript SDk to make and receive calls. We did the authorization with java SDK and saved required tokens and using the same tokens in javascript sdk using below code platform.auth().setData(tokens); But here I confused on how to get the WebPhone from the platform object. Could you please provide me the code to create a WebPhone after setting the tokens to platform.
Thank you Phong Vu. your answer was very helpful for me. I had completed the integration and everything is working fine. But I didn't find any option to dismiss/reject the call in RingCentral Web phone SDK.
This is the way I am initiating the call.
var session = webphone.userAgent.invite(toNumber, {
fromNumber : fromNumber
});
And one more doubt is I am not able to record the calls. Do we need a paid account to enable Call Recondings or can we test with the sandbox account?
The last doubt is Do we need the RingCentral paid plan to apply for production? When I am trying to apply for production its showing the messege as below.
https://i.snipboard.io/TO3pqe.jpg
Please help me to solve these confusions.
Thanks,
Mike
This is the modified version of the example code on Github:
var appKey = '...'; var appSecret = '...'; var appName = '...'; var appVersion = '...'; var sdk = new RingCentral.SDK({ appKey: appKey, appSecret: appSecret, appName: appName, appVersion: appVersion, server: RingCentral.SDK.server.production // or .sandbox }); var remoteVideoElement = document.getElementById('remoteVideo'); var localVideoElement = document.getElementById('localVideo'); var platform = sdk.platform(); platform.auth().setData(tokens) if (platform.loggedIn()){ platform.post('/client-info/sip-provision', { sipInfo: [{transport: 'WSS'}] }) .then(function(res) { // Doing nested then because we need loginResponse in a simple way return new RingCentral.WebPhone(res.json(), { // optional appKey: appKey, appName: appName, appVersion: appVersion, uuid: loginResponse.json().endpoint_id, logLevel: 1, // error 0, warn 1, log: 2, debug: 3 audioHelper: { enabled: true, // enables audio feedback when web phone is ringing or making a call incoming: 'path-to-audio/incoming.ogg', // path to audio file for incoming call outgoing: 'path-to-audio/outgoing.ogg' // path to aduotfile for outgoing call }, media:{ remote: remoteVideoElement, local: localVideoElement }, //to enable QoS Analytics Feature enableQos:true }); }) .then(function(webPhone){ // YOUR CODE HERE }) }
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder