How to get call answered time?

  • 1
  • Question
  • Updated 7 months ago
I am trying to get call answered time in a live call but can't seem to find API for it.

The scenario is when a user calls I want to get the time the user called until the call is picked up. I am able to get the time the call was made through Call Log API's "Get User Active Calls" method but unable to get the time the call was answered. Is there a way to achieve this?

Any help would be appreciated.
Photo of Zareef Hussain

Zareef Hussain

  • 100 Points 100 badge 2x thumb

Posted 7 months ago

  • 1
Photo of Igor Bebin

Igor Bebin, Official Rep

  • 540 Points 500 badge 2x thumb
Hi Zareef,
You can try to use Presence API, see https://developers.ringcentral.com/api-docs/latest/index.html#!#RefUserPresence.html
Once call is picked up "telephonyStatus" is changed to "CallConnected". 

The same data is available via Push Notifications, see https://developers.ringcentral.com/api-docs/latest/index.html#!#RefGetExtensionPresenceEvent 
All you need is to subscribe on "Extension Presence Event" and monitor for events with "telephonyStatus" : "CallConnected".
Please advise if it works for you, otherwise we could try to find another way to resolve your problem.
(Edited)
Photo of Zareef Hussain

Zareef Hussain

  • 100 Points 100 badge 2x thumb
Hi Igor,

Thank you for the answer. The solution works perfect, however, there is an issue. Is there a way to monitor the event in real time? i-e; to get the response as soon as telephony status is changed. Or if a webhook URL is sent once the telephony status is changed?

Your answer is appreciated.

Thanks,
Zareef
Photo of Igor Bebin

Igor Bebin, Official Rep

  • 520 Points 500 badge 2x thumb
Hi Zareef, 

To get real time changes you shoud subscribe on Extension Presence events via any of supported transport, e.g. WebHook, PubNub, etc. 

An example of subscription request/response can be found here Create Subscription

Thanks,
Igor
Photo of Zareef Hussain

Zareef Hussain

  • 100 Points 100 badge 2x thumb
Hi Igor,

Thanks for your reply. I am trying the Create Subscription method on API Explorer with the following details;

Event Filter;
/restapi/v1.0/account/~/extension/~/presence"
/restapi/v1.0/account/~/extension/~/message-store

Delivery Mode;

Transport Type : WebHook
Address; https://mywebsite.com/webhook.php

I am getting the following error;

errorCode: CMN-101
message: Parameter [deliveryMode.registrationId] value is invalid

Any reason why am I getting this error?
Photo of Igor Bebin

Igor Bebin, Official Rep

  • 520 Points 500 badge 2x thumb
Could you please provide the exact subscription request? It appears that such error is returned for Mobile tranports such as "PubNub/APNS" or "PubNub/GCM".
Photo of Zareef Hussain

Zareef Hussain

  • 100 Points 100 badge 2x thumb
Here is the permissions I have for my sandbox application;



Using The API Explorer, I have authorized the above application to make API calls, and I am using Create Subscription method under Push Notification sections;



For event filters, I am using example 4 from the above link you provided me for creating WebHook subscriptions. The address URL I am using is on a live server. Once I try out the Post Method, I get the following response;



I hope this information is enough to help me solve the issue.
Photo of Igor Bebin

Igor Bebin, Official Rep

  • 540 Points 500 badge 2x thumb
The problem is in API Explorer, unfortunately it doesn't work for Subscription API case. We've included the fix in the next release. Thank you for pointing this out.

Meanwhile is it possible for you to use our API directly? All you need is authorize and create subscription.