Reputation: 101
I'm running in Node.js.
My app is not picking up on any call action after successful subscription to /account/~/telephony/sessions
My Code:
function setSubscription() {
const platform = rcsdk.platform()
platform.login({
username: '+14706150273',
extension: '101',
password: '********'
}).then(response => {
const subscription = rcsdk.createSubscription().setEventFilters(['/account/~/telephony/sessions']);
subscription.on(subscription.events.notification, function (msg) {
console.log(msg);
});
subscription.register().then(function (response) {
console.log(response.json());
console.log('Success: Subscription is listening');
}).catch(function (e) {
console.log('Subscription Error: ' + e.message);
});
}).catch(e => {
console.error(e)
})
}
Console output after run showing successfully subscribed (but nothing after) - Calls are showing in the sandbox call log:
[nodemon] starting `node index.js`
Server is running on port: 5000
{
uri: 'https://platform.devtest.ringcentral.com/restapi/v1.0/subscription/edde4bf6-1563-4263-94c7-247954e3ac68',
id: 'edde4bf6-1563-4263-94c7-247954e3ac68',
creationTime: '2021-11-16T22:52:03.946Z',
status: 'Active',
eventFilters: [ '/restapi/v1.0/account/307128004/telephony/sessions' ],
expirationTime: '2021-11-16T23:07:03.946Z',
expiresIn: 899,
deliveryMode: {
transportType: 'PubNub',
encryption: false,
address: '4174641560134678_4a93035d',
subscriberKey: 'sub-c-b8b9cd8c-e906-11e2-b383-02ee2ddab7fe'
}
}
Success: Subscription is listening
Upvotes: 1
Views: 107
Reputation: 101
For anyone that has this issue - make sure you have only 1 subscription of the same kind at a time. Multiple will create an issue.
Upvotes: 1