Components Library

A PHLO is a collection of components on the PHLO canvas connected with one another to perform a task by processing data. A component is a function that performs actions in a workflow based on data configured or received via HTTP callback.

An instance of a component dragged onto the canvas is called a node. Each node can be connected to one or many other nodes to route data through the workflow.

Each component/node has configuration parameters, options, state, and variables.

  • Configuration parameters: Each component has a configuration panel that lets PHLO creators set parameters used to perform the component’s actions.
  • Options: Options are values that are defined for configuration parameters either dynamically using Liquid templates or with hard-coded values. Configuration parameters and options act like key-value pairs.
  • States: A state is a property set based on the component’s action’s output status. For example, for the Send Message component, the state can either be Sent or Failed based on the delivery of the SMS message.
  • Variables: Each component contains a list of variables that Plivo can send to a webhook as an HTTP callback. Variables are configured in the Event Callbacks section of the each PHLO’s configuration panel.

Here’s the list of all PHLO components and their respective parameters, options, states, and variables:

Start

A PHLO always starts executing from the start node. Every PHLO has only one start node. Voice PHLOs use Incoming Call states, while SMS PHLOs use Incoming Message states, and both may use API Request states.

Configuration parameters

  • Key
  • Value

Options

  • Payload in HTTP Request Payload should be a key-value pair. In the bulk edit mode, only valid JSON accepted. For Example:
    {
      "from":"+1415234567",
      "to":"+14157654321",
      "otp":"779889",
    }
    

States

The Start component state is set to:

  • Incoming Message, upon receiving an SMS message to a phone number attached to a PHLO
  • Incoming Call, upon receiving a call to a phone number/endpoint attached to the PHLO
  • API Request, upon receiving an HTTP request to the PHLO URL

Variables

request_type

Request type is set to call for an incoming call, sms for an incoming message, or http for an HTTP request.

These variables are set when an incoming call triggers a PHLO.

  • call.uuid UUID of the incoming call
  • call.to Phone number or SIP endpoint to which the call is made. Generally, it’s the phone number or SIP endpoint that triggered the PHLO.
  • call.from Phone number or SIP endpoint from which the call is made
  • call.start_time Time when the call started
  • call.answer_time UTC time when the call is answered
  • call.end_time UTC time when the call ended
  • call.direction The direction of the call is set to inbound
  • call.to_iso2 ISO alpha-2 code of the country to which the to phone number belongs
  • call.from_iso2 ISO alpha-2 code of the country to which the from phone number belongs
  • call.to_country Country to which the to phone number belongs
  • call.from_country Country to which the from phone number belongs
  • call.leg The leg for the inbound call is set to ALeg
  • call.hangup_cause Code of the hangup cause corresponding to the reason for the hangup
  • call.duration Duration (in seconds) of the call since the dial
  • call.bill_duration Duration (in seconds) of the call that is billed
  • call.bill_rate Unit rate applicable for the call
  • call.bill_amount Amount billed for the call

These variables are set when an incoming message triggers a PHLO.

  • message.message_uuid UUID of the incoming message
  • message.time UTC time when the message is received
  • message.direction Direction of the SMS is set to inbound
  • message.status Status is set to received
  • message.to Phone number to which the SMS is sent
  • message.from Phone number from which the SMS is sent
  • message.to_iso2 ISO alpha-2 code of the country to which the to phone number belongs
  • message.from_iso2 ISO alpha-2 code of the country to which the from phone number belongs
  • message.to_country Country to which the to phone number belongs
  • message.from_country Country to which the from phone number belongs
  • message.msg The content of the received SMS
  • message.units The number of SMS units required to send the message
  • message.total_rate Unit rate applicable for the SMS
  • message.total_amount Amount billed for the SMS

These variables are set when an API request triggers a PHLO.

  • request.uuid Unique identifier for the API request
  • request.params Payload sent in the API Request. The keys present in the payload can be configured in the child nodes.

Send SMS

The Send SMS component sends an SMS message.

Configuration Parameters:

  • From
  • To
  • Message
  • Media URLs
  • Settings
  • Events

Options:

  • From (required) Sender ID to display to the recipient of the SMS
  • To (required) List of phone numbers to which to send the SMS
  • Message The text message that is to be sent. By default, Plivo logs this text. Deselect the log message content option to change the logging behavior.
  • Media URLs The media attachments (jpeg/png/gif) to be sent. Maximum file size allowed is 500KB.

States:

Send SMS component is set to Sent state when an SMS is sent. If the status is failed, undelivered, or rejected, the component is set to Failed state.

Variables:

  • message_uuid Unique identifier for the SMS
  • from Phone number from which the SMS is sent
  • to Phone number to which the SMS is sent
  • media_urls List of all the media URLs
  • media_count The number of media in a message
  • type Type of message (sms/mms)
  • to.iso2 ISO alpha-2 code of the country to which the to phone number belongs
  • from.iso2 ISO alpha-2 code of the country to which the from phone number belongs
  • to_country Country to which the to phone number belongs
  • from_country Country to which the from phone number belongs
  • msg The content of the SMS to be sent
  • units The number of SMS units required to send the message
  • total_rate Unit rate applicable for the SMS
  • total_amount Amount billed for the SMS
  • direction Direction of the SMS is set to outbound
  • status Delivery status of the SMS. Possible values are queued, sent, failed, delivered, undelivered, and rejected.
  • error_code Delivery response code returned by the carrier attempting the SMS delivery

IVR Menu

The IVR Menu component receives input on an ongoing call and branches the execution by evaluating the input. Optionally, it can play a message before receiving the input.

Configuration parameters:

  • Allowed inputs
  • IVR menu
  • Events

Options:

  • Prompts List of messages to be played on the call. Speak Text and Play Audio are the types of messages. In a Speak Text message, you can configure the message to speak, language, and voice. In a Play Audio message, you can specify a URL to an audio file or upload an audio file.
  • Inputs Allowed Inputs is the list of choices that the IVR menu can accept. The choices are limited to digits 0-9, #, and *. Input Timeout is the time (in seconds) within which a user should start giving input. The default value is 5 seconds. By default, the message played is interrupted when an input is entered. Deselect the Interrupt Audio on Input option to play the complete message before accepting input.

States:

A new state (with the choice as the name) is added to the node for each choice selected in Allowed Inputs. No Input and Wrong Input states are present by default. No Input is set when an input is not provided within the input timeout. Wrong Input is set when the provided input is not in the allowed choices.

