Turn on more accessible mode
Skip Ribbon Commands
Skip to main content
Retrieving Recorder Recordings via IceLib
The IceLib API provides the ability to download recordings (call, chat, email, and screen recordings). This functionality is exposed via classes in the ININ.IceLib.QualityManagement namespace. Recordings are retrieved based on a given Recording ID using the GetExportUri method found on RecordingsManager. This method returns a URI that can be used to download the file.

Note: This article assumes the reader has a basic understanding of fundamental concepts such as Session management, database access. 

​Retrieving a Recording ID

To find recording IDs to feed into GetExportUri, one must first query the CIC database to find the recording IDs. This can be done using IceLib's stored procedure execution classes (found in the ININ.IceLib.Data.TransactionBuilder namespace) or by querying the database using 3rd party tools and libraries. The simplest way to get a recording ID from the database is to query the IR_RecordingMedia table. However, this table only provides minimal information about the recording. To gain access to additional metadata about the recording or the interaction that was recorded, additional tables in the CIC database must be added to the query using the IR_RecordingMedia.InteractionIDKey column as the key to join tables.

Fetching the Export URI

Once a recording ID has been found, RecordingsManager.GetExportURI(...) will be used to retrieve the file's URI. The file can be downloaded using the C# WebClient class (or any desired method of downloading files, including opening the URI in a web browser). The filename can be determined by inspecting the content-disposition​ response header after the web request to the URI has been made. 

Example of fetching a URI from a recording ID

1
2
3
var recordingsManager = QualityManagementManager.GetInstance(_session).RecordingsManager;
var recordingUri = recordingsManager.GetExportUri("1BD36913-DBC4-D00A-82D1-49FB23500001", RecordingMediaType.PrimaryMedia, "", 0);
DownloadFile(recordingUri, @"c:\recordings\mywav.wav");

Example of downloading from a URI:

1
2
3
4
5
6
7
private void DownloadFile(Uri uri, string filename)
{
    using (var client = new WebClient())
    {
        client.DownloadFile(uri, filename);
    }
}

Recording Media Types

​When considering media types other than voice calls, this functionality can be used in a slightly different manner. Primary media (the actual interaction recording) is always retrieved in the same manner, but functionality exists to retrieve Email Attachments and Screen Recordings. To do this, the RecordingMediaType should be set to EmailAttachment or ScreenRecording to retrieve those types. 

Email Recording Attachments

When downloading email attachments, the last parameter in GetExportUri, int attachmentId, should be the number in a sequence for the number of attachments, starting with 1. The number of attachments can be determined by querying the column IR_RecordingMedia.NumAttachments; this will be zero if no attachments exist and will be a number if there are attachments. To get export URIs for the attachments, simply call GetExportUri with the recording ID of the recording, the media type set to RecordingMediaType.EmailAttachment, and the number for the attachment you wish to retrieve. GetExportUri should be called for each number in the number of attachments to retrieve the URI for each (1, 2, 3, etc...).

Open Source Example Application

An example application illustrating these concepts has been posted to GitHub under the open source Mozilla Public License. The repository can be found at https://github.com/InteractiveIntelligence/RecordingExportExample
​​