Overview

Plivo passes the call status of an ongoing call so you can decide how to process it. For all the calls made using Plivo’s Make a Call API or Dial XML, Plivo sends the call status to the application server at different stages of a call. We send call status as an HTTP webhook request to URLs such as ring_url, answer_url, fallback_url, action_url, callback_url, and hangup_url.

In each callback, the CallStatus parameter takes one of these values:

in-progress

The call was answered and is in progress. Calls with this status can be terminated using the Hangup API.

completed

The call was completed, terminated either by the Hangup API or by one of the parties in the call.

ringing

The call is ringing. This status is sent to the Ring URL.

no-answer

The call was not answered.

busy

The called line is busy.

cancel

The call was canceled by the caller.

timeout

There was a timeout while connecting your call, caused by either an issue with one of the terminating carriers or network lag in our system.

Plivo sends these parameters to the application server in the webhook:

ParameterDescription
DialRingStatusIndicates whether the dial attempt rang or not. Values: true, false
DialHangupCauseThe standard telephony hangup cause.
DialStatusStatus of the dial. Values: completed, busy, failed, timeout, no-answer
DialALegUUIDCallUUID of the A leg.
DialBLegUUIDCallUUID of the B leg. Empty if nobody answers.

You can implement dial status reporting either by using our PHLO visual workflow builder or our APIs and XML documents. Follow the instructions in one of the tabs below.

You can create and deploy a PHLO to handle dial status reporting with a few clicks on the PHLO canvas, without writing a single line of code.

How it works

Prerequisites

To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. To receive incoming calls, you must have a voice-enabled Plivo phone number. You can rent numbers from the Numbers page of the Plivo console, or by using the Numbers API.

Create the PHLO

To create a PHLO, visit the PHLO page of the Plivo console. If this is your first PHLO, the PHLO page will be empty.

  • Click Create New PHLO.

  • In the Choose your use case pop-up, click Build my own. The PHLO canvas will appear with the Start node.

    Note: The Start node is the starting point of any PHLO. It lets you trigger a PHLO to start upon one of three actions: incoming SMS message, incoming call, or API request.

  • From the list of components on the left side, drag and drop the Call Forward component onto the canvas. When a component is placed on the canvas it becomes a node.

  • Draw a line to connect the Start node’s Incoming Call trigger state to the Call Forward node.

  • In the configuration panel for the Call Forward node, enter the caller ID variable {{ "{{Start.call.from" }}}} in the From field. Enter any numbers you want to call in the To field, separated by commas.

  • Once you’ve configured the node, click Validate to save the configuration.

  • Next, from the list of components, drag and drop the HTTP Request component onto the canvas.

  • Draw lines to connect all of the dial status states of the Call Forward node (Completed, No Answer, Busy/Rejected, Failed) with the HTTP Request node.

  • Configure the HTTP Request node. Enter your application server URL in the box next to the HTTP Method (GET/POST) field.

  • Provide key:value pairs of the callback attributes you’re interested in, such as DialRingStatus, DialHangupCause, DialStatus, DialALegUUID, and DialBLegUUID.

  • Give the PHLO a name by clicking in the upper left, then click Save.

Assign the PHLO to a Plivo number

Once you’ve created and configured your PHLO, assign it to a Plivo number.

  • On the Numbers page of the console, under Your Numbers, click the phone number you want to use for the PHLO.
  • In the Number Configuration box, select PHLO from the Application Type drop-down.
  • From the PHLO Name drop-down, select the PHLO you want to use with the number, then click Update Number.

Test

You can now make a call to your Plivo phone number. After the call ends, Plivo reports back the status via the key:value pairs you specified to the URL you specified.

For more information about creating a PHLO app, see the PHLO User Guide.For more information about creating a PHLO application, see the PHLO Getting Started guide. For information on components and their variables, see the PHLO Components Library.