I am creating a project in Studio and also learning about applying custom TwiMl.
I am trying to use a custom TwilML like the following in my studio project :
<Response>
<Dial record="true" action="record_done">
<Conference waitUrl="">record</Conference>
</Dial>
</Response>
I believe there are two ways, one is creating a function and using the 'Run Function' widget and the other would be 'TwiML Redirect'. When I use this TwiML to create a TwiML Bin, it shows invalid syntax. I also don't know how I can apply this TwiML to create a function and how I can apply that function in my studio project.
Any help would be much appreciated.
Update:
I wrote this function:
exports.handler = function(context, event, callback) {
const VoiceResponse = require('twilio').twiml.VoiceResponse;
const response = new VoiceResponse();
const dial = response.dial({record: 'true', action: 'record_done'});
dial.conference({
waitUrl: ""
}, 'record');
console.log(response.toString());
callback(null, response);
};
for the attribute action: 'record_done', I received this error in Twilio debugger: HTTP retrieval failure.