question

Diego Pastor avatar image
Diego Pastor asked Phong Vu commented

Is there an API to obtain call time and number of calls per user and queue?

Good day everyone, the project on which i'm working wants to create a simple metrics dashboard per user, the idea is to obtain the talk time coming from a specific queue per each user and also the talk time for all calls received by the same user.

I looked at the call logs endpoint and using the legs I can determine who was the user who answered the call from a queue. For the total talk time, i call the call logs but pointing to the user extension.

The thing is that the call logs endpoint has a small rate limit, and i wanted to know if there's a better approach to handle this requirement

call queuescall logs
1 |3000

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

1 Answer

Phong Vu avatar image
Phong Vu answered Phong Vu commented

Unfortunately, there is no API to obtain those call metrics. The Analytics API provides only aggregated data, and the Call Logs API is a call history which is not meant for detailed analytics.

If you are interested, you can implement your own app to calculate those metrics from real-time call data. Read this article to learn how to use the telephony session event notification to generate own call data.

2 comments
1 |3000

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

Diego Pastor avatar image Diego Pastor commented ·

Hi Phong, thanks for your answer. I did try to use the Analytics API but it's a bit unstable on the sandbox and it wasn't returning the data.

With regards to the call logs endpoint, is there a way to know if the call originated from a queue? for example on the telephony events there's a queueCall field

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Diego Pastor commented ·

As far as I can tell, there is no flag in the call log indicating that the call is via a call queue. However, you can work around it a bit by checking the legs, and provided that you have a list of call queue extension ids or call queue direct numbers, you can detect if a call is via a call queue or not. You will see something like this. See the highlighted, ignore the from.name because it is messy :)

 {
        "startTime": "2022-08-25T02:15:20.751Z",
        "duration": 17,
        "type": "Voice",
        "internalType": "LocalNumber",
        "direction": "Inbound",
        "action": "Phone Call",
        "result": "Accepted",
        "to": {
                        "name": "Demo queue",
                        "phoneNumber": "+1209248xxxx",
                        "extensionId": "6249888xxxx"
                   },
        "from": {
          "name": "Demo queue - SAN MATEO    CA",
          "phoneNumber": "+1650513xxxx",
          "location": "San Mateo, CA"
        },
        "extension": {
          "uri": "https://platform.ringcentral.com/restapi/v1.0/account/80964xxxx/extension/6249888xxxx",
          "id": 6249888xxxx
        },
        "reason": "Accepted",
        "reasonDescription": "The call connected to and was accepted by this number.",
        "telephonySessionId": "s-a0e7b7a30429ez182d2c8557ez874e6a0000",
        "transport": "PSTN",
        "legType": "Accept"
      },
1 Like 1 ·

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