Not Getting Call Status after Sucessful subscribition

  • 1
  • Problem
  • Updated 2 years ago
  • In Progress
var subscription = rcsdk.getSubscription();
subscription.on(subscription.events.notification, function(msg) {
       console.log(msg.body.activeCalls[n].from);

// activeCalls is array
       console.log(msg.body.activeCalls[n].to);
   })
   .register({
       events: ['/account/~/extension/~/presence?detailedTelephonyState=true'],
   })
   .then(function(response) {
        console.log('Success: Subscription is listening');
    }).catch(function(e) {
        alert('Subscription Error: ' + e.message);
    });


Using This code for that
Photo of Zeeshan Yousaf

Zeeshan Yousaf

  • 220 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,642 Points 5k badge 2x thumb
Without seeing the complete code for this and how you've configured your Sandbox account I am unable to help isolate this problem any further on your specific issues.

So I created this sample application in Node.js which shows how to use the basics of the RingCentral Push Notifications.

https://github.com/bdeanindy/ringcentral-subscription-basics

Let me know if this helps (if you encounter issues with this code, please add issues in the Github issue tracker for this repository).
Photo of Zeeshan Yousaf

Zeeshan Yousaf

  • 220 Points 100 badge 2x thumb
how i do this in javascript.
Photo of Benjamin Dean

Benjamin Dean

  • 8,582 Points 5k badge 2x thumb
The above example code shows how to subscribe to Presence events in JavaScript.
Photo of Zeeshan Yousaf

Zeeshan Yousaf

  • 220 Points 100 badge 2x thumb
on loading page this exception occurs
Network Error when attempting to fetch resource.Server cannot authorize user
Photo of Benjamin Dean

Benjamin Dean

  • 8,602 Points 5k badge 2x thumb
If you are using the above example application code, and receiving this error, could you please submit an issue in the Github Issue Tracker for that repository? https://github.com/bdeanindy/ringcentral-subscription-basics/issues

If you are not using the above example application, could you please provide the code you've used to implement here along with the exact error response headers and body please?