News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
How to Query for Ring Out Call Duration
Tags: sdk
May 22, 2019 at 5:28am   •   3 replies  •  0 likes
Super Admin

I have a requirement to record the details of calls initiated by Ring Out upon completion of the call. I'm successfully polling the Ring Out Status until the call is finished, but I can't find a way to then query for the User Call Record for the completed Ring Out. Is there a way to get the Session Id for a Ring Out call which can be used to retrieve the User Call Record and/or query for a User Call Record using a Ring Out Id? Better yet, can I create a subscription which will notify my service when a Ring Out call is completed?

3 Answers
answered on May 28, 2019 at 4:50pm  

I believe my subscription wasn't getting triggered because I hadn't given the app enough permissions. I'm successfully receiving notifications for phone calls, how can I receive a notification when a fax is successfully sent? I see fax records in the user's call log history but I'm not receiving a presence event when the fax is successfully transmitted.

answered on May 23, 2019 at 4:05am  
Thanks for the quick reply! I tried following your suggestion but the subscription callback is never firing. I'm implementing this in Java so the examples are limited. Is there anything obvious I'm doing wrong?
 private void subscribeToPhoneEvents(String extensionId) {     if(extensionSubscriptions.containsKey(extensionId)) {   return;  }  String[] eventFilters = new String[]  {   String.format("/restapi/v1.0/account/%s/extension/%s/presence?detailedTelephonyState=true", ringCentralAccount, extensionId)  };  Consumer<String> callback = payload -> {    DetailedPresenceNotification notification = JSON.parseObject( payload, DetailedPresenceNotification.class);   DetailedPresenceEvent event = notification.body;   if(event.telephonyStatus.equals("NoCall") && event.terminationType.equals("final")){    for(DetailedPresenceEvent_ActiveCallInfo callInfo: event.activeCalls) {     // Record Phone call details    }   }  };  RestClient restClient = new RestClient(ringCentralClientId, ringCentralClientSecret, ringCentralServer);  try {   restClient.authorize(ringCentralAccount, extensionId, ringCentralPassword);   Subscription subscription = restClient.subscription(eventFilters, callback);   subscription.subscribe();   extensionSubscriptions.put(extensionId, subscription);  } catch (IOException | RestException e) {   LOGGER.error(e.getMessage(),e);  } } 

answered on May 22, 2019 at 8:41am  
Hi Dan,

Don't poll! Use the push notifications to subscribe for the detailed extension presence event. Check the developer guide at the "Notifications and Events" section for example code in different languages. From the notification payload, you can detect when a call is ringing, connected and hangup etc. You can use the sessionId to read the record from the call log later to get more details of that call. Unfortunately, the notification payload does not contain the call type so if you are interested at only "RingOut" call, you will have to check it from the call log record.


A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

Developer Platform
Integrated Apps
App Gallery
Developer support
Games and rewards

Resource center
Product Releases
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us