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
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
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); });
Accepted the answer since it was helpful narrowing down the issue and to close out the ticket. But I'd strongly recommend updating the tutorial as its missing a key point.
@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.
Thanks for pointing out the mistake. The permissions that tutorial app needs are just the "ReadCallLog" and the "ReadPresence". I will fix the mistake in the tutorial soon.
Thanks
Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.
Download RingCentral Phone for Desktop:
Tip: switch to the "sandbox mode" before logging in the app:
3 People are following this question.