Recent Call Log Activity

TypePhone NumberNameDate / TimeActionResultLengthRecording

Demo Instructions

  1. Ensure that you have Configured this demo app and authorized it to access your RingCentral account.
  2. Note that the icons in the left most column indicate inbound or outbound call.
  3. Optionally play and/or download a HTML5 recording if present. If no recordings are available, you can make one by placing a call via the RingCentral for Desktop softphone under the Contacts page and then clicking the record button.

Developer Instructions

Overview

There are several major use cases for accessing call logs and call recordings including the following:

  1. Call Log Retrieval: applications can retrieve Call Log Records for multple purposes:
    1. reports and dashboards
    2. call log sync with other applications, e.g. CRM
  2. Call Recording Retrieval: Batch download of call recordings
  3. Call Recording Streaming Playback: Stream call recordings from browser applications

Call Log Retrieval

Call Log retrieval is done using the call log API end point. This can be done for all extensions if the authorizing user is the admin user or on a per extension level for extension-based authorization.

        var Call = helpers.call();
    // This call may be repeated when needed, for example as a response to incoming Subscription
    platform.send(Call.loadRequest(null, {
    query: { // this can be omitted
    page: 1,
    perPage: 10
    }
    })).then(function(response) {
    console.log("RESPONSE_CALLS: " + response.text());
    calls = Call.merge(calls, response.json().records); // safely merge existing active calls with new ones
    t.populateCalls(calls);
    }).catch(function(e) {
    console.log("E_RESPONSE_CALL_LOG: " + e);
    alert('Recent Calls Error: ' + e.message);
    });

The following is an example report with an optional Call Recording object:

{
   "uri": "https.../restapi/v1.0/account/401190149008/extension/401190149008/call-log/IXPCm_tIkCduk4I?view=Simple",
   "id": "IXPCm_tIkCduk4I",
   "sessionId": "404412141008",
   "startTime": "2015-06-25T14:57:30.000Z",
   "duration": 60,
   "type": "Voice",
   "direction": "Inbound",
   "action": "Phone Call",
   "result": "Accepted",
   "to":    {
      "phoneNumber": "18772160007",
      "name": "Something New"
   },
   "from":    {
      "phoneNumber": "18882400004",
      "name": "Something New"
   },
   "recording":    {
      "uri": "https.../restapi/v1.0/account/401190149008/recording/401547458008",
      "id": "401547458008",
      "type": "OnDemand",
      "contentUri": "https.../restapi/v1.0/account/401190149008/recording/401547458008/content"
   }
}

Call Recording Retrieval

To retrieve call recordings you can simply add the access token to the uri provided or add the access token as a header. The URL method is shown below:

var recordingUrl = call['recording']['contentUri'];
    var recordingUrl = rcsdk.platform().createUrl(uri, {addToken: true});

This approach can be used to batch download or individual streaming playback.

Call Recording Streaming Playback

The easiest way to stream audio is directly from the RingCentral servers using HTML5. When you do this you can use the JavaScript SDK to automatically add an access token to the URI provided by the Call Recording API endpoint which you can use to create HTML5 audio as follows:

<audio controls="controls">
<source src="https://platform.ringcentral.com/...?access_token=myAccessToken" type="audio/mpeg" />
<em>HTML5 Audio is required for playback</em>
<audio>

This demo uses jQuery to create the HTML5 audio element as follows:

var recordingUrl = call['recording']['contentUri'];
recordingUrl = rcsdk.platform().createUrl(uri, {addToken: true});
var recordingEl = $('<audio>').attr('controls', 'controls').append(
    $('<source>').attr('src', recordingUrl).attr('type', 'audio/mpeg')
.append(
    $('<em>').append('HTML5 Audio is required for playback')
)