Latest Legacy

The MultiPartyCall element Beta

The MultiPartyCall element can add a participant to an ongoing multiparty call (MPC) or start a new multiparty call and to add a participant to it.

Note: Some of this element’s attributes apply at the MPC level, some at the participant level. For example, maxDuration and maxParticipants set the MPC’s maximum duration and maximum allowed participants, while role and coachMode update a specific participant.

Attributes

maxDurationMPC levelinteger

Sets the Max Duration (in seconds) property of the MPC resource. The MPC will end after this period.

maxDuration is counted from the call initiation time.

Allowed values: 300 (five minutes) to 28,800 (eight hours)
Defaults to 14,400 (four hours).

maxParticipantsMPC levelinteger

Sets the Max Participants property of the MPC resource.

Allowed values: 2 to 10
Defaults to 10.

waitMusicUrlMPC levelstring

The URL of an audio file to be played in a loop to participants waiting for the MPC to begin.

The URL must return an XML document with Play, Speak, and/or Wait elements only. All other elements are ignored.

Defaults to Plivo’s default wait music.

Note: If the URL is not reachable or does not return a valid XML document, no music will be played.

waitMusicMethodMPC levelstring

The HTTP verb used to invoke the URL configured as waitMusicUrl.

Allowed values: GET, POST
Defaults to GET.

agentHoldMusicUrlMPC levelstring

The URL of an audio file to be played to agents while they’re on hold. Sets the Agent Hold Music URL property of the MPC resource.

The URL must return an XML document with Play, Speak, and/or Wait elements only. All other elements are ignored.

Defaults to Plivo’s default hold music.

Note: If the URL is not reachable or does not return a valid XML document, no music will be played.

agentHoldMusicMethodMPC levelstring

The HTTP verb used to invoke the URL configured as agentHoldMusicUrl.

Allowed values: GET, POST
Defaults to GET.

customerHoldMusicUrlMPC levelstring

The URL of an audio file to be played to customers while they’re on hold. Sets the Customer Hold Music URL property of the MPC resource.

The URL must return an XML document with Play, Speak, and/or Wait elements only. All other elements are ignored.

Default is Plivo’s default hold music.

Note: If the URL is not reachable or does not return a valid XML document, no music will be played.

customerHoldMusicMethodMPC levelstring

The HTTP verb that should be used to invoke the URL configured as customerHoldMusicUrl.

Allowed values: GET, POST
Defaults to GET.

recordMPC levelboolean

Indicates whether the MPC should be recorded. Recording is initiated the first time a participant joins the MPC with record set to true.

Another participant joining with record set to false will not stop the recording.

Note: Supervisor’s voice will be present in the recording regardless of whether coach mode is on or off.

Defaults to false.

recordFileFormatMPC levelstring

Specifies the audio format for the recording.

Allowed values: mp3, wav
Defaults to mp3.

recordingCallbackUrlMPC levelstring

The URL to which MPC recording events are posted.

recordingCallbackMethodMPC levelstring

The HTTP verb that should be used to invoke the URL configured as recordingCallbackUrl.

Allowed values: GET, POST
Defaults to POST.

recordMinMemberCountMPC levelstring

Starts MPC recording when count is reached. Applies only when `record` is set to true in the MultiPartyCall element.

Allowed values: 1, 2
Defaults to 1.

When set to 1, recording will start as soon as one member has entered the MPC.

When set to 2, recording will start only when two members have joined the MPC. Recording will not start for a single member in MPC even if `record` is set to true in the MultiPartyCall element.

recordParticipantTrackBoolean

Indicates whether single-track or participant-level recording will be initiated when the participant joins the MPC bridge.

Default: false

statusCallbackUrlMPC levelstring

The URL to which MPC status change events are sent.

statusCallbackMethodMPC levelstring

The HTTP verb that should be used to invoke the URL configured as statusCallbackUrl.

Allowed values: GET, POST
Defaults to POST.

statusCallbackEventsMPC levelstring

