Setting Up Voicemail
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.
cXML for Voicemail
We are going to implement voicemail in an cXML bin hosted on SignalWire. First, to create a new cXML bin, navigate to the "Resources" section from your sidebar. There, create a new Script, and select the "cXML" option.
Create a new cXML bin, and paste the following XML in it:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>
Please leave a message with your name and number at the beep. Press the
pound key when finished.
</Say>
<Record action="https://<URL-To-Hangup-Bin>" maxLength="15" finishOnKey="#" />
</Response>
Copy the code above into your XML bin, then save it.
The cXML uses the <Say> verb to play the voicemail prompt to a caller and <Record> to record a message. In the <Record> verb, we will also specify a max length of seconds for the recording and a key that when pressed will execute a new document of instructions. If you do not specify an action URL within the <Record> verb, the recording prompt will loop over and over.
Take a moment to notice the action
attribute for <Record>. We would like to play a
message right after the recording ends, but adding a <Say> verb below
<Record> will not wait for the recording to finish.
The action
attribute allows us to specify the URL of a different bin which should be executed right after the recording ends:
we will use this to play a closing message and hang up the call with <Hangup>.
For this reason we also need another bin, which will be executed after the recording in the first one terminates. This second bin will play a short prompt advising the caller that they will be contacted and then it will hang up the call. Even though this bin is simple, it's very important to hang up to avoid looping calls after a recording!
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Thank you for your message. A member of our team will contact you shortly. Goodbye!</Say>
<Hangup/>
</Response>
Save this new cXML. Take note of its Request URL, and go back to the first bin to update the "action" URL in <Record> to point to the second bin!
How to Assign the cXML to a SignalWire Phone Number
If you are not familiar with webhooks, read our advanced guide to configuring webhooks for more information.
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 voicemail cXML you made to the Inbound Call Settings.

If your account was created prior to January 2025, your Dashboard may be on the Legacy UI.
If you're still on Legacy UI, refer to Making and Receiving Phone Calls for detailed instructions.
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.
If you're on the Legacy UI, click the "LaML" section on the left-hand side nav. Click the "Recordings" tab, and you will be able to view, listen, and download your recording files.
You can also access recordings via our REST API.
Wrapping up
We have seen how to build a basic voicemail using cXML bins. In particular, we showed how to chain two bins together: we set up our first bin to execute the second one after the recording finished.
If you need more flexibility, you can implement the same application using Node.js: take a look at how to set up a voicemail using Node.js.