For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
ReferenceGuides
ReferenceGuides
    • Quickstart
  • Basics
    • Control program flow
    • Deploy SWML from web servers
    • Handle incoming calls from code
    • Send simple HTTP requests
  • Recipes
    • Call whisper
    • Forwarding calls
    • Making and receiving phone calls
    • Recording calls
    • Setting up voicemail
    • Simple IVR
  • SWAIG Functions
    • Overview
    • Enable functions dynamically
    • Execute SWML from a function
    • Handle SWAIG function calls inline
    • Store data outside LLM context
    • Switch AI context mid-call
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Setting up voicemail with SignalWire
  • How to assign the script to a SignalWire phone number
  • How to access the recordings
  • Wrapping up
Recipes

Setting up voicemail

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

Simple IVR

Next
Built with

A popular and important use case is recording a voicemail from your callers when you are unable to speak with them. This guide will show how to do exactly that using SWML.

Setting up voicemail with SignalWire

We are going to implement voicemail in a SWML script hosted on SignalWire. To create a new SWML script, navigate to the Resources section from your sidebar. From there, create a new script, and select the SWML option.

Create a new SWML script, and paste the following SWML in it:

1version: 1.0.0
2sections:
3 main:
4 - play:
5 url: 'say: Please leave a message with your name and number after the beep. Press pound when finished.'
6 - record:
7 beep: true
8 terminators: '#'
9 max_length: 15
10 - play:
11 url: 'say: Thank you for your message. A member of our team will contact you shortly. Goodbye!'

We use the play method to play the voicemail prompt, then the record method to record the caller’s message. The record method pauses SWML execution until the recording ends, so the final message plays immediately after.

The record method accepts parameters to configure the beep, terminators, max length, silence timeout, and more. For additional information, see the record technical documentation.

How to assign the script to a SignalWire phone number

Click the Phone Numbers tab on your sidebar within your SignalWire Space, and click the specific number you would like to set up voicemail on. If you don’t have a number yet, now is the time to buy one!

Edit the settings of your selected number, and assign the SWML script you created to the Inbound Call Settings.

Assign Resource to Phone number.

How to access the recordings

You can view, listen to, and download all your recordings in the Storage section of your SignalWire Space. From the sidebar, navigate to Storage > Recordings.

You can also access recordings via our REST API.

Wrapping up

We have seen how to build a basic voicemail using SWML scripts.