SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

How to Create a Voicemail Solution with SMS Alerts in Studio Flow

Objective

This article explains how to build a custom voicemail solution that first attempts to reach a user via a SIP endpoint and then falls back to a recorded message. It addresses common issues where customers miss calls and need an automated SMS notification with a direct link to the voicemail recording. By following this guide, you will configure a Studio Flow, handle A2P 10DLC compliance, and adjust security settings to ensure seamless media playback.

 

Product

Programmable Voice

 

Environment

Twilio Console

 

User Account Permission/Role(s) Required 

Owner, Administrator

 

Procedure 

1. Pre-Configuration and Compliance

Before building the workflow, you must prepare your environment to ensure messages are delivered and recordings are accessible.

  • A2P 10DLC Registration: Ensure your Twilio Phone Number is associated with an approved A2P 10DLC Brand and Campaign. Without this, the SMS notification containing the voicemail link may be filtered by carriers.
  • Disable Media Authentication: To allow the SMS recipient to click and listen to the voicemail without logging into Twilio, navigate to Voice > Settings > General. Locate Enforce HTTP Auth on Media and set it to Disabled, then click Save.

2. Creating the Studio Flow

  1. Navigate to Studio > Flows and click Create new Flow.
  2. Name the flow (e.g., Voicemail_Logic) and select Start from scratch.
  3. Connect Caller Widget: Drag a Connect Call To widget onto the canvas and connect it to the Incoming Call trigger.
    • Noun: SIP
    • SIP Endpoint: Enter your URI (e.g., sip:yourname@yourdomain.sip.twilio.com).
    • Timeout: Set to 30 seconds (this determines how long the system rings before going to voicemail).
  4. Say/Play Widget: Drag a Say/Play widget and connect the Connected Call Ended transitions from the previous widget to it.
    • Text to Say: "Hi! We can't take your call right now. Please leave a message after the beep."
  5. Record Voicemail Widget: Drag a Record widget and connect it to the Audio Complete transition of the Say/Play widget.
    • Trim: Select Trim Silence.
    • Max Length: Set as desired (e.g., 300 seconds).
  6. Send Message Widget: Drag a Send Message widget and connect the Recording Complete transition from the Record widget to it.
    • In advance settings in the "To" field: Enter the mobile number that should receive the notification.
    • Message Body: Copy and paste the following code: New Voicemail from: {{trigger.call.From}}. Listen here: {{widgets.record_voicemail_1.RecordingUrl}}

 

3. Linking the Flow to a Phone Number

  1. Navigate to Phone Numbers > Active Numbers.
  2. Click on the number you wish to use.
  3. Under the Voice & Fax section, set Configure With to Studio Flow.
  4. Select your new flow from the dropdown and click Save.

4. Accessing Recordings without SMS

If you choose not to use the SMS notification, or need to review historical messages:

  1. Navigate to Monitor > Logs > Recordings.
  2. All captured voicemails will be listed here with the date, caller ID, and a play button for direct browser playback.

 

Additional Information 

  • Formatting: Ensure the "To" number in the Send Message widget uses E.164 format (e.g., +15551234567).
  • Troubleshooting: If the link in the SMS prompts for a login, double-check that Enforce HTTP Auth on Media is truly disabled in the Voice Settings.
  • Documentation: For more advanced configurations, refer to the Twilio Studio Widget Library.
Have more questions? Submit a request
Powered by Zendesk