Class: Telnyx::Resources::Texml::Accounts::Calls

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/texml/accounts/calls.rb,
lib/telnyx/resources/texml/accounts/calls/siprec.rb,
lib/telnyx/resources/texml/accounts/calls/streams.rb,
lib/telnyx/resources/texml/accounts/calls/recordings.rb,
lib/telnyx/resources/texml/accounts/calls/recordings_json.rb

Overview

TeXML REST Commands

Defined Under Namespace

Classes: Recordings, RecordingsJson, Siprec, Streams

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Calls

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 Calls.

Parameters:



291
292
293
294
295
296
297
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 291

def initialize(client:)
  @client = client
  @recordings_json = Telnyx::Resources::Texml::Accounts::Calls::RecordingsJson.new(client: client)
  @recordings = Telnyx::Resources::Texml::Accounts::Calls::Recordings.new(client: client)
  @siprec = Telnyx::Resources::Texml::Accounts::Calls::Siprec.new(client: client)
  @streams = Telnyx::Resources::Texml::Accounts::Calls::Streams.new(client: client)
end

Instance Attribute Details

#recordingsTelnyx::Resources::Texml::Accounts::Calls::Recordings (readonly)

TeXML REST Commands



15
16
17
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 15

def recordings
  @recordings
end

#recordings_jsonTelnyx::Resources::Texml::Accounts::Calls::RecordingsJson (readonly)

TeXML REST Commands



11
12
13
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 11

def recordings_json
  @recordings_json
end

#siprecTelnyx::Resources::Texml::Accounts::Calls::Siprec (readonly)

TeXML REST Commands



19
20
21
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 19

def siprec
  @siprec
end

#streamsTelnyx::Resources::Texml::Accounts::Calls::Streams (readonly)

TeXML REST Commands



23
24
25
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 23

def streams
  @streams
end

Instance Method Details

#calls(account_sid, params:, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::CallCallsResponse

Initiate an outbound TeXML call. Telnyx will request TeXML from the XML Request URL configured for the connection in the Mission Control Portal.



116
117
118
119
120
121
122
123
124
125
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 116

def calls(, params)
  parsed, options = Telnyx::Texml::Accounts::CallCallsParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["texml/Accounts/%1$s/Calls", ],
    body: parsed[:params],
    model: Telnyx::Models::Texml::Accounts::CallCallsResponse,
    options: options
  )
end

#retrieve(call_sid, account_sid:, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::CallRetrieveResponse

Returns an individual call identified by its CallSid. This endpoint is eventually consistent.

Parameters:

  • call_sid (String)

    The CallSid that identifies the call to update.

  • account_sid (String)

    The id of the account the resource belongs to.

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

Returns:

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 39

def retrieve(call_sid, params)
  parsed, options = Telnyx::Texml::Accounts::CallRetrieveParams.dump_request(params)
   =
    parsed.delete(:account_sid) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["texml/Accounts/%1$s/Calls/%2$s", , call_sid],
    model: Telnyx::Models::Texml::Accounts::CallRetrieveResponse,
    options: options
  )
end

#retrieve_calls(account_sid, end_time: nil, end_time_gt: nil, end_time_lt: nil, from: nil, page: nil, page_size: nil, page_token: nil, start_time: nil, start_time_gt: nil, start_time_lt: nil, status: nil, to: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::CallRetrieveCallsResponse

Some parameter documentations has been truncated, see Models::Texml::Accounts::CallRetrieveCallsParams for more details.

Returns multiple call resouces for an account. This endpoint is eventually consistent.

Parameters:

  • account_sid (String)

    The id of the account the resource belongs to.

  • end_time (String)

    Filters calls by their end date. Expected format is YYYY-MM-DD

  • end_time_gt (String)

    Filters calls by their end date (after). Expected format is YYYY-MM-DD

  • end_time_lt (String)

    Filters calls by their end date (before). Expected format is YYYY-MM-DD

  • from (String)

    Filters calls by the from number.

  • page (Integer)

    The number of the page to be displayed, zero-indexed, should be used in conjucti

  • page_size (Integer)

    The number of records to be displayed on a page

  • page_token (String)

    Used to request the next page of results.

  • start_time (String)

    Filters calls by their start date. Expected format is YYYY-MM-DD.

  • start_time_gt (String)

    Filters calls by their start date (after). Expected format is YYYY-MM-DD

  • start_time_lt (String)

    Filters calls by their start date (before). Expected format is YYYY-MM-DD

  • status (Symbol, Telnyx::Models::Texml::Accounts::CallRetrieveCallsParams::Status)

    Filters calls by status.

  • to (String)

    Filters calls by the to number.

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

Returns:

See Also:



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 166