This attribute controls which of these events, generated over the course of the multiparty call, should be pushed to the specified status_callback_url:

  • MPCInitialized
  • MPCStart
  • MPCEnd
  • ParticipantJoin
  • ParticipantExit
  • ParticipantMute
  • ParticipantUnmute
  • ParticipantHold
  • ParticipantUnhold
  • ParticipantSpeakStart
  • ParticipantSpeakStop
  • ParticipantCoachModeStart
  • ParticipantCoachModeStop
  • ParticipantDigitInput
  • AddParticipantByAPIActionInitiated
  • AddParticipantByAPIActionCompleted

Allowed values: mpc-state-changes, participant-state-changes, participant-digit-input-events, participant-speak-events, add-participant-api-events (in any order, separated by commas)

Note:
  • When mpc-state-changes is included, events for MPCInitialized, MPCStart, and MPCEnd are sent.
  • When participant-state-changes is included, events for ParticipantJoin, ParticipantExit, ParticipantMute,ParticipantUnmute, ParticipantHold, ParticipantUnhold, ParticipantCoachModeStart, ParticipantCoachModeStop are sent.
  • When participant-speak-events is included, events for ParticipantSpeakStart and ParticipantSpeakStop are sent whenever any participant begins or stops speaking.
  • When participant-digit-input-events is included, ParticipantDigitInput events are sent whenever any participant provides a DTMF input.
  • When add-participant-api-events is included, AddParticipantByAPIActionInitiated and AddParticipantByAPIActionCompleted events are sent when an Add Participant By API Action is carried out.

Defaults to mpc-state-changes,participant-state-changes.

stayAloneParticipant levelboolean

Indicates whether a participant should be removed from the call if they’re the only member remaining in the call.

Allowed values: true, false
Defaults to false.

roleParticipant levelstring

Must be one of Agent, Supervisor, or Customer.

coachModeParticipant levelboolean

Only applies to participants with the role Supervisor.

Defaults to true (by default, supervisors are in coach mode).

muteParticipant levelboolean

Indicates whether the participant should join muted.

Allowed values: true, false
Defaults to false.

holdParticipant levelboolean

Indicates whether the participant should join on hold or not.

Allowed values: true, false
Defaults to false.

startMpcOnEnterParticipant levelboolean

Indicates whether the MPC should start, if not already started, when this participant joins the call.

Allowed values: true, false
Defaults to true.

endMpcOnExitParticipant levelboolean

Indicates whether the MPC should be ended when this participant exits the call.

Allowed values: true, false
Defaults to false.

enterSoundParticipant levelstring

The sound to play on the bridge when the participant enters the MPC. Note that enterSound should never be played for supervisors entering when coach mode is set to true.

Allowed values: none, beep:1, beep:2, URL that returns an XML document with Play, Speak, and/or Wait elements only
Defaults to beep:1.

enterSoundMethodParticipant levelstring

The HTTP verb that should be used to invoke the URL configured as enterSound.

Allowed values: GET, POST
Defaults to GET.

exitSoundParticipant levelstring

The sound to play when the participant exits the MPC.

This sound should be played even if the call is hung up while in an MPC.

The exit sound should never be played for supervisors entering with coach mode set to true.

Allowed values: none, beep:1, beep:2, URL that returns an XML document with Play, Speak, and/or Wait elements only
Defaults to beep:2.

exitSoundMethodParticipant levelstring

The HTTP verb that should be used to invoke the URL configured as exitSound.

Allowed values: GET, POST
Defaults to GET.

onExitActionUrlParticipant levelstring

Action URL invoked when this participant exits the MPC. If the participant call hangs up while in the MPC or if the call is transferred to another XML document, then a request to this URL will not be invoked.

If onExitActionUrl is provided, an XML document to control the flow of the call from here on is expected in the response.

onExitActionMethodParticipant levelstring

The HTTP verb that should be used to invoke the URL configured as onExitActionUrl.

Allowed values: GET, POST
Defaults to POST.

relayDTMFInputsParticipant levelboolean

Indicates whether DTMF inputs pressed by one of the participants should be transmitted to other participants on the MPC.

Allowed values: true, false
Defaults to false.

List of events and parameters sent to the statusCallbackUrl

This information is sent to statusCallbackUrl when an event is triggered:

