0

I'm trying to record and download a phone conversation on twilio.

I've set it up with:

const voiceResponse = new twiml.VoiceResponse();
voiceResponse.dial({
      callerId: callerNumber,
      record: "record-from-answer",
      recordingStatusCallback: `https://${request.headers.host}/recording`,
      recordingStatusCallbackMethod: "POST",
      recordingTrack: "both",
      method: "POST",
      ringTone: "au",
});
dial.number(to);

However, the audio I get back from the callback appears to only contain one track / side of the conversation? I thought recordingTrack: "both" would mix both sides of the conversation into one audio file but that doesn't seem to be the case? Also note when I download the file from the callback url I append .mp3 to the URL to receive it in the format I need (I'm not sure if this makes a difference?).

I may have missed it in the twilio docs but how can I get a recording file with both legs of the conversation?

Any help is appreciated.

Thanks!

TomHill
  • 614
  • 1
  • 10
  • 26

1 Answers1

0

If you are specifying record-from-answer in your TwiML, Twilio will actually record both legs separately but downmix both channels to a single channel when downloading the file and not specifying the RequestChannels query parameter. If you have record-from-answer-dual in your TwiML, when downloading the file and not specifying the RequestChannels query parameter, your file will be dual channel.

Daniel O.
  • 583
  • 5
  • 15