Skip to main content
The First Step
Nov 16, 2021 11:05 PM UTC
Question

PubNub Subscription Event not detecting call notification

Running in node.js .

Not picking up on any call action after successful subscription.

My Code:


  1. function setSubscription() {
  2. const platform = rcsdk.platform()
  3. platform.login({
  4. username: '+14706150273',
  5. extension: '101',
  6. password: '********'
  7. }).then(response => {
  8. const subscription = rcsdk.createSubscription().setEventFilters(['/account/~/telephony/sessions']);
  9. subscription.on(subscription.events.notification, function (msg) {
  10. console.log(msg);
  11. });
  12. subscription.register().then(function (response) {
  13. console.log(response.json());
  14. console.log('Success: Subscription is listening');
  15. }).catch(function (e) {
  16. console.log('Subscription Error: ' + e.message);
  17. });
  18. }).catch(e => {
  19. console.error(e)
  20. })
  21. }


Console output after run showing successfully subscribed (but nothing after) - Calls are showing in the sandbox call log:

  1. [nodemon] starting `node index.js`
  2. Server is running on port: 5000
  3. {
  4. uri: 'https://platform.devtest.ringcentral.com/restapi/v1.0/subscription/edde4bf6-1563-4263-94c7-247954e3ac68',
  5. id: 'edde4bf6-1563-4263-94c7-247954e3ac68',
  6. creationTime: '2021-11-16T22:52:03.946Z',
  7. status: 'Active',
  8. eventFilters: [ '/restapi/v1.0/account/307128004/telephony/sessions' ],
  9. expirationTime: '2021-11-16T23:07:03.946Z',
  10. expiresIn: 899,
  11. deliveryMode: {
  12. transportType: 'PubNub',
  13. encryption: false,
  14. address: '4174641560134678_4a93035d',
  15. subscriberKey: 'sub-c-b8b9cd8c-e906-11e2-b383-02ee2ddab7fe'
  16. }
  17. }
  18. Success: Subscription is listening

13 replies

PhongVu
Community Manager
Community Manager
Nov 23, 2021 4:01 PM UTC

The issue is fixed and PubNub notifications should work normal now. Please try again and report if you still face the problem.

The First Step
Nov 23, 2021 4:11 PM UTC

Verified - works.

Much appreciated your time and effort.

New Participant
Nov 23, 2021 4:41 PM UTC

fantastic thanks Phong Vu!