Variables:

  • digits Input entered by user
  • input_type Input type is set to digits

Get Input

The Get Input component can receive input from a user on an ongoing call. Optionally, it can play a message before receiving the input.

Configuration parameters:

  • Speak text
  • Settings
  • Events

Options:

  • Prompt Message to play on the call. Speak Text and Play Audio are the types of messages. In a Speak Text message, you can configure the message to speak, language, and voice. In a Play Audio message, you can specify a URL to an audio file or upload an audio file.

  • Input Max Input Size is the maximum number of digits that a user can input. Any additional input entered is ignored. Default value is 99. Input Timeout is the time (in seconds) within which a user should start giving input. If multiple digits are accepted, the timeout between entering consecutive digits is set to Input Timeout. The default value is 5 seconds.

States:

The component is set to Successful Input state when an input is entered. The No Input state is set if input is not provided within the input timeout period.

Variables:

  • input Input entered by user
  • input_type Input type is set to digits

Initiate Call

The Initiate Call component makes a single call or bulk outbound calls to phone numbers or SIP endpoints.

Configuration parameters:

  • From
  • To
  • Settings
  • Record Calls
  • Events

Options:

  • From (required) Caller ID to display to the recipient of the call
  • To (required) List of phone numbers and SIP endpoints that need to be dialed
  • Call Settings Ring timeout is the time period (in seconds) for which an unanswered call should ring before hanging up
  • Record Audio This option is used to decide how calls are recorded. Calls can be recorded dynamically by passing these values:
Recording = TrueRecording = False
Any integer

0

TrueCase insensitiveFalseCase insensitive
Object, String

Empty

 

Null

States:

Component is set to Answered state. Other states are No Answer, Busy/Rejected, and Failed. When a machine is detected, the component is set to Voicemail state.

Variables:

  • uuid Unique identifier for the outbound call
  • to Phone numbers or SIP endpoints to call
  • from Caller ID to set on the call
  • start_time UTC time when the call started
  • answer_time UTC time when the call is answered
  • end_time UTC time when the call ended
  • direction Direction of the call is set to outbound
  • from_iso2 ISO alpha-2 code of the country to which the phone number belongs
  • from_country Country to which the phone number belongs
  • leg The leg of the forwarded call is set to ALeg
  • hangup_cause Code of the hangup cause corresponding to the reason for the hangup
  • duration Duration (in seconds) of the call since the dial
  • bill_duration Duration (in seconds) of the call that’s billed
  • bill_rate Rate per unit applicable for the call
  • bill_amount Amount billed for the call
  • ring_status Set to true if the call rings. Allowed values: true, false
  • voicemail_detected Set to true if machine is detected in the call
  • call_status Status of the call — set to in-progress

Call Forward

The Call Forward component bridges a phone number or SIP endpoint into an active call.

Configuration parameters:

  • From
  • To
  • General options
  • Events

Options:

  • From (required) Caller ID to display to the recipient of the forwarded call.
  • To (required) List of recipients to bridge into the active call. The list can contain phone numbers and SIP endpoints, each separated by a comma. Based on the forwarding option selected, recipients are dialed sequentially or simultaneously. If an extension is configured it will be dialed when the call is answered.
  • Ring timeout Time limit (in seconds) for the recipient to answer the call. The Failed state is triggered when the time limit is reached. The default value is 30 seconds.
  • Forwarding options Forwarding is applicable when you provide multiple call recipients. The sequence option dials one recipient at a time and tries the next recipient once the ring timeout limit is reached. The parallel option dials all recipients simultaneously, and the first call that connects cancels all the other tries. The same ring timeout is applied to all the calls irrespective of the forwarding option selected.
  • Call screening You can play a message before the recipient is connected to the call. The recipient must press the specified confirm key to accept the call.
  • Record Audio This option is used to decide how the calls are recorded. Calls can be recorded dynamically by passing these values:
Recording = TrueRecording = False
Any integer

0

TrueCase insensitiveFalseCase insensitive
Object, String

Empty

 

Null

States:

The Call Forward component is set to Completed state when either party hangs up the call. Other states are No Answer, Busy/Rejected, and Failed.

Variables:

  • uuid UUID of the forwarded call
  • to Phone number or SIP endpoint to which the call is forwarded
  • from Caller ID set on the forwarded call
  • start_time UTC time when the call started
  • answer_time UTC time when the call is answered
  • end_time UTC time when the call ended
  • direction The direction of the call is set to outbound
  • from_iso2 ISO alpha-2 code of the country to which the phone number belongs
  • from_country Country to which the phone number belongs
  • leg The leg of the forwarded call is set to BLeg
  • hangup_cause Code of the hangup cause corresponding to the reason for the hangup
  • duration Duration (in seconds) of the call since the dial
  • bill_duration Duration (in seconds) of the call that’s billed
  • bill_rate Rate per unit applicable for the call
  • bill_amount Amount billed for the call
  • ring_status Set to true if the call rings. Allowed values: true, false
  • parent_call_uuid UUID of the parent call that’s forwarded
  • dial_status Status of the call. Allowed values: completed, busy, failed, no-answer

Hangup

The Hangup component hangs up the current active call.

Configuration parameters:

  • Hangup reason

Options:

  • Reason May be Rejected or Busy

States:

After the call is hung up, the component state is set to Hangup Complete.

Play Audio

The Play Audio component plays a message on an ongoing call.

Configuration parameters:

  • Speak text
  • Settings

Options:

  • Prompts List of messages to be played on the call. Speak Text and Play Audio are the types of messages. In a Speak Text message, you can configure the message to speak, language, and voice. In a Play Audio message, you can specify a URL to an audio file or upload an audio file.

States:

The component state is set to Prompt Completed after the messages are played on the call.

Record Audio

The Record Audio component records a message from the caller. Optionally, it can play a message before recording the message.

Configuration parameters:

  • Speak text
  • Settings
  • Events

Options:

  • Prompt Message to play on the call. Speak Text and Play Audio are the types of messages. In a Speak Text message, you can configure the message to speak, language, and voice. In a Play Audio message, you can specify a URL to an audio file or upload an audio file.

  • Record By default, a beep is played along with the message before the recording is initiated. Deselect the Play beep after audio option to disable it.

States:

The component state is set to Recording Completed after the message is recorded.

Variables:

  • call_uuid UUID of the incoming call
  • recording_url URL of the recording
  • recording_uuid Identifier for the recording
  • recording_duration Duration (in milliseconds) of the recording
  • recording_start_time Time (Unix timestamp) when the recording started
  • recording_end_time Time (Unix timestamp) when the recording ended

