Class: Telnyx::Resources::Conferences

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/conferences.rb,
lib/telnyx/resources/conferences/actions.rb

Overview

Conference command operations

Defined Under Namespace

Classes: Actions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Conferences

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Conferences.

Parameters:



234
235
236
237
# File 'lib/telnyx/resources/conferences.rb', line 234

def initialize(client:)
  @client = client
  @actions = Telnyx::Resources::Conferences::Actions.new(client: client)
end

Instance Attribute Details

#actionsTelnyx::Resources::Conferences::Actions (readonly)

Conference command operations



9
10
11
# File 'lib/telnyx/resources/conferences.rb', line 9

def actions
  @actions
end

Instance Method Details

#create(call_control_id:, name:, beep_enabled: nil, client_state: nil, comfort_noise: nil, command_id: nil, duration_minutes: nil, hold_audio_url: nil, hold_media_name: nil, max_participants: nil, region: nil, start_conference_on_create: nil, request_options: {}) ⇒ Telnyx::Models::ConferenceCreateResponse

Some parameter documentations has been truncated, see Models::ConferenceCreateParams for more details.

Create a conference from an existing call leg using a ‘call_control_id` and a conference name. Upon creating the conference, the call will be automatically bridged to the conference. Conferences will expire after all participants have left the conference or after 4 hours regardless of the number of active participants.

**Expected Webhooks:**

  • ‘conference.created`

  • ‘conference.participant.joined`

  • ‘conference.participant.left`

  • ‘conference.ended`

  • ‘conference.recording.saved`

  • ‘conference.floor.changed`

Parameters:

  • call_control_id (String)

    Unique identifier and token for controlling the call

  • name (String)

    Name of the conference

  • beep_enabled (Symbol, Telnyx::Models::ConferenceCreateParams::BeepEnabled)

    Whether a beep sound should be played when participants join and/or leave the co

  • client_state (String)

    Use this field to add state to every subsequent webhook. It must be a valid Base

  • comfort_noise (Boolean)

    Toggle background comfort noise.

  • command_id (String)

    Use this field to avoid execution of duplicate commands. Telnyx will ignore subs

  • duration_minutes (Integer)

    Time length (minutes) after which the conference will end.

  • hold_audio_url (String)

    The URL of a file to be played to participants joining the conference. The URL c

  • hold_media_name (String)

    The media_name of a file to be played to participants joining the conference. Th

  • max_participants (Integer)

    The maximum number of active conference participants to allow. Must be between 2

  • region (Symbol, Telnyx::Models::ConferenceCreateParams::Region)

    Sets the region where the conference data will be hosted. Defaults to the region

  • start_conference_on_create (Boolean)

    Whether the conference should be started on creation. If the conference isn’t st

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



60
61
62
63
64
65
66
67
68
69
# File 'lib/telnyx/resources/conferences.rb', line 60

def create(params)
  parsed, options = Telnyx::ConferenceCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "conferences",
    body: parsed,
    model: Telnyx::Models::ConferenceCreateResponse,
    options: options
  )
end

#list(filter: nil, page_number: nil, page_size: nil, region: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Conference>

Some parameter documentations has been truncated, see Models::ConferenceListParams for more details.

Lists conferences. Conferences are created on demand, and will expire after all participants have left the conference or after 4 hours regardless of the number of active participants. Conferences are listed in descending order by ‘expires_at`.

Parameters:

Returns:

See Also:



119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/telnyx/resources/conferences.rb', line 119

def list(params = {})
  parsed, options = Telnyx::ConferenceListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "conferences",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Conference,
    options: options
  )
end

#list_participants(conference_id, filter: nil, page_number: nil, page_size: nil, region: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ConferenceListParticipantsResponse>

Some parameter documentations has been truncated, see Models::ConferenceListParticipantsParams for more details.

Lists conference participants

Parameters:

Returns:

See Also:



154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/telnyx/resources/conferences.rb', line 154

def list_participants(conference_id, params = {})
  parsed, options = Telnyx::ConferenceListParticipantsParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["conferences/%1$s/participants", conference_id],
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Models::ConferenceListParticipantsResponse,
    options: options
  )
end

#retrieve(id, region: nil, request_options: {}) ⇒ Telnyx::Models::ConferenceRetrieveResponse

Retrieve an existing conference

Parameters:

Returns:

See Also:



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/telnyx/resources/conferences.rb', line 84

def retrieve(id, params = {})
  parsed, options = Telnyx::ConferenceRetrieveParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["conferences/%1$s", id],
    query: query,
    model: Telnyx::Models::ConferenceRetrieveResponse,
    options: options
  )
end

#retrieve_participant(participant_id, id:, request_options: {}) ⇒ Telnyx::Models::ConferenceRetrieveParticipantResponse

Retrieve details of a specific conference participant by their ID or label.

Parameters:

  • participant_id (String)

    Uniquely identifies the participant by their ID or label.

  • id (String)

    Uniquely identifies the conference.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/telnyx/resources/conferences.rb', line 180

def retrieve_participant(participant_id, params)
  parsed, options = Telnyx::ConferenceRetrieveParticipantParams.dump_request(params)
  id =
    parsed.delete(:id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["conferences/%1$s/participants/%2$s", id, participant_id],
    model: Telnyx::Models::ConferenceRetrieveParticipantResponse,
    options: options
  )
end

#update_participant(participant_id, id:, beep_enabled: nil, end_conference_on_exit: nil, soft_end_conference_on_exit: nil, request_options: {}) ⇒ Telnyx::Models::ConferenceUpdateParticipantResponse

Some parameter documentations has been truncated, see Models::ConferenceUpdateParticipantParams for more details.

Update properties of a conference participant.

Parameters:

  • participant_id (String)

    Path param: Uniquely identifies the participant.

  • id (String)

    Path param: Uniquely identifies the conference.

  • beep_enabled (Symbol, Telnyx::Models::ConferenceUpdateParticipantParams::BeepEnabled)

    Body param: Whether entry/exit beeps are enabled for this participant.

  • end_conference_on_exit (Boolean)

    Body param: Whether the conference should end when this participant exits.

  • soft_end_conference_on_exit (Boolean)

    Body param: Whether the conference should soft-end when this participant exits.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/telnyx/resources/conferences.rb', line 216

def update_participant(participant_id, params)
  parsed, options = Telnyx::ConferenceUpdateParticipantParams.dump_request(params)
  id =
    parsed.delete(:id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["conferences/%1$s/participants/%2$s", id, participant_id],
    body: parsed,
    model: Telnyx::Models::ConferenceUpdateParticipantResponse,
    options: options
  )
end