How to deliver a voice mail to a users voice mail box using Twilio?

258 views Asked by At

We are able to record voice mail with Twilio Voice and Node.js and we have the recording URL. We need this recording to be delivered to the user's voice mail inbox (carrier side).

This is what we've got so far.

Endpoint for recording:

twiml.say('Please leave a message on the call.\nPress the star key when finished.');
  twiml.record({
    action: `${serverURL}/voiceHangup`,
    method: 'POST',
    timeout: '180',
    maxLength: '20',
    finishOnKey: '*',
    recordingStatusCallback: `${serverURL}/voiceMailResponse`,
  });

endpoint for /voiceMailResponse

voiceMailURL = res.RecordingUrl;

The voiceMailURL is the URL with the recording that needs to be delivered to user voice mail inbox at carrier side.

1

There are 1 answers

1
Swimburger On BEST ANSWER

Twilio does not provide a way to deliver voicemails straight to a voicemail inbox. However, this may also not be the best user experience, as the patient may actually want to pick up the call if they can.

Here are some alternative solutions that you could build:

  • Call the phone number and use Answering Machine Detection to detect a voicemail inbox. Based on whether it's a voicemail inbox, you can apply different logic.
  • Build your own voicemail inbox using node.js and Twilio that the patient can call and interact with. When a new voicemail message is added, you can call or text the patient.