Your application must use Plivo XML to control a call or message synchronously. The XML elements can be combined in different ways to perform complex actions. Some of the possible control actions are:
- 1. Playing music while the caller is on hold
- 2. Reading out specified text to the caller
- 3. Requesting numeric inputs
- 4. Dialing and connecting to another number
How Plivo Communicates With Your Web Application
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 GET or POST by changing the related config parameter.
The diagram below outlines a typical case where XML is used:
- 1. An incoming call is received on a Plivo endpoint and is connected through the Plivo Cloud.
- 2. Plivo then looks up your answer_url and responds to that URL.
- 3. Your web application at that URL should return an XML document that provides instructions to the Plivo API on how the call should proceed.
Using XML, outgoing calls can also be controlled in the same manner as incoming calls. The initial outbound call is made through a API request; when the call gets answered, the Plivo API calls the web application on the answer_url which carries instructions to process the outbound call.