Recordings

Recordings are generated when you use the <Record> verb. Those recordings are hosted with RestComm for you to retrieve. The Recordings list resource represents the set of an account’s recordings.

Recording Resource URI

/2012-04-24/Accounts/{AccountSid}/Recordings/{RecordingSid}

To download the audio file just append .wav after the RecordingSid.

Resource Properties

Property Description

Sid

A string that uniquely identifies this recording.

DateCreated

The date that this recording was created.

DateUpdated

The date that this recording was last updated.

AccountSid

The unique id of the Account that created this recording.

CallSid

The unique id of the call during which the recording was made.

Duration

The length of the recording, in seconds.

ApiVersion

The API version in use during the recording.

Uri

The URI for this account, relative to https://localhost:restcomm.

FileUri

The File URI for this recording, relative to https://localhost:restcomm. It can be used to access the WAV file

S3Uri

The S3 URI for this recording - Exists ONLY IF Amazon S3 integration is enabled and security level is NONE-

Supported Operations

HTTP GET. Returns the representation of a Recording resource, including the properties above. HTTP DELETE. Removes the recording from the account.

Recording List Resource

Recording List Resource URI

  • /2012-04-24/Accounts/{AccountSid}/Recordings

  • /2012-04-24/Accounts/{AccountSid}/Calls/{CallSid}/Recordings

Unlike the Recording instance resource described above, the list of recordings IS protected by your account credentials like most parts of this API. You must use HTTP basic auth to access the Recordings list resource.*

Supported Operations

HTTP GET

Returns the list representation of all the Recording resources for this Account, including the properties above.

How to Record a Message

Go to the RCML section to learn how to record a message.

Get List of Recordings

The list of recorded wav files can be found in the directory $RESTCOMM_HOME/standalone/deployments/restcomm.war/recordings/

From the bash terminal, you can run the command below:

curl -X GET  https://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json

The response will be similar to the one below.

{"page":0,"num_pages":0,"page_size":50,"total":34,"start":"0","end":"34","uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json","first_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","previous_page_uri":"null","next_page_uri":"null","last_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","recordings":
    [
        {
            "sid":"RF50675909d9c94acda36f0e119b6cb431",
            "date_created":"Mon, 6 Jan 2014 08:51:07 +0900",
            "date_updated":"Mon, 6 Jan 2014 08:51:07 +0900",
            "account_sid":"ACae6e420f425248d6a26948c17a9e2acf",
            "call_sid":"CAfe9ce46f104f4beeb10c83a5ddd2be66",
            "duration":"14.70275",
            "api_version":"2012-04-24",
            "uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
            "file_uri":"http://instance1.restcomm.com:8080/restcomm/recordings/RE50675909d9c94acda36f0e119b6cb431.wav"
        },
        ...
    ]
}
<Sid> holds the file name of the recorded message. The recording Sid.wav is available in the file system only.

If you want to return the recording url you will need to parse the <Uri>/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/REb4c03af76cdc4a27aad0d9d759e119bc</Uri> response from Restcomm and add the extension .wav

The <Uri> holds the http URI that can be used for playback or to download the recorded message. Here is how to access the file using http https://IP_ADDRESS/restcomm/recordings/REb4c03af76cdc4a27aad0d9d759e119bc.wav  

List Filter

HTTP GET. The following GET query string parameters allow you to limit the list returned. Note, parameters are case-sensitive:

Request Parameters

Parameter Description

StartTime

Only show recordings that started on this date, given as YYYY-MM-DD. Also supports inequalities, such as StartTime=YYYY-MM-DD for recordings that started at or before midnight on a date, and StartTime=YYYY-MM-DD for recordings that started at or after midnight on a date.

EndTime

Only show recordings that ended on this date, given as YYYY-MM-DD. Also supports inequalities, such as StartTime=YYYY-MM-DD for recordings that started at or before midnight on a date, and StartTime=YYYY-MM-DD for recordings that started at or after midnight on a date.

CallSid

Only show recordings that have been started from this CallSid

 

Filter using the CallSid parameter.

The example below will only return Recordings that has been started from this CallSid

 curl -X GET  https://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?CallSid=CAfe9ce46f104f5beeb10c83a5dad2be66

The result will be similar to the one below

{"page":0,"num_pages":0,"page_size":50,"total":17,"start":"0","end":"17","uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json","first_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","previous_page_uri":"null","next_page_uri":"null","last_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","recordings":
    [
        {
            "sid":"RF50675909d9c94acda36f0e119b6cb431",
            "date_created":"Mon, 6 Jan 2014 08:51:07 +0900",
            "date_updated":"Mon, 6 Jan 2014 08:51:07 +0900",
            "account_sid":"ACae6e420f425248d6a26948c17a9e2acf",
            "call_sid":"CAfe9ce46f104f5beeb10c83a5dad2be66",
            "duration":"14.70275",
            "api_version":"2012-04-24",
            "uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
            "file_uri":"http://instance1.restcomm.com:8080/restcomm/recordings/RE50675909d9c94acda36f0e119b6cb431.wav"
        },
        ...
    ]
}

Paging Information

HTTP GET. The following GET query string parameters allow you to limit the list returned. Note, parameters are case-sensitive:

Request Parameters

PParameter Description

Page

The current page number. Zero-indexed, so the first page is 0.

NumPages

The total number of pages.

PageSize

How many items are in each page

Total

The total number of items in the list.

Start

The position in the overall list of the first item in this page.

End

The position in the overall list of the last item in this page.

 

Example.

The command below will return a single item from the list of recordings using the PageSize parameter

curl -X GET  https://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?PageSize=1

The result of the PageSize parameter

{"page":0,"num_pages":34,"page_size":1,"total":34,"start":"0","end":"0","uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json","first_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=1","previous_page_uri":"null","next_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=1&PageSize=1&AfterSid=RF50675909d9c94acda36f0e119b6cb431","last_page_uri":"/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=34&PageSize=1","recordings":
    [
        {
            "sid":"RF50675909d9c94acda36f0e119b6cb431",
            "date_created":"Mon, 6 Jan 2014 08:51:07 +0900",
            "date_updated":"Mon, 6 Jan 2014 08:51:07 +0900",
            "account_sid":"ACae6e420f425248d6a26948c17a9e2acf",
            "call_sid":"CAfe9ce46f104f5beeb10c83a5dad2be66",
            "duration":"14.70275",
            "api_version":"2012-04-24",
            "uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
            "file_uri":"http://instance1.restcomm.com:8080/restcomm/recordings/RE50675909d9c94acda36f0e119b6cb431.wav"
        }
    ]
}
 

Additional Paging Information.

The API returns URIs to the next, previous, first and last pages of the returned list as shown in the table below:

Request Parameters

Parameter Description

Uri

The URI of the current page.

Firstpageuri

The URI for the first page of this list.

Nextpageuri

The URI for the next page of this list.

Previouspageuri

The URI for the previous page of this list.

Lastpageuri

The URI for the last page of this list.