# 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. ## Creating an XML bin In 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. We are going to write the code for this XML bin. It will use the [<Say>](/compatibility-api/cxml/voice/say) verb to play the voicemail prompt to a caller and [<Record>](/compatibility-api/cxml/voice/record) to record a message. In the [<Record>](/compatibility-api/cxml/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>](/compatibility-api/cxml/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>](/compatibility-api/cxml/voice/record). We would like to play a message right after the recording ends, but adding a [<Say>](/compatibility-api/cxml/voice/say) verb below [<Record>](pathname:///compatibility-api/cxml/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/cxml/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! xml Thank 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/cxml/voice/record) to point to the second bin! ## How to Assign the Bin to a SignalWire Phone Number If 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)! 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 Recordings To 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](/rest/compatibility-api/endpoints/retrieve-recording). ### Wrapping up We have seen how to build a basic voicemail using XML 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](guides/voice-api/guides/realtime-api/setting-up-voicemail/index.mdx).