---slug: /guides/how-to-set-up-voicemailsidebar_position: 2---# Setting Up VoicemailA 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.## Creating an XML binIn this guide we are going to see how to implement a voicemail using XML bins, which can be used to define the behavior of phone calls. To create an XML bin, go to the LaML section in your [SignalWire space](https://signalwire.com/signin), then click on Bins.To create a new XML bin, click the blue button in the LaML section of your SignalWire space.We are going to write the code for this XML bin. It will use the [<Say>](pathname:///compatibility-api/xml/voice/say) verb to play the voicemail prompt to a caller and [<Record>](pathname:///compatibility-api/xml/voice/record) to record a message.In the [<Record>](pathname:///compatibility-api/xml/voice/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>](pathname:///compatibility-api/xml/voice/record) verb, the recording prompt will loop over and over.Here is the code:xml Please leave a message with your name and number at the beep. Press the pound key when finished. maxLength=15 finishOnKey=# />Copy the code above into your XML bin, then save it.Take a moment to notice the action attribute for [<Record>](pathname:///compatibility-api/xml/voice/record). We would like to play a message right after the recording ends, butadding a [<Say>](pathname:///compatibility-api/xml/voice/say) verb below [<Record>](pathname:///compatibility-api/xml/voice/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>](pathname:///compatibility-api/xml/voice/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, its very important to hang up to avoid looping calls after a recording!xmlThank you for your message. A member of our team will contact you shortly. Goodbye!Save this new bin. Take note of its Request URL, and go back to the first bin to update the action URL in [<Record>](pathname:///compatibility-api/xml/voice/record) to point to the second bin!## How to Assign the Bin to a SignalWire Phone NumberIf you are not familiar with webhooks, read our [advanced guide to configuring webhooks](guides/numbers-api/guides/general/how-to-configure-your-webhook/index.mdx) for more information.Click the **Phone Numbers** tab on your lefthand side nav within your SignalWire space, and click the specific number you would like to set up call forwarding on. If you dont have a number yet, now is the time to [buy one](guides/numbers-api/getting-started/buying-a-phone-number/index.mdx)!To configure your number to handle incoming calls with an XML bin, set Handle calls using to LaML Webhooks, then specify the URL of the XML bin.Make sure that **Accept Calls As** is set to **Voice Calls**, **Handle Calls Using** is set to **LaML Webhooks**, and paste your Bin URL in as the value for **When a Call Comes In**. Click **Save**, and youre done! Inbound calls to this SignalWire number will execute our voicemail bin.## How to Access the RecordingsTo access your recordings, 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 will also see the call ID and recording ID that you can use to [access recordings via our API](pathname:///compatibility-api/rest/retrieve-a-recording).Access your recordings from the LaML tab.### Wrapping upWe have seen how to build a basic voicemail using XML bins. Inparticular, we showed how to chain two bins together: we set up our first bin toexecute 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](guides/voice-api/guides/realtime-api/setting-up-voicemail/index.mdx).