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