import Tabs from @theme/Tabs; import TabItem from @theme/TabItem; # Making and Receiving Phone Calls In this guide we are going to show how to make and receive phone calls using the following products: - **SWML** - SWML Script - **Compatibility API** - REST APIs - XML Bins ## Prerequisites To be able to make calls, you will need: - a SignalWire phone number - your API credentials (Space URL, Project ID, and API token) To acquire a phone number, [Log in](https://signalwire.com/signin) to your SignalWire Space. From the [Phone Numbers section](https://my.signalwire.com/?phone_numbers), you can [buy a new phone number](guides/numbers-api/getting-started/buying-a-phone-number/index.mdx). You will need at least one number to make and receive calls. For what concerns your API credentials, find these in the API section of your Space, as shown in the following figure. You may need to create a new token if you never used one. Make sure that your token has the Voice scope enabled. :::info Trial Mode If your account is in [trial mode](guides/administration/guides/signalwire-space/trial-mode.mdx), you need to upgrade it in order to call numbers other than your own verified numbers. See [How to exit Trial Mode](guides/administration/guides/signalwire-space/trial-mode.mdx). ::: ## SWML ### Receiving incoming calls To handle incoming calls we need to configure the phone number in our [SignalWire Space](https://signalwire.com/signin) to answer calls using a SWML Script. To create a SWML Script, go to the Relay/SWML section in your SignalWire Space, then click on the SWML Scripts tab. Click on Create a SWML Script, and then give it a name and pass it some instructions. You can use the following as a starting point: yaml andJson version: 1.0.0 sections: main: - play: say:Hello from SignalWire! Take note of the Request URL for the SWML Script that we created. You can even create a new script if you want to define a different behavior for incoming calls. To configure your number to handle incoming calls with an SWML Script, click the [Phone Numbers section](https://my.signalwire.com/?phone_numbers) within your SignalWire Space, and edit the settings of the specific number you would like to use to answer calls. Set Handle calls using to a SWML Script, then select your SWML Script from the dropdown: Thats it! Inbound calls to this SignalWire number will execute the specified SWML Script. ## Compatibility API ### Making your first call You now have all you need to make your first call, for example to your personal phone number. We want to call a number and play an audio message which says Welcome to SignalWire. This is my first call. We are going to define this behavior in an XML bin, which is used to declare what should happen during a call. To create an XML bin, go to the LaML section in your [SignalWire Space](https://signalwire.com/signin), then click on Bins. Create a new bin, and paste the following XML in it: xml