News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
webPhone invitation session is terminated after Establishing state
Tags: ringout, sip
Mar 3, 2024 at 1:21am   •   1 replies  •  0 likes
Desh Weragoda

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.

1 Answer
answered on Mar 4, 2024 at 8:55am  

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.





 0



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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us