Call Recordings

Call recordings are stored on the RingCentral servers and can be retrieved using the API for download and streaming playback.

Retrieving Call Log Records with Recordings

Calls with recordings can be identified using the Call Log API and locating records with the RecordingInfo object.

# Make API call (with Access Token added by SDK)
response = client.http.get do |req|
  req.url 'myRecordingUri'
# Save call recording to file'./myRecording.mp3', 'wb') { |fp| fp.write(response_file.body) }

Full Example

The below example uses a call log record filter to locate voice calls with call recordings and then downloads the file for each recording.

require 'json'
require 'ringcentral_sdk'

client =
  'myAppKey', 'myAppSecret', RingCentralSdk::RC_SERVER_SANDBOX
client.authorize('myUsername', 'myExtension', 'myPassword')

# Retrieve voice call log records with recordings
response = client.http.get do |req|
  params = {:type => 'Voice', :withRecording => 'True'}
  req.url 'account/~/extension/~/call-log', params

# Save recording and metadata for each call log record
response.body['records'].each do |record|
  # Retrieve call recording
  response_file = client.http.get do |req|
    req.url record['recording']['contentUri']
  # Save call recording
  file_mp3 = 'recording_' + record['id'] + '.mp3', 'wb') { |fp| fp.write(response_file.body) }
  # Save call log record (call recording metadata) using 'json'
  file_meta = 'recording_' + record['id'] + '.json', 'wb') { |fp| fp.write(record.to_json) }