Home > OS >  How to integrate Twilio's Voice API service with AWS S3 Storage?
How to integrate Twilio's Voice API service with AWS S3 Storage?

Time:11-26

I'm trying to create a short program that calls a user's number and records the conversation using Twilio and send the recording to an S3 bucket

Here's a link that does it to a dropbox instead of an S3: https://www.twilio.com/blog/recording-saving-outbound-voice-calls-python-twilio-dropbox

Here's the code I have so far that allows me to call and recorded conversations go to Twilio's online storage:

    call = client.calls.create(
                            record=True,
                            url='http://demo.twilio.com/docs/voice.xml',
                            to=' 15558889988',
                            from_=' 18889992222'
                        )

    print(call.sid)

CodePudding user response:

Twillio has inbuilt mechanism to do it, any specific use case you want to do it. https://www.twilio.com/blog/announcing-external-aws-s3-storage-support-for-voice-recordings

CodePudding user response:

When you create the call you can also create a webhook that tells you when the recording is ready. When you then receive the webhook you can get the file and send it to S3.

...
    record=True,
    recording_status_callback=callbackURL "/recordings",
    recording_status_callback_event=["completed"],
...
  • Related