Docs

Receive voice call

https://api.apifonica.com/v2/accounts/{accountSID}/numbers/{numberSID}

Overview

To receive incoming voice calls you need to create an application and link your local number with this application.

Step 1. Creating an application

Make POST request to /accounts/{accountSID}/applications. For more details please refer to Create application article.
In the controller parameter of the application, it is necessary to specify the URL to the application on your server, that will be responsible for the call redirections.
It's much easier to do via your personal account - Applications-> New application.

Step 2. Linking

To link your number with the created application you need to set an ID of the application, that will be responsible for incoming calls (call_app_sid parameter), in the properties of the local number.
Make PUT request to /accounts/{accountSID}/numbers/{numberSID}. For more details please refer to Change number properties article.
It's much easier to do via your personal account - set the Call application parameter in the properties of the local number.

When you receive a call to a number, Apifonica will access the URL specified in call_app_sid and execute the XML commands for the call redirections. For example:

<?xml version="1.0" encoding="UTF-8" ?>
<response>
<makeCall><number>35315313424</number></makeCall>
<endCall/>
</response>