How it works
Let’s take an example to understand how Plivo XML works. Consider a usecase where you want to play some audio to a caller (i.e., play something on receiving an incoming call).
The diagram below outlines a typical case where XML is used:
Here’s how the call flow works.
An incoming call is received on a Plivo number (or an endpoint) and is connected through the Plivo Cloud. Plivo then looks up your
answer_url configured for the Application that is linked to the Plivo number (or the endpoint) and makes a request to that URL. Your web application at that URL should return an XML document that provides instructions to the Plivo API on how the call should proceed.
In this example, Plivo works like an HTTP Client which receives the call and requests your web application for instructions to control the call. By default, XML requests to your application are made via
POST. However, you can configure Plivo to make its XML requests to your application via HTTP
POST by changing the related configuration parameter.
You can set these configuration parameters while making an outbound call or while sending out a message. To deal with incoming calls and incoming messages, Plivo uses the configuration attached to the Application that is linked to the phone number on which your incoming call or message is being received.