question

Nigel McLaughlin avatar image
Nigel McLaughlin asked Nigel McLaughlin commented

Inbound Webhook not firing

I'm subscribed to /restapi/v1.0/account/~/telephony/sessions and although it sends me outbound notifications it never fires on Inbound ones -> I have verified this by logging calls to the webhook page.

It successfully rings the App so the extension I'm calling is definitely online, but the even is never delivered.

webhooks
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered Nigel McLaughlin commented

I am not aware of such a problem and all my tests work well on both sandbox and production environment.

Can you simply copy/paste and run this Node JS code using PubNub notification to see if it works or not. If this code does not work, then it is in your account setup and we will have a look at that later. But if this works, then something is wrong with your Webhooks code, parhaps.

Change the server domain accordingly if you run on production!

const RingCentral = require('@ringcentral/sdk').SDK
const Subscriptions = require('@ringcentral/subscriptions').Subscriptions;

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

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

const rcsdk = new RingCentral({
  server: RINGCENTRAL_SERVER,
  clientId: RINGCENTRAL_CLIENTID,
  clientSecret: RINGCENTRAL_CLIENTSECRET
})

const subscriptions = new Subscriptions({
   sdk: rcsdk
});
var subscription = subscriptions.createSubscription();

var platform = rcsdk.platform();

platform.login({
        username: RINGCENTRAL_USERNAME,
        extension: RINGCENTRAL_EXTENSION,
        password: RINGCENTRAL_PASSWORD
      })

platform.on(platform.events.loginSuccess, function(e){
    console.log("Login success")
    subscribe_for_csn_notification()
});

function subscribe_for_csn_notification(){
    var eventFilters = [
      '/restapi/v1.0/account/~/telephony/sessions'
    ]
    subscription.setEventFilters(eventFilters)
    .register()
    .then(function(subscriptionResponse) {
        console.log("Ready to receive company tel session events via PubNub.")
    })
    .catch(function(e) {
        console.error(e);
        throw e;
    });
}

subscription.on(subscription.events.notification, function(msg) {
    console.log(JSON.stringify(msg.body));
    console.log("======");
});
1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

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:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys