Record an existing voicemail message with Python & Twilio

Last week, my father asked me if I could make a backup of an old lovely voicemail message he had, recorded by my sister when she was a kid.

I wrote a short Python script to accomplish this using Twilio:

twiml_url = ''
client = Client(os.environ['TWILIO_ACCOUNT_SID'], os.environ['TWILIO_AUTH_TOKEN'])
                    record=True, url=twiml_url)

The twiml URL refers to a short XML file I created online on Twilio web console at

<?xml version="1.0" encoding="UTF-8"?>
    <Pause length="30"/>

After executing the script, I found the recorded audio message at, where I was able to download it as MP3 or WAV:

Screenshot of Twilio web console