question

Pramod Kangare avatar image
Pramod Kangare asked Manager Desk answered

Why is the Webhook Subscription Event not detecting any call notification?

We are able to detect call event notifications using Subscription when we place calls using RingOut API.

Code that we used: https://github.com/ringcentral/ringcentral-csharp/tree/master/RingCentral/Subscription


But Subscription is not detecting call event notifications when the caller is calling from his Phone Device.

So we are trying with webhook subscription as per discussion with RingCentral development team member.

We have implemented webhook subscription with event filter "/restapi/v1.0/account/{accountId}/telephony/sessions".

Below is Url from where we used code example:

https://developers.ringcentral.com/guide/notifications/quick-start/webhook/c-sharp

This code is not detecting any notification after placing a call using RingOut or Phone Device. What will be the issue???

Currently, we are using a sandbox environment with the below permissions:

- Read Contacts

- Read Messages

- Read Presence

- Call Control

- Read Accounts

- Ring Out

- Read Call Log

- Webhook Subscriptions

- Edit Presence


developer sandbox
1 comment
1 |1500 characters needed characters left characters exceeded

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

Hello @Phong Vu and @Anirban Sen Chowdhary, I noticed you had responded to Pramod's other question. Do you have any insight on this?

Thank you,

Mindy

0 Likes 0 ·
Phong Vu avatar image
Phong Vu answered Pramod Kangare commented

Hi,

1. You are using the old C-sharp SDK (deprecated). It still should work correctly but I recommend you to use the latest one.

2. Watching the video I could see that you tested correctly for sandbox and production environments. However, I could not see the notification filter you specified in your code so I don't know if it is a notification at the extension level or at the company level.

  • Account level: /account/{accountId}/telephony/sessions
  • Extension level: /account/{accountId}/extension/~/telephony/sessions

A. If the filter was set at the extension level, then the problem is that you login the app with the main company number with the extension 101, but in your test, you make a call from your own extension (605 3706083) => no notification for your extension

B. If the filter was set at the account level, then the problem is still unknown to me => Either open a support ticket with our developer support team or send me an invite for a meeting at phong.vu@ringcentral.com

1 comment
1 |1500 characters needed characters left characters exceeded

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

Using Account Level , now able to detect PubNub notification when caller calling from his phone device (Desktop RC Phone or Android RC Phone).


Thank You Phong for your guidance.

0 Likes 0 ·
Phong Vu avatar image
Phong Vu answered Phong Vu edited

Hi Mindy,

Sorry for the delayed response.

The question is a little bit confusing so I will have to ask you to try to test again as follows:

1. Keep testing with PubNub notification which worked for you when you placed a RingOut call. But with a direct call. If your PubNub app works with both type of calls, then your application permissions and testing account are correct.

2. Test your Webhooks application with the same app's and user's credentials (as you tested on your PubNub app). If this does not work, then the problem is with the Webhooks implementation, NOT the server notification. In this case, make sure your Webhooks implementation is correct by checking if it is set up correctly.


Let me know

2 comments
1 |1500 characters needed characters left characters exceeded

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

Hi Phong,

Thank you for the information. I'll talk to my colleague, Pramod.

Thank you!

Mindy

0 Likes 0 ·

Hi Phong ,


Point 1 : Subscription PubNub notification

PubNub notification works for both sandbox and production only when we place call using Ringout API, but not getting PubNub notification when caller calling from his phone device(Android RC Phone , RC Desktop Phone, etc) in Production Environment.

Please see below video :

Removed link due to security risk!

If we get PubNub notification in Production Environment when caller calling from his device, then we don't need to implement webhook notification (Point 2).


App Permissions:

- Read Contacts

- Read Messages

- Read Presence

- Call Control

- Read Accounts

- Ring Out

- Read Call Log

- Webhook Subscriptions

- Edit Presence


Is any app permission missing??


Please guide us.


Thanks and Regards,

Pramod Kangare

0 Likes 0 ·
Manager Desk avatar image
Manager Desk answered

I'm hitting a similar issue. Node.js env.

Not picking up on any call action after successful subscription.

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
1 |1500 characters needed characters left characters exceeded

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