Reputation: 327
I want to respond to an inbound voice call with a prerecorded message. Can this be done without using the Twilio API - ie similar to https://www.twilio.com/code-exchange/basic-voice-auto-response but my recording rather than a "robot" voice?
Upvotes: 0
Views: 44
Reputation: 85
Here's the script to be placed in the "Functions and Assets" section of your console:
exports.handler = function (context, event, callback) {
const twiml = new Twilio.twiml.VoiceResponse();
twiml.play('https://filesamples.com/samples/audio/mp3/sample3.mp3');
callback(null, twiml);
};
Three options to host the file:
You could store the audio file on Twilio's servers.
Upvotes: 2