question

zareef-hussain7433 avatar image
zareef-hussain7433 asked igor-bebin answered

How to get call answered time?

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.

rest api
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.

igor-bebin avatar image
igor-bebin answered
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.

               
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.

zareef-hussain7433 avatar image
zareef-hussain7433 answered zareef-hussain7433 commented
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

4 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 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
0 Likes 0 ·
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?


0 Likes 0 ·
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".
0 Likes 0 ·
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.



0 Likes 0 ·
igor-bebin avatar image
igor-bebin answered
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.
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