Class: Telnyx::Resources::CallControlApplications

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/call_control_applications.rb

Overview

Call Control applications operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CallControlApplications

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

Parameters:



189
190
191
# File 'lib/telnyx/resources/call_control_applications.rb', line 189

def initialize(client:)
  @client = client
end

Instance Method Details

#create(application_name:, webhook_event_url:, active: nil, anchorsite_override: nil, call_cost_in_webhooks: nil, dtmf_type: nil, first_command_timeout: nil, first_command_timeout_secs: nil, inbound: nil, outbound: nil, redact_dtmf_debug_logging: nil, webhook_api_version: nil, webhook_event_failover_url: nil, webhook_timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::CallControlApplicationCreateResponse

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

Create a call control application.

Parameters:

  • application_name (String)

    A user-assigned name to help manage the application.

  • webhook_event_url (String)

    The URL where webhooks related to this connection will be sent. Must include a s

  • active (Boolean)

    Specifies whether the connection can be used.

  • anchorsite_override (Symbol, Telnyx::Models::CallControlApplicationCreateParams::AnchorsiteOverride)

    Latency directs Telnyx to route media through the site with the low

  • call_cost_in_webhooks (Boolean)

    Specifies if call cost webhooks should be sent for this Call Control Application

  • dtmf_type (Symbol, Telnyx::Models::CallControlApplicationCreateParams::DtmfType)

    Sets the type of DTMF digits sent from Telnyx to this Connection. Note that DTMF

  • first_command_timeout (Boolean)

    Specifies whether calls to phone numbers associated with this connection should

  • first_command_timeout_secs (Integer)

    Specifies how many seconds to wait before timing out a dial command.

  • inbound (Telnyx::Models::CallControlApplicationInbound)
  • outbound (Telnyx::Models::CallControlApplicationOutbound)
  • redact_dtmf_debug_logging (Boolean)

    When enabled, DTMF digits entered by users will be redacted in debug logs to pro

  • webhook_api_version (Symbol, Telnyx::Models::CallControlApplicationCreateParams::WebhookAPIVersion)

    Determines which webhook format will be used, Telnyx API v1 or v2.

  • webhook_event_failover_url (String, nil)

    The failover URL where webhooks related to this connection will be sent if sendi

  • webhook_timeout_secs (Integer, nil)

    Specifies how many seconds to wait before timing out a webhook.

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

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
# File 'lib/telnyx/resources/call_control_applications.rb', line 47

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

#delete(id, request_options: {}) ⇒ Telnyx::Models::CallControlApplicationDeleteResponse

Deletes a call control application.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



177
178
179
180
181
182
183
184
# File 'lib/telnyx/resources/call_control_applications.rb', line 177

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["call_control_applications/%1$s", id],
    model: Telnyx::Models::CallControlApplicationDeleteResponse,
    options: params[:request_options]
  )
end

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

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

Return a list of call control applications.

Parameters:

Returns:

See Also:



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

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

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::CallControlApplicationRetrieveResponse

Retrieves the details of an existing call control application.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



69
70
71
72
73
74
75
76
# File 'lib/telnyx/resources/call_control_applications.rb', line 69

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["call_control_applications/%1$s", id],
    model: Telnyx::Models::CallControlApplicationRetrieveResponse,
    options: params[:request_options]
  )
end

#update(id, application_name:, webhook_event_url:, active: nil, anchorsite_override: nil, call_cost_in_webhooks: nil, dtmf_type: nil, first_command_timeout: nil, first_command_timeout_secs: nil, inbound: nil, outbound: nil, redact_dtmf_debug_logging: nil, tags: nil, webhook_api_version: nil, webhook_event_failover_url: nil, webhook_timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::CallControlApplicationUpdateResponse

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

Updates settings of an existing call control application.

Parameters:

  • id (String)

    Identifies the resource.

  • application_name (String)

    A user-assigned name to help manage the application.

  • webhook_event_url (String)

    The URL where webhooks related to this connection will be sent. Must include a s

  • active (Boolean)

    Specifies whether the connection can be used.

  • anchorsite_override (Symbol, Telnyx::Models::CallControlApplicationUpdateParams::AnchorsiteOverride)

    Latency directs Telnyx to route media through the site with the low

  • call_cost_in_webhooks (Boolean)

    Specifies if call cost webhooks should be sent for this Call Control Application

  • dtmf_type (Symbol, Telnyx::Models::CallControlApplicationUpdateParams::DtmfType)

    Sets the type of DTMF digits sent from Telnyx to this Connection. Note that DTMF

  • first_command_timeout (Boolean)

    Specifies whether calls to phone numbers associated with this connection should

  • first_command_timeout_secs (Integer)

    Specifies how many seconds to wait before timing out a dial command.

  • inbound (Telnyx::Models::CallControlApplicationInbound)
  • outbound (Telnyx::Models::CallControlApplicationOutbound)
  • redact_dtmf_debug_logging (Boolean)

    When enabled, DTMF digits entered by users will be redacted in debug logs to pro

  • tags (Array<String>)

    Tags assigned to the Call Control Application.

  • webhook_api_version (Symbol, Telnyx::Models::CallControlApplicationUpdateParams::WebhookAPIVersion)

    Determines which webhook format will be used, Telnyx API v1 or v2.

  • webhook_event_failover_url (String, nil)

    The failover URL where webhooks related to this connection will be sent if sendi

  • webhook_timeout_secs (Integer, nil)

    Specifies how many seconds to wait before timing out a webhook.

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

Returns:

See Also:



122
123
124
125
126
127
128
129
130
131
# File 'lib/telnyx/resources/call_control_applications.rb', line 122

def update(id, params)
  parsed, options = Telnyx::CallControlApplicationUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["call_control_applications/%1$s", id],
    body: parsed,
    model: Telnyx::Models::CallControlApplicationUpdateResponse,
    options: options
  )
end