DigitInputstring A list of digits pressed by the participant.
EventNamestring Event that triggered this notification. This parameter will have values from the above events list.
EventTimestampstring Timestamp at which the event occurred. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
MPCBilledAmountstring Amount charged for this call, in USD. This value is null if the MPC has not ended.
MPCBilledDurationstring Duration in seconds for which the MPC was billed. This value is null if the MPC has not ended.
MPCCreationTimestring Timestamp at which the MPC was created. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
MPCDurationstring Total duration in seconds of the MPC. This value is null if the MPC has not ended.
MPCEndTimestring Timestamp at which the MPC ended. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
MPCNamestring Friendly name provided during the creation of the MPC.
MPCStartTimestring Timestamp at which the MPC was started. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
MPCTerminationCausestring Reason for MPC termination. Refer to our list of termination causes and sources. This value is null if the MPC has not ended.
MPCTerminationCauseCodestring A unique integer code for the termination cause. Refer to our list of hangup causes and sources. This value is null if the MPC has not ended.
MPCUUIDstring Unique ID of the multiparty call.
MemberAddressstring Phone number or endpoint username of the participant added to the MPC.
MemberIDstring Unique identifier of the participant whose event triggered this callback in the MPC.
ParticipantCallDirectionstring Indicates the direction of the call (inbound or outbound) through which the participant was added to the MPC.
ParticipantCallFromstring Phone number or the endpoint username of the participant that added the respective participant to MPC.
ParticipantCallTostring Phone number or the endpoint username of the participant added to the MPC.
ParticipantCallUUIDstring Call UUID of the participant’s call leg.
ParticipantCoachModestring

Indicates whether the participant is in coach mode.

Allowed values: true, false

ParticipantExitCausestring Cause of the participant’s termination from the MPC.
ParticipantExitTimestring Timestamp at which the participant was terminated from the MPC. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
ParticipantJoinTimestring Timestamp at which the participant was added to the MPC. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
ParticipantRolestring

Identifies the role of the participant in the MPC.

Allowed values: Agent, Supervisor, Customer

SequenceNumberstring Indicates the sequence of the callback. Helpful to sort the callback events posted to the status_callback_url.
STIRVerification string

For outbound calls: Gives details about the attestation assigned to the call by Plivo

For inbound calls: Gives details about the attestation received on the inbound call to your Plivo phone number.

Possible values:

  • Verified means the call is from a verified caller who has authorized access to the customer’s caller ID, and hence should be treated with confidence. Verified is equivalent to attestation level A.
  • Not Verified means that, for this call, either the caller is not verified, or it’s uncertain whether they have access to the caller ID used, or both. Not Verified means the call received attestation level B or C.
  • Not Applicable means STIR/SHAKEN doesn’t apply to this call, as would be the case if a call is not addressed to a US number or if it’s a cloud call (WebRTC or SIP).

Read more about STIR/SHAKEN here.

List of events and parameters sent to the recordingCallbackUrl

These events are generated:

  • MPCRecordingInitiated
  • MPCRecordingPaused
  • MPCRecordingResumed
  • MPCRecordingCompleted
  • MPCRecordingFailed

This information is sent to the URL when an event is triggered:

EventNamestringEvent that triggered this notification. This parameter will have one of the values from the list of events above.
EventTimestampstringTimestamp at which the event occurred.

Format: YYYY-MM-DD HH:mm:ss+|-hh:mm

MPCNamestringFriendly name provided during the creation of the MPC.
MPCUUIDstringUnique ID of the multiparty call.
RecordingDurationstringDuration of recording in seconds.
RecordingEndTimestringTimestamp at which the recording ended. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
RecordingFormatstring

Format of the recording.

Allowed values: mp3, wav

RecordingResourceURLstringResource URL of the recording file. You can use this URL to fetch recording details later.
RecordingStartTimestringTimestamp at which the recording started. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
RecordingURLstringComplete path to the recording file URL.
RecordingUUIDstringUnique identifier to identify the recording file.
SequenceNumberstringIndicates the sequence of the callback. Helpful to sort the callback events posted to the recording_callback_url.

Parameters sent to the onExitActionUrl

