Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move or download the twilio recording to amazon s3

Tags:

twilio

How to download the recording file using twilio sdk or how to move the recording file directly from twilio to amazon s3 .

like image 449
user2074624 Avatar asked Aug 19 '14 08:08

user2074624


People also ask

Where are Twilio recordings stored?

By default, Recordings and Compositions are stored within the Twilio Cloud. With this new feature, developers can define their preferred AWS S3 bucket for their Video Recordings or Compositions files. Files are then automatically sent to the specified AWS S3 Storage.

How do I transfer files to AWS S3?

To upload folders and files to an S3 bucketSign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to upload your folders or files to. Choose Upload.

How do I access recorded calls in Twilio?

Listen to a Recording in ConsoleLogin to your account at www.twilio.com/console. From Calls logs: Click Calls, select the desired call, and then click the Recording SID. From Recordings logs: Click Recordings, and then click the desired recording.


1 Answers

Twilio evangelist here.

Recordings are exposed via a direct URL, so in order to download them you'll need to use a the HTTP Client in your programming language of choice to make a GET request to the recording URL and save the data that is returned.

There are two ways to find out the URL:

  1. If you specifya URL in the action parameter of the <Record> verb Twilio will make an HTTP request to that URL once the recording is complete and include as a parameter the URL that the recording has been stored at.

  2. Make a GET request to the recordings resource of the Twilio REST API. This will return to you a list of recording resources, each of which has a URI parameter included in it. Add .mp3 or .wav to that URI to get the URL needed to request the recorded audio.

Once you've downloaded the recording, you can use the REST API to have Twilio delete it from our servers. Just issue an HTTP DELETE request to the recordings uri.

Hope that helps.

like image 78
Devin Rader Avatar answered Sep 28 '22 04:09

Devin Rader