Skip to main content
Question

Inbound Webhook not firing

  • October 14, 2021
  • 2 replies
  • 293 views

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.

2 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • October 14, 2021

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("======");
});

  • Author
  • New Participant
  • October 14, 2021

Here are the details of my subscription (with some details changed for privacy) - again, Outbound notifications arrive, Inbound ones don't:

{"uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/subscription","records":[{"uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/subscription/cfd35abd-f3fc-47b8-97ef-49e2bfdxxxxx","id":"cfd35abd-f3fc-47b8-97ef-49e2bfxxxxx","creationTime":"2021-10-14T02:31:44.851Z","status":"Active","eventFilters":["/restapi/v1.0/account/xxxxxxx/telephony/sessions"],"expirationTime":"2037-08-18T03:25:04.851Z","expiresIn":499932246,"deliveryMode":{"transportType":"WebHook","encryption":false,"address":"https://xxxxxx.au.ngrok.io/webhooks/telephony/ring-central.php"}}]