Multiparty Call

The Multiparty Call component allows multiple users to dial in to a single call.

Configuration parameters:

  • From
  • To
  • Recording options
  • Hold music configuration
  • Transfers
  • Roles
  • Events

Options:

  • Conference_name (required) Name of the conference bridge

  • Prompt Announcement message to be played when a dialer is added into the conference. Speak Text and Play Audio are the types of messages. In a Speak Text message, you can configure the message to speak, language, and voice. In a Play Audio message, you can specify a URL to an audio file or upload an audio file.

  • Hold music You can play music to users waiting for a conference to start. You can configure a URL to an audio file or upload an audio file to be played until the moderator joins the conference.

  • You can play a beep or double beep when a new caller is added to or removed from the conference. Callers can be muted when joining a conference.

States:

The Multiparty Call component is set to Completed state when there are no callers on the conference bridge. The Failed state is set when an error occurs.

Variables:

  • from Phone number or SIP endpoint from which the call is made
  • direction Direction of the call can be set to outbound or inbound
  • caller_name Name of the caller. Defaults to the from phone number or SIP endpoint
  • to Phone number or SIP endpoint to which the call is made
  • event Latest triggered event in the component. Can take the values ConferenceEnter, ConferenceExit, or Redirect
  • bill_rate Unit rate applicable for the call
  • call_status Status of the call — set to in-progress
  • conference_name Name of the conference bridge
  • call_uuid UUID of the incoming call
  • conference_uuid UUID of the conference
  • member_id ID of a member in a conference. A unique ID is assigned to each member in a conference.
  • to_iso2 ISO alpha-2 code of the country to which the to phone number belongs
  • from_iso2 ISO alpha-2 code of the country to which the from phone number belongs
  • to_country Country to which the to phone number belongs
  • from_country Country to which the from phone number belongs

Multiparty call triggers

The Multiparty Call component allows multiple users to dial in to a single call. Based on triggers, you can choose a specific action for each user on the call. These are the types of triggers:

  • Call
  • Hold and resume
  • Transfer
  • Hangup
  • Resume call after warm transfer
  • Abort transfer
  • Voicemail drop

Call

With the Call trigger, you can use a phone number or a SIP endpoint to make a call. When the call is received, you and the receiver are added to a conference call.

SDK method and usage

1
2
3
4
5
curl --request POST \
  --user AUTH_ID:AUTH_TOKEN \
  --url 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}' \
  --header 'Content-Type: application/json' \
  --data '{"trigger_source": "12025550000","to": "12025551111","role": "agent","action":"call"}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
node_id = '<node_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)

trigger_source = '2025550000'
to = '2025551111'
role = 'agent'

