Skip to content

Instantly share code, notes, and snippets.

@shalzz
Last active Jun 4, 2022
Embed
What would you like to do?
exports.handler = function(context, event, callback) {
const twiml = new Twilio.twiml.VoiceResponse();
if (event.DialCallStatus === 'completed' || event.DialCallStatus === 'answered') {
twiml.hangup();
} else {
twiml.redirect({
method: 'POST'
}, "https://twimlets.com/voicemail?Email=user%40example.com&Message=Please%20leave%20a%20message%20at%20the%20beep&Transcribe=false");
}
callback(null, twiml);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment