<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
Telnyx Voice Conferencing - Java
Installation
text
// See https://github.com/team-telnyx/telnyx-java for Maven/Gradle setup
Setup
java
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
All examples below assume
is already initialized as shown above.
Enqueue call
Put the call in a queue.
POST /calls/{call_control_id}/actions/enqueue
— Required:
Optional:
(string),
(string),
(boolean),
(integer),
(integer)
java
import com.telnyx.sdk.models.calls.actions.ActionEnqueueParams;
import com.telnyx.sdk.models.calls.actions.ActionEnqueueResponse;
ActionEnqueueParams params = ActionEnqueueParams.builder()
.callControlId("call_control_id")
.queueName("support")
.build();
ActionEnqueueResponse response = client.calls().actions().enqueue(params);
Remove call from a queue
Removes the call from a queue.
POST /calls/{call_control_id}/actions/leave_queue
Optional:
(string),
(string)
java
import com.telnyx.sdk.models.calls.actions.ActionLeaveQueueParams;
import com.telnyx.sdk.models.calls.actions.ActionLeaveQueueResponse;
ActionLeaveQueueResponse response = client.calls().actions().leaveQueue("call_control_id");
List conferences
Lists conferences.
java
import com.telnyx.sdk.models.conferences.ConferenceListPage;
import com.telnyx.sdk.models.conferences.ConferenceListParams;
ConferenceListPage page = client.conferences().list();
Create conference
Create a conference from an existing call leg using a
and a conference name.
Optional:
(enum),
(string),
(boolean),
(string),
(integer),
(string),
(string),
(integer),
(enum),
start_conference_on_create
(boolean)
java
import com.telnyx.sdk.models.conferences.ConferenceCreateParams;
import com.telnyx.sdk.models.conferences.ConferenceCreateResponse;
ConferenceCreateParams params = ConferenceCreateParams.builder()
.callControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
.name("Business")
.build();
ConferenceCreateResponse conference = client.conferences().create(params);
Retrieve a conference
Retrieve an existing conference
java
import com.telnyx.sdk.models.conferences.ConferenceRetrieveParams;
import com.telnyx.sdk.models.conferences.ConferenceRetrieveResponse;
ConferenceRetrieveResponse conference = client.conferences().retrieve("id");
Hold conference participants
Hold a list of participants in a conference call
POST /conferences/{id}/actions/hold
Optional:
(string),
(array[string]),
(string),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionHoldParams;
import com.telnyx.sdk.models.conferences.actions.ActionHoldResponse;
ActionHoldResponse response = client.conferences().actions().hold("id");
Join a conference
Join an existing call leg to a conference.
POST /conferences/{id}/actions/join
— Required:
Optional:
(enum),
(string),
(string),
(boolean),
(boolean),
(string),
(string),
(boolean),
(enum),
soft_end_conference_on_exit
(boolean),
start_conference_on_enter
(boolean),
(enum),
(array[string])
java
import com.telnyx.sdk.models.conferences.actions.ActionJoinParams;
import com.telnyx.sdk.models.conferences.actions.ActionJoinResponse;
ActionJoinParams params = ActionJoinParams.builder()
.id("id")
.callControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
.build();
ActionJoinResponse response = client.conferences().actions().join(params);
Leave a conference
Removes a call leg from a conference and moves it back to parked state.
POST /conferences/{id}/actions/leave
— Required:
Optional:
(enum),
(string),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionLeaveParams;
import com.telnyx.sdk.models.conferences.actions.ActionLeaveResponse;
ActionLeaveParams params = ActionLeaveParams.builder()
.id("id")
.callControlId("c46e06d7-b78f-4b13-96b6-c576af9640ff")
.build();
ActionLeaveResponse response = client.conferences().actions().leave(params);
Mute conference participants
Mute a list of participants in a conference call
POST /conferences/{id}/actions/mute
Optional:
(array[string]),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionMuteParams;
import com.telnyx.sdk.models.conferences.actions.ActionMuteResponse;
ActionMuteResponse response = client.conferences().actions().mute("id");
Play audio to conference participants
Play audio to all or some participants on a conference call.
POST /conferences/{id}/actions/play
Optional:
(string),
(array[string]),
(object),
(string),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionPlayParams;
import com.telnyx.sdk.models.conferences.actions.ActionPlayResponse;
ActionPlayResponse response = client.conferences().actions().play("id");
Conference recording pause
Pause conference recording.
POST /conferences/{id}/actions/record_pause
Optional:
(string),
(string),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionRecordPauseParams;
import com.telnyx.sdk.models.conferences.actions.ActionRecordPauseResponse;
ActionRecordPauseResponse response = client.conferences().actions().recordPause("id");
Conference recording resume
Resume conference recording.
POST /conferences/{id}/actions/record_resume
Optional:
(string),
(string),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionRecordResumeParams;
import com.telnyx.sdk.models.conferences.actions.ActionRecordResumeResponse;
ActionRecordResumeResponse response = client.conferences().actions().recordResume("id");
Conference recording start
Start recording the conference.
POST /conferences/{id}/actions/record_start
— Required:
Optional:
(string),
(string),
(boolean),
(enum),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionRecordStartParams;
import com.telnyx.sdk.models.conferences.actions.ActionRecordStartResponse;
ActionRecordStartParams params = ActionRecordStartParams.builder()
.id("id")
.format(ActionRecordStartParams.Format.WAV)
.build();
ActionRecordStartResponse response = client.conferences().actions().recordStart(params);
Conference recording stop
Stop recording the conference.
POST /conferences/{id}/actions/record_stop
Optional:
(string),
(string),
(uuid),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionRecordStopParams;
import com.telnyx.sdk.models.conferences.actions.ActionRecordStopResponse;
ActionRecordStopResponse response = client.conferences().actions().recordStop("id");
Speak text to conference participants
Convert text to speech and play it to all or some participants.
POST /conferences/{id}/actions/speak
— Required:
,
Optional:
(array[string]),
(string),
(enum),
(enum),
(enum),
(object)
java
import com.telnyx.sdk.models.conferences.actions.ActionSpeakParams;
import com.telnyx.sdk.models.conferences.actions.ActionSpeakResponse;
ActionSpeakParams params = ActionSpeakParams.builder()
.id("id")
.payload("Say this to participants")
.voice("female")
.build();
ActionSpeakResponse response = client.conferences().actions().speak(params);
Stop audio being played on the conference
Stop audio being played to all or some participants on a conference call.
POST /conferences/{id}/actions/stop
Optional:
(array[string]),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionStopParams;
import com.telnyx.sdk.models.conferences.actions.ActionStopResponse;
ActionStopResponse response = client.conferences().actions().stop("id");
Unhold conference participants
Unhold a list of participants in a conference call
POST /conferences/{id}/actions/unhold
— Required:
java
import com.telnyx.sdk.models.conferences.actions.ActionUnholdParams;
import com.telnyx.sdk.models.conferences.actions.ActionUnholdResponse;
ActionUnholdParams params = ActionUnholdParams.builder()
.id("id")
.addCallControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
.build();
ActionUnholdResponse response = client.conferences().actions().unhold(params);
Unmute conference participants
Unmute a list of participants in a conference call
POST /conferences/{id}/actions/unmute
Optional:
(array[string]),
(enum)
java
import com.telnyx.sdk.models.conferences.actions.ActionUnmuteParams;
import com.telnyx.sdk.models.conferences.actions.ActionUnmuteResponse;
ActionUnmuteResponse response = client.conferences().actions().unmute("id");
Update conference participant
Update conference participant supervisor_role
POST /conferences/{id}/actions/update
— Required:
,
Optional:
(string),
(enum),
(array[string])
java
import com.telnyx.sdk.models.conferences.actions.ActionUpdateParams;
import com.telnyx.sdk.models.conferences.actions.ActionUpdateResponse;
import com.telnyx.sdk.models.conferences.actions.UpdateConference;
ActionUpdateParams params = ActionUpdateParams.builder()
.id("id")
.updateConference(UpdateConference.builder()
.callControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
.supervisorRole(UpdateConference.SupervisorRole.WHISPER)
.build())
.build();
ActionUpdateResponse action = client.conferences().actions().update(params);
End a conference
End a conference and terminate all active participants.
POST /conferences/{id}/actions/end
java
import com.telnyx.sdk.models.conferences.actions.ActionEndConferenceParams;
import com.telnyx.sdk.models.conferences.actions.ActionEndConferenceResponse;
ActionEndConferenceResponse response = client.conferences().actions().endConference("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
Gather DTMF using audio prompt in a conference
Play an audio file to a specific conference participant and gather DTMF input.
POST /conferences/{id}/actions/gather_using_audio
— Required:
Optional:
(string),
(string),
(string),
(integer),
inter_digit_timeout_millis
(integer),
(string),
(string),
(integer),
(integer),
(string),
(integer),
(boolean),
(string),
(integer),
(string)
java
import com.telnyx.sdk.models.conferences.actions.ActionGatherDtmfAudioParams;
import com.telnyx.sdk.models.conferences.actions.ActionGatherDtmfAudioResponse;
ActionGatherDtmfAudioParams params = ActionGatherDtmfAudioParams.builder()
.id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.callControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
.build();
ActionGatherDtmfAudioResponse response = client.conferences().actions().gatherDtmfAudio(params);
Send DTMF to conference participants
Send DTMF tones to one or more conference participants.
POST /conferences/{id}/actions/send_dtmf
— Required:
Optional:
(array[string]),
(string),
(integer)
java
import com.telnyx.sdk.models.conferences.actions.ActionSendDtmfParams;
import com.telnyx.sdk.models.conferences.actions.ActionSendDtmfResponse;
ActionSendDtmfParams params = ActionSendDtmfParams.builder()
.id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.digits("1234#")
.build();
ActionSendDtmfResponse response = client.conferences().actions().sendDtmf(params);
List conference participants
Lists conference participants
GET /conferences/{conference_id}/participants
java
import com.telnyx.sdk.models.conferences.ConferenceListParticipantsPage;
import com.telnyx.sdk.models.conferences.ConferenceListParticipantsParams;
ConferenceListParticipantsPage page = client.conferences().listParticipants("conference_id");
Webhooks
The following webhook events are sent to your configured webhook URL.
All webhooks include
and
headers for verification (Standard Webhooks compatible).
| Event | Description |
|---|
| Call Enqueued |
| Call Left Queue |
| Conference Created |
| Conference Ended |
| Conference Floor Changed |
conferenceParticipantJoined
| Conference Participant Joined |
conferenceParticipantLeft
| Conference Participant Left |
conferenceParticipantPlaybackEnded
| Conference Participant Playback Ended |
conferenceParticipantPlaybackStarted
| Conference Participant Playback Started |
conferenceParticipantSpeakEnded
| Conference Participant Speak Ended |
conferenceParticipantSpeakStarted
| Conference Participant Speak Started |
| Conference Playback Ended |
conferencePlaybackStarted
| Conference Playback Started |
| Conference Recording Saved |
| Conference Speak Ended |
| Conference Speak Started |
Webhook payload fields
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
data.payload.call_control_id
| string | Call ID used to issue commands via Call Control API. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
| string | The name of the queue |
data.payload.current_position
| integer | Current position of the call in the queue. |
data.payload.queue_avg_wait_time_secs
| integer | Average time call spends in the queue in seconds. |
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
data.payload.call_control_id
| string | Call ID used to issue commands via Call Control API. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
| string | The name of the queue |
data.payload.queue_position
| integer | Last position of the call in the queue. |
| enum | The reason for leaving the queue |
data.payload.wait_time_secs
| integer | Time call spent in the queue in seconds. |
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.call_control_id
| string | Call ID used to issue commands via Call Control API. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
data.payload.conference_id
| string | Conference ID that the participant joined. |
| date-time | ISO 8601 datetime of when the event occurred. |
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.call_control_id
| string | Call ID used to issue commands via Call Control API. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
data.payload.conference_id
| string | Conference ID that the participant joined. |
| date-time | ISO 8601 datetime of when the event occurred. |
| enum | Reason the conference ended. |
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control ID of the new speaker. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | Call Leg ID of the new speaker. |
| string | Call Session ID of the new speaker. |
| string | State received from a command. |
| string | Conference ID that had a speaker change event. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantJoined
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
data.payload.call_control_id
| string | Call ID used to issue commands via Call Control API. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
data.payload.conference_id
| string | Conference ID that the participant joined. |
conferenceParticipantLeft
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
data.payload.call_control_id
| string | Call ID used to issue commands via Call Control API. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
data.payload.conference_id
| string | Conference ID that the participant joined. |
conferenceParticipantPlaybackEnded
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.call_control_id
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
data.payload.creator_call_session_id
| string | ID that is unique to the call session that started the conference. |
data.payload.conference_id
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantPlaybackStarted
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.call_control_id
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
data.payload.creator_call_session_id
| string | ID that is unique to the call session that started the conference. |
data.payload.conference_id
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantSpeakEnded
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.call_control_id
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
data.payload.creator_call_session_id
| string | ID that is unique to the call session that started the conference. |
data.payload.conference_id
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantSpeakStarted
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.call_control_id
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
data.payload.creator_call_session_id
| string | ID that is unique to the call session that started the conference. |
data.payload.conference_id
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
data.payload.creator_call_session_id
| string | ID that is unique to the call session that started the conference. |
data.payload.conference_id
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferencePlaybackStarted
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
data.payload.creator_call_session_id
| string | ID that is unique to the call session that started the conference. |
data.payload.conference_id
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.call_control_id
| string | Participant's call ID used to issue commands via Call Control API. |
data.payload.call_session_id
| string | ID that is unique to the call session and can be used to correlate webhook events. |
data.payload.client_state
| string | State received from a command. |
| enum | Whether recording was recorded in or channel. |
data.payload.conference_id
| uuid | ID of the conference that is being recorded. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| enum | The audio file format used when storing the call recording. |
data.payload.recording_ended_at
| date-time | ISO 8601 datetime of when recording ended. |
data.payload.recording_id
| uuid | ID of the conference recording. |
data.payload.recording_started_at
| date-time | ISO 8601 datetime of when recording started. |
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
data.payload.creator_call_session_id
| string | ID that is unique to the call session that started the conference. |
data.payload.conference_id
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
| Field | Type | Description |
|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
data.payload.connection_id
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
data.payload.creator_call_session_id
| string | ID that is unique to the call session that started the conference. |
data.payload.conference_id
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |