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
Call events are not getting received
Tags: getting started
Nov 15, 2019 at 10:25am   •   2 replies  •  0 likes
Muhammad Shoaib

I've followed this ringcentral tutorial to receive call events when a call is placed but it's not firing events at all when comes in

2 Answers
answered on Nov 15, 2019 at 12:18pm  

I think it must be some thing was wrong in your environment. Can you test this simple code on your sandbox environment. You can try with and without the param "?detailedTelephonyState=true".

var SDK = require('ringcentral')

RINGCENTRAL_CLIENTID = ''
RINGCENTRAL_CLIENTSECRET = ''
RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com'

RINGCENTRAL_USERNAME = ''
RINGCENTRAL_PASSWORD = ''
RINGCENTRAL_EXTENSION = ''

var rcsdk = new SDK({
      server: RINGCENTRAL_SERVER,
      appKey: RINGCENTRAL_CLIENTID,
      appSecret: RINGCENTRAL_CLIENTSECRET
  });
var platform = rcsdk.platform();
var subscription = rcsdk.createSubscription();

platform.login({
      username: RINGCENTRAL_USERNAME,
      password: RINGCENTRAL_PASSWORD,
      extension: RINGCENTRAL_EXTENSION
      })
      .then(function(resp) {
          subscribe_for_presence_notification()
      });

function subscribe_for_presence_notification(){
    var eventFilters = [
      '/restapi/v1.0/account/~/presence?detailedTelephonyState=true'
    ]
    subscription.setEventFilters(eventFilters)
    .register()
    .then(function(subscriptionResponse) {
        console.log("Ready to receive all users' presence status via PubNub.")
    })
    .catch(function(e) {
        console.error(e);
        throw e;
    });
}

subscription.on(subscription.events.notification, function(msg) {
    console.log(msg.body);
});



 0
answered on Nov 18, 2019 at 4:37am  

@Phong Vu Thank you for the help, this piece of code wasn't working either, going through articles I suspected the permissions I had ("ReadCallLog" and "ReadAccounts" as mentioned in the tutorial) for the ringcentral app might be bit off and after I added the "Read Presence" permissions the code you sent started to work I also ran some tests to make sure this actually is the issue. If I may, I'd like to suggest updating the tutorials to dictate to also include adding the "Read Presence" permission to help first timers like myself.


 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