How do acquire the phone number of an incoming call?

  • 1
  • Question
  • Updated 9 months ago
What api do I use to get a notification of an incoming call on a particular extension with a Json response containing the phone number of the incoming call?
Photo of Kobie Williams

Kobie Williams

  • 200 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Benjamin Dean

Benjamin Dean

  • 8,602 Points 5k badge 2x thumb
This is largely going to depend upon "when" you need the data, but to broadly answer your question, you can use either the active-calls or presence for a particular extension.

If you need the data in near-real-time, I would recommend creating a Subscription (Push Notification) or Webhook (also Push Notification) for the Extension(s) you wish to receive this information. Here is a sample application showing how to use RingCentral Subscriptions. Here is a sample application showing how to use RingCentral Webhooks. Here is the documentation for Push Notifications.

If you need the incoming caller's phone number you can also use the active-calls or presence as I listed initially, but the rate limiting on these may restrict your usage of these resources which is why I suggested Subscriptions or Webhooks.

If you need this for analysis, I would recommend using Call-Log, and set the query parameter 'view=Detailed'.
Photo of Dev Juiced

Dev Juiced

  • 90 Points 75 badge 2x thumb
Is there a example to achieve this through asp.net
Photo of John Wang

John Wang, Official Rep

  • 4,798 Points 4k badge 2x thumb
There is a PubNub subscription example with the C# SDK.

Go to the Subscription section of the README.md here:

https://github.com/ringcentral/ringcentral-csharp-client#subscription

Both PubNub and webhooks are documented here:

https://developer.ringcentral.com/api-docs/latest/index.html#!#RefCreateSubscription