def retrieve_calls(, params = {})
  parsed, options = Telnyx::Texml::Accounts::CallRetrieveCallsParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["texml/Accounts/%1$s/Calls", ],
    query: query.transform_keys(
      end_time: "EndTime",
      end_time_gt: "EndTime_gt",
      end_time_lt: "EndTime_lt",
      from: "From",
      page: "Page",
      page_size: "PageSize",
      page_token: "PageToken",
      start_time: "StartTime",
      start_time_gt: "StartTime_gt",
      start_time_lt: "StartTime_lt",
      status: "Status",
      to: "To"
    ),
    model: Telnyx::Models::Texml::Accounts::CallRetrieveCallsResponse,
    options: options
  )
end

#siprec_json(call_sid, account_sid:, connector_name: nil, include_metadata_custom_headers: nil, name: nil, secure: nil, session_timeout_secs: nil, sip_transport: nil, status_callback: nil, status_callback_method: nil, track: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::CallSiprecJsonResponse

Some parameter documentations has been truncated, see Models::Texml::Accounts::CallSiprecJsonParams for more details.

Starts siprec session with specified parameters for call idientified by call_sid.

Parameters:

Returns:

See Also:



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 226

def siprec_json(call_sid, params)
  parsed, options = Telnyx::Texml::Accounts::CallSiprecJsonParams.dump_request(params)
   =
    parsed.delete(:account_sid) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["texml/Accounts/%1$s/Calls/%2$s/Siprec.json", , call_sid],
    headers: {"content-type" => "application/x-www-form-urlencoded"},
    body: parsed,
    model: Telnyx::Models::Texml::Accounts::CallSiprecJsonResponse,
    options: options
  )
end

#streams_json(call_sid, account_sid:, bidirectional_codec: nil, bidirectional_mode: nil, name: nil, status_callback: nil, status_callback_method: nil, track: nil, url: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::CallStreamsJsonResponse

Some parameter documentations has been truncated, see Models::Texml::Accounts::CallStreamsJsonParams for more details.

Starts streaming media from a call to a specific WebSocket address.

Parameters:

Returns:

See Also:



272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 272

def streams_json(call_sid, params)
  parsed, options = Telnyx::Texml::Accounts::CallStreamsJsonParams.dump_request(params)
   =
    parsed.delete(:account_sid) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["texml/Accounts/%1$s/Calls/%2$s/Streams.json", , call_sid],
    headers: {"content-type" => "application/x-www-form-urlencoded"},
    body: parsed,
    model: Telnyx::Models::Texml::Accounts::CallStreamsJsonResponse,
    options: options
  )
end

#update(call_sid, account_sid:, fallback_method: nil, fallback_url: nil, method_: nil, status: nil, status_callback: nil, status_callback_method: nil, texml: nil, url: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::CallUpdateResponse

Some parameter documentations has been truncated, see Models::Texml::Accounts::CallUpdateParams for more details.

Update TeXML call. Please note that the keys present in the payload MUST BE formatted in CamelCase as specified in the example.

Parameters:

  • call_sid (String)

    Path param: The CallSid that identifies the call to update.

  • account_sid (String)

    Path param: The id of the account the resource belongs to.

  • fallback_method (Symbol, Telnyx::Models::Texml::Accounts::UpdateCall::FallbackMethod)

    Body param: HTTP request type used for ‘FallbackUrl`.

  • fallback_url (String)

    Body param: A failover URL for which Telnyx will retrieve the TeXML call instruc

  • method_ (Symbol, Telnyx::Models::Texml::Accounts::UpdateCall::Method)

    Body param: HTTP request type used for ‘Url`.

  • status (String)

    Body param: The value to set the call status to. Setting the status to completed

  • status_callback (String)

    Body param: URL destination for Telnyx to send status callback events to for the

  • status_callback_method (Symbol, Telnyx::Models::Texml::Accounts::UpdateCall::StatusCallbackMethod)

    Body param: HTTP request type used for ‘StatusCallback`.

  • texml (String)

    Body param: TeXML to replace the current one with.

  • url (String)

    Body param: The URL where TeXML will make a request to retrieve a new set of TeX

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

Returns:

See Also:



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/telnyx/resources/texml/accounts/calls.rb', line 86

def update(call_sid, params)
  parsed, options = Telnyx::Texml::Accounts::CallUpdateParams.dump_request(params)
   =
    parsed.delete(:account_sid) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["texml/Accounts/%1$s/Calls/%2$s", , call_sid],
    headers: {"content-type" => "application/x-www-form-urlencoded"},
    body: parsed,
    model: Telnyx::Models::Texml::Accounts::CallUpdateResponse,
    options: options
  )
end