Skip to main content

I am working on angular project and want to intergrate Ringcentral.

I read this Readme file and implmented that.

Following is my code:

	var sdk = new RingCentral.SDK({
clientId: environment.rc_clientId,
clientSecret: environment.rc_clientSecret,
appName: environment.rc_appName,
// appVersion: appVersion,
server: RingCentral.SDK.server.sandbox, // or .production
});

var remoteVideoElement = document.getElementById('remoteVideo');
var localVideoElement = document.getElementById('localVideo');

console.log('media elements', remoteVideoElement, localVideoElement)

const platform = sdk.platform()
console.log("platform", platform)
platform.login({
jwt: environment.rc_jwt
}).then((rep) => rep.json()).then(loginResponse => {

return platform
.post('/restapi/v1.0/client-info/sip-provision', {
sipInfo: [{ transport: 'WSS' }],
}).then(resp => resp.json()).then(sipProvision => {
console.log(loginResponse, sipProvision)
return new RingCentral.WebPhone(sipProvision, {
// optional
clientId: environment.rc_clientId,
appName: environment.rc_appName,
uuid: loginResponse.endpoint_id,
logLevel: 1, // error 0, warn 1, log: 2, debug: 3
audioHelper: {
              enabled: true,
              incoming: 'path-to-audio/incoming.ogg', 
              outgoing: 'path-to-audio/outgoing.ogg',
},
media: {
remote: remoteVideoElement,
local: localVideoElement,
},
//to enable QoS Analytics Feature
enableQos: true,
});
}).then((webPhone) => {
console.log(webPhone);
this.session = webPhone.userAgent.invite('+19703725396');
console.log(this.session)
this.session.stateChange.addListener(state => {
console.log("session state", state)
})
webPhone.userAgent.on('invite', (session) => {
session.accept().then(result=>{
console.log('userAgent invitation accepted.', result)
})
})
}).catch((webPhoneError: any) => {
console.log(webPhoneError)
})
}).catch((errors: any) => {
console.error(errors)
})

This code didnt make call and the session of inviation of webPhone is terminated after Establising state.

What is this reason and how to fix. Please give me any tips.

Thank you.

Could you please reproduce the issue here https://ringcentral.github.io/ringcentral-web-phone/?

If yes, please kindly generate an HAR file. https://support.zendesk.com/hc/en-us/articles/4408828867098-Generating-a-HAR-file-for-troubleshooting

Once you've done, that, please create a ticket here and provide us with the HAR file.

https://developers.ringcentral.com/support/create-case

Our support team will get back to you as soon as possible.

In the mean time, you may also try to use app.ringcentral.com to make the same call. If you cannot, then it is probably because your account cannot make calls or the call is an international one.





Reply