MPCUUIDUnique ID of the multiparty call.
MPCFriendlyNameFriendly name provided during the creation of the MPC.
MemberIDUnique identifier to identify each participant in the MPC.
ParticipantCallUUIDCall UUID of the participant’s call leg.
ParticipantJoinTimeTimestamp at which the participant was added to the MPC. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
ParticipantEndTimeTimestamp at which the participant was terminated from the MPC. Format: YYYY-MM-DD HH:mm:ss+|-hh:mm
ParticipantRole

Identifies the role of the participant in the MPC.

Allowed values: Agent, Supervisor, Customer

The first caller to execute this XML initializes and starts the multiparty call named My MPC. The next caller to execute this XML joins the same MPC.

Response

<Response>
   <MultiPartyCall role="customer" maxDuration="10000" maxParticipants="10" waitMusicMethod="GET" agentHoldMusicMethod="GET" customerHoldMusicMethod="GET" record="false" recordFileFormat="mp3" recordingCallbackMethod="GET" statusCallbackEvents="mpc-state-changes,participant-state-changes" statusCallbackMethod="POST" stayAlone="false" coachMode="true" mute="false" hold="false" startMpcOnEnter="true" endMpcOnExit="false" enterSound="beep:1" enterSoundMethod="GET" exitSound="beep:2" exitSoundMethod="GET" onExitActionMethod="POST" relayDTMFInputs="false">mpc_name</MultiPartyCall>
</Response>

Example Request

1
2
3
4
5
6
7
8
9
10
from plivo import plivoxml

response = plivoxml.ResponseElement()
response.add(
    plivoxml.MultiPartyCallElement(
        content="mpc_name", role="customer", max_duration=10000
    )
)

print(response.to_string())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'rubygems'
require 'plivo'
include Plivo::XML
include Plivo::Exceptions

begin
  response = Response.new
  response.addMultiPartyCall(
          'mpc_name',
          role: 'Agent',
          maxDuration: 10000)
  xml = PlivoXML.new(response)
  puts xml.to_xml
rescue PlivoXMLError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
var plivo = require('plivo');

var response = plivo.Response();

response.addMultiPartyCall('mpc_name', {
    role: 'customer',
    maxDuration: 10000
});

console.log(response.toXML());
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
require 'vendor/autoload.php';

use Plivo\Exceptions\PlivoXMLException;
use Plivo\Util\MPCUtils;
use Plivo\XML\Response;

$response = new Response();

$response->addMultiPartyCall("mpc_name", ["role" => "Customer", "maxDuration" => 10000]);

Header('Content-type: text/xml');
echo ($response->toXML());
1
2
3
4
5
6
7
8
9
10
11
12
13
import com.plivo.api.exceptions.PlivoValidationException;
import com.plivo.api.exceptions.PlivoXmlException;
import com.plivo.api.models.multipartycall.MultiPartyCallUtils;
import com.plivo.api.xml.MultiPartyCall;
import com.plivo.api.xml.Response;

public class Test {
    public static void main(String[] args) throws PlivoValidationException, PlivoXmlException {
        Response resp = new Response();
        resp.children(new MultiPartyCall("mpc_name", MultiPartyCallUtils.customer).maxDuration(10000));
        System.out.println(resp.toXmlString());
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using Plivo.Exception;
using System.Collections.Generic;

namespace PlivoExamples {
  class Program {
    static void Main(string[] args) {
      try {
        Plivo.XML.Response resp = new Plivo.XML.Response();
        resp.AddMultiPartyCall("mpc_name",
          new Dictionary < string, string > () {
            {"role","customer"},
            {"maxDuration","10000"}
          });
        Console.WriteLine(resp.ToString());
      } catch (PlivoRestException e) {
        Console.WriteLine("Exception: " + e.Message);
      }

    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package main

import "github.com/plivo/plivo-go/v7/xml"

func main() {
    response: = xml.ResponseElement {
        Contents: [] interface {} {

            new(xml.MultiPartyCallElement).
            SetRole("customer").
            SetMaxDuration(10000).
            SetContents("mpc_name"),
        },
    }
    print(response.String())
}