response = phlo.multi_party_call(node_id).call(trigger_source, to, role)
print str(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import com.plivo.api.Plivo;
import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.node.MultiPartyCall;
import com.plivo.api.models.node.MultiPartyCallActionType;
import com.plivo.api.models.node.MultiPartyCallUpdateResponse;
import com.plivo.api.models.phlo.Phlo;
import java.io.IOException;

public class Example
{
    privatestatic final  String authId = "<auth_id>";
    private static final String authToken = "<auth_token>";
    private static PlivoClient client = new PlivoClient(authId, authToken);
    public static void main(String[] args) throws IOException, PlivoRestException
    {
        String phloId = "<phlo_id>";
        String nodeId = "<node_id>";
        String triggerSource = "12025550000";
        String to = "12025551111";
        String memberId = to;
        String role = "agent";
        Plivo.init(authId, authToken);
        Phlo phlo = Phlo.getter(phloId).client(client).get();

        MultiPartyCall mpc = MultiPartyCall.getter(phloId, nodeId).get();

        MultiPartyCallUpdateResponse response = MultiPartyCall.updater(phloId, nodeId).triggerSource(triggerSource).to(to).role(role).call().update();
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main

import (
	"fmt"
	"plivo-go"
)

// Initialize the following params with corresponding values to trigger resources

const authId  = "<auth_id>"
const authToken = "<auth_token>"
const phloId = "phlo_id"
const nodeId = "node_id"
const actionTo = "to_endpoint"
const actionSource = "from_endpoint"

//Use the following multiparty call actions as needed; do not edit the following

const actionRole = "agent"
const actionCall = "call"

func main() {
	testMultiPartyCallCall()
}

func testMultiPartyCallCall() {
	phloClient,err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	MPCGet, err := phloGet.MultiPartyCall(nodeId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	callPayload := plivo.PhloMultiPartyCallActionPayload{
		actionCall,
		actionTo,
		actionRole,
		actionSource,
	}

	response, _ := MPCGet.Call(callPayload)
	fmt.Printf("Response: %#v\n", response)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
/**
 * Example for MultiParty Call
 */
require 'vendor/autoload.php';
use Plivo\Resources\PHLO\PhloRestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new PhloRestClient("<auth_id>", "<auth_token>");
$phlo = $client->phlo->get("<phlo_id>");
$multiPartyCall = $phlo->multiPartyCall()->get("<node_id>");
try {
    $response = $multiPartyCall->call($trigger_source, $to, $role);
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var plivo = require('../dist/rest/client.js');
var PhloClient = plivo.PhloClient;

var authId = 'auth-id';
var authToken = 'auth-token';
var phloId = 'PHLO_ID';
var mpcId = 'Multiparty_call_NodeID';
var phloClient = phlo = null;
var mpcSourceNo = 'member_id'; //Trigger source address
var mpcTargetNo = 'target_id'; //Trigger target address
var role = 'agent';

// Add member to multi party call
phloClient = new PhloClient(authId, authToken);
phloClient.phlo(phloId).multiPartyCall(mpcId).call(mpcSourceNo, mpcTargetNo, role).then(function (result) {
    console.log('Multiparty call result', result);
}).catch(function (err) {
    console.log('Multiparty call failed', err);
});

Hold and resume

You can use the Hold trigger to place the caller on hold, during which time customer hold music is played. Once you end the hold, the customer hold music stops and the caller returns back to the conference call.

SDK method and usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Hold:

curl --request POST \
  --user AUTH_ID:AUTH_TOKEN \
  --url 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}/members/{MemberAddress}' \
  --header 'Content-Type: application/json' \
  --data '{"action":"hold"}'

Resume:

curl --request POST \
  --user AUTH_ID:AUTH_TOKEN \
  --url 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}/members/{MemberAddress}' \
  --header 'Content-Type: application/json' \
--data '{"action":"unhold"}'

#Member Address- Phone number of the agent or customer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
node_id = '<node_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)

member_address = '2025551111'

#Hold:
response = phlo.multi_party_call(node_id).member(member_address).hold()

#Resume:
response = phlo.multi_party_call(node_id).member(member_address).unhold()

print str(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import com.plivo.api.Plivo;
import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.node.MultiPartyCall;
import com.plivo.api.models.node.MultiPartyCallActionType;
import com.plivo.api.models.node.MultiPartyCallUpdateResponse;
import com.plivo.api.models.phlo.Phlo;
import java.io.IOException;

public class Example
{
    privatestatic final  String authId = "<auth_id>";
    private static final String authToken = "<auth_token>";
    private static PlivoClient client = new PlivoClient(authId, authToken);
    public static void main(String[] args) throws IOException, PlivoRestException
    {
        String phloId = "<phlo_id>";
        String nodeId = "<node_id>";
        String to = "12025551111";
        String memberId = to;
        Plivo.init(authId, authToken);
        Phlo phlo = Phlo.getter(phloId).client(client).get();

        MultiPartyCall mpc = MultiPartyCall.getter(phloId, nodeId).get();

        //Hold:
        MultiPartyCallUpdateResponse response = MultiPartyCall.updater(phloId, nodeId).member(memberId).hold().update();

        //Resume:
        MultiPartyCallUpdateResponse response = MultiPartyCall.updater(phloId, nodeId).member(memberId).unhold().update();
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package main

import (
	"fmt"
	"plivo-go"
)

// Initialize the following params with corresponding values to trigger resources

const authId  = "<auth_id>"
const authToken = "<auth_token>"
const phloId = "phlo_id"
const nodeId = "node_id"
const memberId  = "member_id"

//HOLD

func main() {
	testMultiPartyCallMemberHold()
}

func testMultiPartyCallMemberHold() {
	phloClient,err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	MPCGet, err := phloGet.MultiPartyCall(nodeId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	response, err := MPCGet.Member(memberId).Hold()
	if (err != nil) {
		fmt.Println(err)
	}
	fmt.Printf("Response: %#v\n", response)

}

//Resume

func main() {
	testMultiPartyCallMemberUnHold()
}

func testMultiPartyCallMemberUnHold() {
	phloClient,err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	MPCGet, err := phloGet.MultiPartyCall(nodeId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	response, err := MPCGet.Member(memberId).UnHold()
	if (err != nil) {
		fmt.Println(err)
	}
	fmt.Printf("Response: %#v\n", response)

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
 * Example for Multiparty Hold
 */
require 'vendor/autoload.php';
use Plivo\Resources\PHLO\PhloRestClient;
use Plivo\Exceptions\PlivoRestException;

$memberAddress = "Member_ID";

$client = new PhloRestClient("<auth_id>", "<auth_token>");
$phlo = $client->phlo->get("<phlo_id>");
$multiPartyCall = $phlo->multiPartyCall()->get("<node_id>");
$multiPartyCallMember = $multiPartyCall->member($memberAddress);
try {
    $response = $multiPartyCallMember->hold();
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}
?>

<?php
/**
 * Example for Multiparty Unhold
 */
require 'vendor/autoload.php';
use Plivo\Resources\PHLO\PhloRestClient;
use Plivo\Exceptions\PlivoRestException;

$memberAddress = "Member_ID";

$client = new PhloRestClient("<auth_id>", "<auth_token>");
$phlo = $client->phlo->get("<phlo_id>");
$multiPartyCall = $phlo->multiPartyCall()->get("<node_id>");
$multiPartyCallMember = $multiPartyCall->member($memberAddress);
try {
    $response = $multiPartyCallMember->unhold();
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var plivo = require('../dist/rest/client.js');
var PhloClient = plivo.PhloClient;

var authId = 'auth-id';
var authToken = 'auth-token';
var phloId = 'PHLO_ID';
var mpcId = 'Multiparty_call_NodeID';
var phloClient = phlo = null;
var mpcSourceNo = 'member_id'; //Trigger source address

// Hold - Phlo Member
phloClient = new PhloClient(authId, authToken);
phloClient.phlo(phloId).multiPartyCall(mpcId).member(mpcSourceNo).hold().then(function (result) {
    console.log('hold result -', result);
}).catch(function (err) {
    console.log('hold failed', err);
});


// Unhold - Phlo Member
phloClient = new PhloClient(authId, authToken);
phloClient.phlo(phloId).multiPartyCall(mpcId).member(mpcSourceNo).unhold().then(function (result) {
    console.log('unhold result -', result);
}).catch(function (err) {
    console.log('unhold failed', err);
});

Warm transfer

You can use the Transfer trigger to perform either a warm or cold transfer. In a warm transfer, the caller is placed on hold while you connect to another agent. Once both of you are connected, the caller is taken off of hold and joins the conference call with you and the other agent.

SDK method and usage

1
2
3
4
5
curl --request POST \
  --user AUTH_ID:AUTH_TOKEN \
  --url 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}' \
  --header 'Content-Type: application/json' \
  --data '{"action": "warm_transfer","trigger_source": "12025550000","role": "agent","to":"12025551111"}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
node_id = '<node_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)

trigger_source = '2025551111'
to = '2025552222'

response = phlo.multi_party_call(node_id).warm_transfer(trigger_source, to)
print str(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import com.plivo.api.Plivo;
import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.node.MultiPartyCall;
import com.plivo.api.models.node.MultiPartyCallActionType;
import com.plivo.api.models.node.MultiPartyCallUpdateResponse;
import com.plivo.api.models.phlo.Phlo;
import java.io.IOException;

public class Example
{
    privatestatic final  String authId = "<auth_id>";
    private static final String authToken = "<auth_token>";
    private static PlivoClient client = new PlivoClient(authId, authToken);
    public static void main(String[] args) throws IOException, PlivoRestException
    {
        String phloId = "<phlo_id>";
        String nodeId = "<node_id>";
        String triggerSource = "12025550000";
        String to = "12025551111";
        String memberId = to;
        String role = "agent";
        Plivo.init(authId, authToken);
        Phlo phlo = Phlo.getter(phloId).client(client).get();

        MultiPartyCall mpc = MultiPartyCall.getter(phloId, nodeId).get();

        MultiPartyCallUpdateResponse response = MultiPartyCall.updater(phloId, nodeId).triggerSource(triggerSource).to(to).role(role).warm_transfer().update();
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package main

import (
	"fmt"
	"plivo-go"
)

// Initialize the following params with corresponding values to trigger resources

const authId  = "<auth_id>"
const authToken = "<auth_token>"
const phloId = "phlo_id"
const nodeId = "node_id"
const actionTo = "to_endpoint"
const actionSource = "from_endpoint"

//Use the following multiparty call actions as needed; do not edit the following

const actionRole = "agent"
const actionCall = "call"
const actionWarmTransfer = "warm_tranfer"
const actionColdTransfer = "cold_transfer"

func main() {
	testMultiPartyCallWarmTransfer()
}

func testMultiPartyCallWarmTransfer() {
	phloClient,err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	MPCGet, err := phloGet.MultiPartyCall(nodeId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	callPayload := plivo.PhloMultiPartyCallActionPayload{
		actionWarmTransfer,
		actionTo,
		actionRole,
		actionSource,
	}
	response, err := MPCGet.WarmTransfer(callPayload)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	fmt.Printf("Response: %#v\n", response)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
/**
 * Example for multiparty warm transfer
 */
require 'vendor/autoload.php';
use Plivo\Resources\PHLO\PhloRestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new PhloRestClient("<auth_id>", "<auth_token>");
$phlo = $client->phlo->get("<phlo_id>");
$multiPartyCall = $phlo->multiPartyCall()->get("<node_id>");
try {
    $response = $multiPartyCall->warm_transfer($trigger_source, $to, $role);
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var plivo = require('../dist/rest/client.js');
var PhloClient = plivo.PhloClient;

var authId = 'auth-id';
var authToken = 'auth-token';
var phloId = 'PHLO_ID';
var mpcId = 'Multiparty_call_NodeID';
var phloClient = phlo = null;
var mpcSourceNo = 'member_id'; //Trigger source address
var mpcTargetNo = 'target_id'; //Trigger target address
var role = 'agent';

// Warm Transfer - multi party call
phloClient = new PhloClient(authId, authToken);
phloClient.phlo(phloId).multiPartyCall(mpcId).warmTransfer(mpcSourceNo, mpcTargetNo, role).then(function (result) {
    console.log('Warm transfer result', result);
}).catch(function (err) {
    console.log('Warm transfer failed', err);
});

Cold transfer

In a cold transfer, the customer is placed on hold while you connect to another agent. Once the other agent connects to the call, the customer is taken off the hold and joins the call with the other agent. Your call hangs up.

SDK method and usage

1
2
3
4
5
curl --request POST \
  --user AUTH_ID:AUTH_TOKEN \
  --url 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}' \
  --header 'Content-Type: application/json' \
  --data '{"action": "cold_transfer","trigger_source": "12025550000","role": "agent","to":"12025551111"}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
node_id = '<node_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)

trigger_source = '2025550000'
to = '2025551111'

response = phlo.multi_party_call(node_id).cold_transfer(trigger_source, to)
print str(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import com.plivo.api.Plivo;
import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.node.MultiPartyCall;
import com.plivo.api.models.node.MultiPartyCallActionType;
import com.plivo.api.models.node.MultiPartyCallUpdateResponse;
import com.plivo.api.models.phlo.Phlo;
import java.io.IOException;

public class Example
{
    privatestatic final  String authId = "<auth_id>";
    private static final String authToken = "<auth_token>";
    private static PlivoClient client = new PlivoClient(authId, authToken);
    public static void main(String[] args) throws IOException, PlivoRestException
    {
        String phloId = "<phlo_id>";
        String nodeId = "<node_id>";
        String triggerSource = "12025550000";
        String to = "12025551111";
        String memberId = to;
        String role = "agent";
        Plivo.init(authId, authToken);
        Phlo phlo = Phlo.getter(phloId).client(client).get();

        MultiPartyCall mpc = MultiPartyCall.getter(phloId, nodeId).get();

        MultiPartyCallUpdateResponse response = MultiPartyCall.updater(phloId, nodeId).triggerSource(triggerSource).to(to).role(role).cold_transfer().update();
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main

import (
	"fmt"
	"plivo-go"
)

// Initialize the following params with corresponding values to trigger resources

const authId  = "<auth_id>"
const authToken = "<auth_token>"
const phloId = "phlo_id"
const nodeId = "node_id"
const actionTo = "to_endpoint"
const actionSource = "from_endpoint"

//Use the following multiparty call actions as needed; do not edit the following

const actionRole = "agent"
const actionCall = "call"
const actionWarmTransfer = "warm_tranfer"
const actionColdTransfer = "cold_transfer"

func main() {
	testMultiPartyCallColdTransfer()
}

func testMultiPartyCallColdTransfer() {
	phloClient,err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}

	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	MPCGet, err := phloGet.MultiPartyCall(nodeId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	callPayload := plivo.PhloMultiPartyCallActionPayload{
		actionColdTransfer,
		actionTo,
		actionRole,
		actionSource,
	}

	response, err := MPCGet.ColdTransfer(callPayload)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	fmt.Printf("Response: %#v\n", response)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
/**
 * Example for Multiparty cold transfer
 */
require 'vendor/autoload.php';
use Plivo\Resources\PHLO\PhloRestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new PhloRestClient("<auth_id>", "<auth_token>");
$phlo = $client->phlo->get("<phlo_id>");
$multiPartyCall = $phlo->multiPartyCall()->get("<node_id>");
try {
    $response = $multiPartyCall->cold_transfer($trigger_source, $to, $role);
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var plivo = require('../dist/rest/client.js');
var PhloClient = plivo.PhloClient;

var authId = 'auth-id';
var authToken = 'auth-token';
var phloId = 'PHLO_ID';
var mpcId = 'Multiparty_call_NodeID';
var phloClient = phlo = null;
var mpcSourceNo = 'member_id'; //Trigger source address
var mpcTargetNo = 'target_id'; //Trigger target address
var role = 'agent';

// Cold Transfer - multi party call
phloClient = new PhloClient(authId, authToken);
phloClient.phlo(phloId).multiPartyCall(mpcId).coldTransfer(mpcSourceNo, mpcTargetNo, role).then(function (result) {
    console.log('Cold transfer result', result);
}).catch(function (err) {
    console.log('Cold transfer failed', err);
});

Hangup

You can use the hangup trigger to disconnect yourself, the customer, or any other agent from the call.

SDK method and usage

1
2
3
4
5
6
7
curl --request POST \
  --user AUTH_ID:AUTH_TOKEN \
  --url 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}/members/{MemberAddress}' \
  --header 'Content-Type: application/json' \
  --data '{"action":"hangup"}'

  #Member Address- Phone number of the agent or customer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
node_id = '<node_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)

agent1_address = '2025551111'
agent2_address = '2025552222'
customer_address = '2025553333'

#Agent 1:

response = phlo.multi_party_call(node_id).member(agent1_address).hangup()

#Agent 2:

response = phlo.multi_party_call(node_id).member(agent2_address).hangup()

#Customer:

response = phlo.multi_party_call(node_id).member(customer_address).hangup()

print str(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import com.plivo.api.Plivo;
import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.node.MultiPartyCall;
import com.plivo.api.models.node.MultiPartyCallActionType;
import com.plivo.api.models.node.MultiPartyCallUpdateResponse;
import com.plivo.api.models.phlo.Phlo;
import java.io.IOException;

public class Example
{
    privatestatic final  String authId = "<auth_id>";
    private static final String authToken = "<auth_token>";
    private static PlivoClient client = new PlivoClient(authId, authToken);
    public static void main(String[] args) throws IOException, PlivoRestException
    {
        String phloId = "<phlo_id>";
        String nodeId = "<node_id>";
        String to = "12025551111";
        String memberId = to;
        Plivo.init(authId, authToken);
        Phlo phlo = Phlo.getter(phloId).client(client).get();

        MultiPartyCall mpc = MultiPartyCall.getter(phloId, nodeId).get();

        MultiPartyCallUpdateResponse response = MultiPartyCall.updater(phloId, nodeId).member(memberId).hangup().update();
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main

import (
	"fmt"
	"plivo-go"
)

// Initialize the following params with corresponding values to trigger resources

const authId  = "<auth_id>"
const authToken = "<auth_token>"
const phloId = "phlo_id"
const nodeId = "node_id"
const memberId  = "member_id"

func main() {
	testMultiPartyCallMemberHangUp()
}

func testMultiPartyCallMemberHangUp() {
	phloClient,err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	MPCGet, err := phloGet.MultiPartyCall(nodeId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	response, err := MPCGet.Member(memberId).HangUp()
	if (err != nil) {
		fmt.Println(err)
	}
	fmt.Printf("Response: %#v\n", response)

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
/**
 * Example for multiparty hangup
 */
require 'vendor/autoload.php';
use Plivo\Resources\PHLO\PhloRestClient;
use Plivo\Exceptions\PlivoRestException;

$client = new PhloRestClient("<auth_id>", "<auth_token>");
$phlo = $client->phlo->get("<phlo_id>");
$multiPartyCall = $phlo->multiPartyCall()->get("<node_id>");
$memberAddress = "<member_id>";
$multiPartyCallMember = $multiPartyCall->member($memberAddress);
try {
    $response = $multiPartyCallMember->hangup();
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var plivo = require('../dist/rest/client.js');
var PhloClient = plivo.PhloClient;

var authId = 'auth-id';
var authToken = 'auth-token';
var phloId = 'PHLO_ID';
var mpcId = 'Multiparty_call_NodeID';
var phloClient = phlo = null;
var mpcSourceNo = 'member_id'; //Trigger source address

// Hangup - Phlo Member
phloClient = new PhloClient(authId, authToken);
phloClient.phlo(phloId).multiPartyCall(mpcId).member(mpcSourceNo).hangup().then(function (result) {
    console.log('hangup result - ', result);
}).catch(function (err) {
    console.log('hangup failed', err);
});

Resume call after warm transfer

In a warm transfer, an agent (A1) provides the number of another agent (A2) to add to the multiparty call. The customer on the call is placed on hold. While on hold, customer hold music is played to the customer, and agents A1 and A2 are placed on the call. When agent A1 resumes the call, the customer is removed from hold and the call resumes with all of the participants.

SDK method and usage

1
2
3
4
5
6
7
curl --request POST \
  --user AUTH_ID:AUTH_TOKEN \
  --url 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}/members/{MemberAddress}' \
  --header 'Content-Type: application/json' \
  --data '{"action":"resume_call"}'

  #Member Address- Phone number of the agent or customer
1
2
3
4
5
6
7
8
9
10
11
12
13
import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
node_id = '<node_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)

member_address = '2025551111'

response = phlo.multi_party_call(node_id).member(member_address).resume_call()
print str(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import com.plivo.api.Plivo;
import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.node.MultiPartyCall;
import com.plivo.api.models.node.MultiPartyCallActionType;
import com.plivo.api.models.node.MultiPartyCallUpdateResponse;
import com.plivo.api.models.phlo.Phlo;
import java.io.IOException;

public class Example
{
    privatestatic final  String authId = "<auth_id>";
    private static final String authToken = "<auth_token>";
    private static PlivoClient client = new PlivoClient(authId, authToken);
    public static void main(String[] args) throws IOException, PlivoRestException
    {
        String phloId = "<phlo_id>";
        String nodeId = "<node_id>";
        String to = "12025551111";
        String memberId = to;
        Plivo.init(authId, authToken);
        Phlo phlo = Phlo.getter(phloId).client(client).get();

        MultiPartyCall mpc = MultiPartyCall.getter(phloId, nodeId).get();

        MultiPartyCallUpdateResponse response = MultiPartyCall.updater(phloId, nodeId).member(memberId).resume_call().update();
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main

import (
	"fmt"
	"plivo-go"
)

// Initialize the following params with corresponding values to trigger resources

const authId  = "<auth_id>"
const authToken = "<auth_token>"
const phloId = "phlo_id"
const nodeId = "node_id"
const memberId  = "member_id"

func main() {
	testMultiPartyCallMemberResume()
}

func testMultiPartyCallMemberResume() {
	phloClient,err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	MPCGet, err := phloGet.MultiPartyCall(nodeId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	response, err := MPCGet.Member(memberId).ResumeCall()
	if (err != nil) {
		fmt.Println(err)
	}
	fmt.Printf("Response: %#v\n", response)

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
 * Example for multiparty resume
 */
require 'vendor/autoload.php';
use Plivo\Resources\PHLO\PhloRestClient;
use Plivo\Exceptions\PlivoRestException;

$memberAddress = "Member_ID";

$client = new PhloRestClient("<auth_id>", "<auth_token>");
$phlo = $client->phlo->get("<phlo_id>");
$multiPartyCall = $phlo->multiPartyCall()->get("<node_id>");
$multiPartyCallMember = $multiPartyCall->member($memberAddress);
try {
    $response = $multiPartyCallMember->resume_call();
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var plivo = require('../dist/rest/client.js');
var PhloClient = plivo.PhloClient;

var authId = 'auth-id';
var authToken = 'auth-token';
var phloId = 'PHLO_ID';
var mpcId = 'Multiparty_call_NodeID';
var phloClient = phlo = null;
var mpcSourceNo = 'member_id'; //Trigger source address

// Resume Call - Phlo Member
phloClient = new PhloClient(authId, authToken);
phloClient.phlo(phloId).multiPartyCall(mpcId).member(mpcSourceNo).resumeCall().then(function (result) {
    console.log('resume call result', result);
}).catch(function (err) {
    console.log('resume call failed', err);
});

Abort transfer

In a warm transfer, you can cancel the transfer by placing the agent back into the call with the customer.

SDK method and usage

1
2
3
4
5
6
7
curl --request POST \
  --user AUTH_ID:AUTH_TOKEN \
  --url 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}/members/{MemberAddress}' \
  --header 'Content-Type: application/json' \
  --data '{"action":"abort_transfer"}'

  #Member Address- Phone number of the agent or customer
1
2
3
4
5
6
7
8
9
10
11
12
13
import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
node_id = '<node_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)

member_address = '2025551111'

response = phlo.multi_party_call(node_id).member(member_address).abort_transfer()
print str(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import com.plivo.api.Plivo;
import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.node.MultiPartyCall;
import com.plivo.api.models.node.MultiPartyCallActionType;
import com.plivo.api.models.node.MultiPartyCallUpdateResponse;
import com.plivo.api.models.phlo.Phlo;
import java.io.IOException;

public class Example
{
    privatestatic final  String authId = "<auth_id>";
    private static final String authToken = "<auth_token>";
    private static PlivoClient client = new PlivoClient(authId, authToken);
    public static void main(String[] args) throws IOException, PlivoRestException
    {
        String phloId = "<phlo_id>";
        String nodeId = "<node_id>";
        String to = "12025551111";
        String memberId = to;
        Plivo.init(authId, authToken);
        Phlo phlo = Phlo.getter(phloId).client(client).get();

        MultiPartyCall mpc = MultiPartyCall.getter(phloId, nodeId).get();

        MultiPartyCallUpdateResponse response = MultiPartyCall.updater(phloId, nodeId).member(memberId).abort_transfer().update();
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main

import (
	"fmt"
	"plivo-go"
)

// Initialize the following params with corresponding values to trigger resources

const authId  = "<auth_id>"
const authToken = "<auth_token>"
const phloId = "phlo_id"
const nodeId = "node_id"
const memberId  = "member_id"

func main() {
	testMultiPartyCallAbortTransfer()
}

func testMultiPartyCallAbortTransfer() {
	phloClient,err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	MPCGet, err := phloGet.MultiPartyCall(nodeId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	response, err := MPCGet.Member(memberId).AbortTransfer()
	if (err != nil) {
		fmt.Println(err)
	}
	fmt.Printf("Response: %#v\n", response)

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
 * Example for Multiparty abort transfer
 */
require 'vendor/autoload.php';
use Plivo\Resources\PHLO\PhloRestClient;
use Plivo\Exceptions\PlivoRestException;

$memberAddress = "Member_ID";

$client = new PhloRestClient("<auth_id>", "<auth_token>");
$phlo = $client->phlo->get("<phlo_id>");
$multiPartyCall = $phlo->multiPartyCall()->get("<node_id>");
$multiPartyCallMember = $multiPartyCall->member($memberAddress);
try {
    $response = $multiPartyCallMember->abort_transfer();
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var plivo = require('../dist/rest/client.js');
var PhloClient = plivo.PhloClient;

var authId = 'auth-id';
var authToken = 'auth-token';
var phloId = 'PHLO_ID';
var mpcId = 'Multiparty_call_NodeID';
var phloClient = phlo = null;
var mpcSourceNo = 'member_id'; //Trigger source address
var mpcTargetNo = 'target_id'; //Trigger target address
var role = 'agent';

// Abort Transfer - multi party call
phloClient = new PhloClient(authId, authToken);
phloClient.phlo(phloId).multiPartyCall(mpcId).abortTransfer(mpcSourceNo).then(function (result) {
    console.log('abort transfer result', result);
}).catch(function (err) {
    console.log('abort transfer failed', err);
});

Voicemail drop

You can use the voicemail drop trigger to play a message when the call is answered by an answering machine (voicemail).

SDK method and usage

1
2
3
4
5
6
7
curl --request POST \
  --user AUTH_ID:AUTH_TOKEN \
  --url 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}/members/{MemberAddress}' \
  --header 'Content-Type: application/json' \
  --data '{"action":"voicemail_drop"}'

  #Member Address- Phone number of the agent or customer
1
2
3
4
5
6
7
8
9
10
11
12
13
import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
node_id = '<node_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)

member_address = '2025551111'

response = phlo.multi_party_call(node_id).member(member_address).voicemail_drop()
print str(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import com.plivo.api.Plivo;
import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.node.MultiPartyCall;
import com.plivo.api.models.node.MultiPartyCallActionType;
import com.plivo.api.models.node.MultiPartyCallUpdateResponse;
import com.plivo.api.models.phlo.Phlo;
import java.io.IOException;

public class Example
{
    privatestatic final  String authId = "<auth_id>";
    private static final String authToken = "<auth_token>";
    private static PlivoClient client = new PlivoClient(authId, authToken);
    public static void main(String[] args) throws IOException, PlivoRestException
    {
        String phloId = "<phlo_id>";
        String nodeId = "<node_id>";
        String to = "12025551111";
        String memberId = to;
        Plivo.init(authId, authToken);
        Phlo phlo = Phlo.getter(phloId).client(client).get();

        MultiPartyCall mpc = MultiPartyCall.getter(phloId, nodeId).get();

        MultiPartyCallUpdateResponse response = MultiPartyCall.updater(phloId, nodeId).member(memberId).voicemail_drop().update();
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main

import (
	"fmt"
	"plivo-go"
)

// Initialize the following params with corresponding values to trigger resources

const authId  = "<auth_id>"
const authToken = "<auth_token>"
const phloId = "phlo_id"
const nodeId = "node_id"
const memberId  = "member_id"

func main() {
	testMultiPartyCallMemberVoiceMailDrop()
}

func testMultiPartyCallMemberVoiceMailDrop() {
	phloClient,err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	MPCGet, err := phloGet.MultiPartyCall(nodeId)
	if err != nil {
			fmt.Print("Error", err.Error())
			return
		}
	response, err := MPCGet.Member(memberId).VoiceMailDrop()
	if (err != nil) {
		fmt.Println(err)
	}
	fmt.Printf("Response: %#v\n", response)

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
/**
 * Example for multiparty voicemail drop
 */
require 'vendor/autoload.php';
use Plivo\Resources\PHLO\PhloRestClient;
use Plivo\Exceptions\PlivoRestException;

$client = new PhloRestClient("<auth_id>", "<auth_token>");
$phlo = $client->phlo->get("<phlo_id>");
$multiPartyCall = $phlo->multiPartyCall()->get("<node_id>");
$memberAddress = "<member_id>";
$multiPartyCallMember = $multiPartyCall->member($memberAddress);
try {
    $response = $multiPartyCallMember->voicemail_drop();
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var plivo = require('../dist/rest/client.js');
var PhloClient = plivo.PhloClient;

var authId = 'auth-id';
var authToken = 'auth-token';
var phloId = 'PHLO_ID';
var mpcId = 'Multiparty_call_NodeID';
var phloClient = phlo = null;
var mpcSourceNo = 'member_id'; //Trigger source address

// Voice mail drop - Phlo Member
phloClient = new PhloClient(authId, authToken);
phloClient.phlo(phloId).multiPartyCall(mpcId).member(mpcSourceNo).voicemailDrop().then(function (result) {
    console.log('voicemail Drop call result -', result);
}).catch(function (err) {
    console.log('voicemail Drop call failed', err);
});

Read about how to install the Plivo server SDKs and set up your development environment.

You can get your Auth ID and Auth Token from the overview page of the Plivo console.

AuthID

You can find the PHLO_ID on the PHLO Listing page.

PHLO Listing

You can get the node ID of the relevant multiparty call node from a page like this:

Node ID

Conference Bridge

The Conference Bridge component allows multiple parties to dial in to a single call.

Configuration parameters:

  • Conference ID
  • Announcement message
  • Hold music
  • Settings
  • Events

Options:

  • Conference_name (required) Name of the conference bridge
  • Announcement Message to be played when a dialer is added into the conference. Speak Text and Play Audio are the types of messages. In a Speak Text message, you can configure the message to speak, language, and voice. In a Play Audio message, you can specify a URL to an audio file or upload an audio file.
  • Waiting callers You can play music to users waiting for a conference to start. You can specify a URL to an audio file or upload an audio file to be played until the moderator joins the conference.
  • Miscellaneous You can play a beep or double beep to all callers in the conference when a new caller is added to or removed from the conference. Callers can be muted when joining a conference.
  • Record Audio This option is used to decide how the calls are recorded. Calls can be recorded dynamically by passing these values:
Recording = TrueRecording = False
Any integer

0

TrueCase insensitiveFalseCase insensitive
Object, String

Empty

 

Null

States:

The Conference Bridge component is set to Completed state when there are no callers on the conference bridge. It’s set to Failed state when an error occurs.

Variables:

  • from Phone number or SIP endpoint from which the call is made
  • direction Direction of the call can be set to outbound or inbound
  • caller_name Name of the caller. Defaults to the from phone number or SIP endpoint
  • to Phone number or SIP endpoint to which the call is made
  • event Latest triggered event in the component. Can take the values ConferenceEnter, ConferenceExit, or Redirect.
  • bill_rate Unit rate applicable for the call
  • call_status Status of the call — set to in-progress
  • conference_name Name of the conference bridge
  • call_uuid UUID of the incoming call
  • conference_uuid UUID of the conference
  • member_id ID of a member in a conference. A unique ID is assigned to each member in a conference.
  • to_iso2 ISO alpha-2 code of the country to which the to phone number belongs
  • from_iso2 ISO alpha-2 code of the country to which the from phone number belongs
  • to_country Country to which the to phone number belongs
  • from_country Country to which the from phone number belongs

HTTP Request

The HTTP Request component makes requests to APIs. Optionally, the data returned by the API can be used in the child nodes connected to it.

Options:

  • Request Request URL and HTTP method are mandatory. HTTP methods supported are GET, POST, PUT, and DELETE.

Headers, Auth, Params, and Body are key-value pairs, with an option to bulk edit. Bulk edits must be specified in JSON format.

You can configure authorization mechanisms in the Auth tab. We support three kinds of authorization:

  • Basic Auth (username an
  • Bearer Token (JWT/OAuth)
  • OAuth2

Parameters are added in a query string in the request URL. For example, Params {“key1”:”value1”, “key2”:”value2”} are added to the request URL as https://example.com/path/to/resource?key1=value1&key2=value2

Body is applicable only for POST, PUT, and DELETE methods. The content types form-data, x-www-form-urlencoded, and application/json are supported body types.

  • Response When you click on Fetch Response, Plivo makes an API request to fetch the response and the content type and stores the response. When response_type is application/JSON, the keys in the response are available to configure in the child nodes.

States:

The HTTP Request component is set to Success state when an HTTP response code between 200 and 300 is returned. Otherwise, the state is set to Failed.

Variables:

  • content_type Content type of the response from the API. For application/jsoncontent, the data/keys in the response are available to configure in the child nodes.

  • status_code HTTP status code returned by the API. It’s set to 400 when the content_type doesn’t match the response type, or when all keys in response format (for an application/JSON content) are not present in the response.

  • response Response returned by the API. For application/JSON content, the data/keys in the response are available to configure in the child nodes.

Counter

Use the Counter component to branch the flow based on the number of executions. The counter increments with every encounter of the counter node.

Options:

  • Max Count (required) Maximum number of the times the counter can be executed.

States:

The Counter component is set to Count Reached state when the component is executed Max Count number of times. Otherwise, it’s set to Count Not Reached state.

Branch

Branch splits a workflow by comparing a variable with different values. Based on the conditions, the execution branches into different workflows.

Configuration parameters:

  • Variable to compare
  • Condition

Options:

  • lhs (required) The variable based on which the PHLO should branch
  • conditions A list of different conditions to apply on the lhs
  • alias (required) Alias for the condition
  • operation (required) Operation to be performed on the lhs and rhs
  • rhs (required) Value to compare the lhs with

States:

For each condition configured, a state with the condition’s alias is added to the node. Based on the condition that’s met, the component is set to the corresponding state. The No Match state is available by default, and is set when none of the conditions are met.