API Endpoint
POST
https://phlorunner.plivo.com/v1/phlo/{phlo_id}/multi_party_call/{node_id}
Arguments
URL Params
| Param | Type | Description/Allowed Values |
|---|---|---|
phlo_id (Required) | string | Unique identifier of the PHLO. PHLO IDs are listed on the PHLO page of the console. |
node_id (Required) | string | Unique identifier of the multiparty call. The ID is available in the configuration section of the corresponding multiparty call node in the PHLO. |
Payload
| Param | Description/Allowed Values |
|---|---|
action (Required) | Value is always cold_transfer. |
to (Required) | Phone number or SIP endpoint address of the user to which the call is to be transferred. |
role (Required) | Role of the user added to the multiparty call. Allowed values: customer, agentDefaults to agent. |
trigger_source (Required) | Phone number or SIP endpoint address of the user (agent) initiating the transfer. |
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 = '<from_endpoint>'
to = '<to_endpoint>'
response = phlo.multi_party_call(node_id).cold_transfer(trigger_source, to)
print str(response)
require 'rubygems'
require 'plivo'
include Plivo
AUTH_ID = '<auth_id>'
AUTH_TOKEN = '<auth_token>'
client = Phlo.new(AUTH_ID, AUTH_TOKEN)
# if credentials are stored in the PLIVO_AUTH_ID and the PLIVO_AUTH_TOKEN environment variables
# then initialize client as:
# client = Phlo.new
# provide the phlo_id in params
phlo = client.phlo.get('<phlo_id>')
multi_party_call = phlo.multi_party_call('<node_id>')
# multi_party_call.cold_transfer(<trigger_source>, <to>)
begin
response = multi_party_call.cold_transfer('<from_endpoint>', '<to_endpoint>')
puts response
rescue PlivoRESTError => e
puts 'Exception: ' + e.message
end
var plivo = require('plivo');
var PhloClient = plivo.PhloClient;
var authId = '<auth_id>';
var authToken = '<auth_token>';
var phloId = '<phlo_id>';
var mpcId = '<node_id>';
var phloClient = phlo = null;
var mpcSourceNo = '<member_id>'; //Trigger source address
var mpcTargetNo = '<target_id>'; //Trigger target address
var role = 'agent';
// Cold Transfer - multiparty 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);
});
<?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);
}
?>
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 = "<from_endpoint>";
String to = "<to_endpoint>";
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();
}
}
using System;
using Plivo;
namespace test_PHLO_dotnet
{
class Program
{
public static void Main(string[] args)
{
var phloClient = new PhloApi("<auth_id>", "<auth_token>");
var phloID = "<phlo_id>";
var nodeID = "<node_id>";
var phlo = phloClient.Phlo.Get(phloID);
var multiPartyCallObj = phlo.MultiPartyCall("nodeID");
var triggerSource = "<from_endpoint>";
var to = "<to_endpoint>";
var role = "agent";
Console.WriteLine(multiPartyCallObj.ColdTransfer(triggerSource, to));
}
}
}
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)
}
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": "<from_endpoint>","role": "agent","to":"<to_endpoint>"}'
Response
HTTP Status Code: 201
{
"api_id": "8c77b816-d621-4028-afc8-1aeab1d497a8",
"error": ""
}