Class: Telnyx::Resources::Calls
- Inherits:
-
Object
- Object
- Telnyx::Resources::Calls
- Defined in:
- lib/telnyx/resources/calls.rb,
lib/telnyx/resources/calls/actions.rb
Defined Under Namespace
Classes: Actions
Instance Attribute Summary collapse
-
#actions ⇒ Telnyx::Resources::Calls::Actions
readonly
Call Control command operations.
Instance Method Summary collapse
-
#dial(connection_id:, from:, to:, answering_machine_detection: nil, answering_machine_detection_config: nil, assistant: nil, audio_url: nil, billing_group_id: nil, bridge_intent: nil, bridge_on_answer: nil, client_state: nil, command_id: nil, conference_config: nil, custom_headers: nil, deepfake_detection: nil, dialogflow_config: nil, enable_dialogflow: nil, from_display_name: nil, link_to: nil, media_encryption: nil, media_name: nil, park_after_unbridge: nil, preferred_codecs: nil, prevent_double_bridge: nil, privacy: nil, record: nil, record_channels: nil, record_custom_file_name: nil, record_format: nil, record_max_length: nil, record_timeout_secs: nil, record_track: nil, record_trim: nil, send_silence_when_idle: nil, sip_auth_password: nil, sip_auth_username: nil, sip_headers: nil, sip_region: nil, sip_transport_protocol: nil, sound_modifications: nil, stream_auth_token: nil, stream_bidirectional_codec: nil, stream_bidirectional_mode: nil, stream_bidirectional_sampling_rate: nil, stream_bidirectional_target_legs: nil, stream_codec: nil, stream_establish_before_call_originate: nil, stream_track: nil, stream_url: nil, supervise_call_control_id: nil, supervisor_role: nil, time_limit_secs: nil, timeout_secs: nil, transcription: nil, transcription_config: nil, webhook_retries_policies: nil, webhook_url: nil, webhook_url_method: nil, webhook_urls: nil, webhook_urls_method: nil, request_options: {}) ⇒ Telnyx::Models::CallDialResponse
Some parameter documentations has been truncated, see Models::CallDialParams for more details.
-
#initialize(client:) ⇒ Calls
constructor
private
A new instance of Calls.
-
#retrieve_status(call_control_id, request_options: {}) ⇒ Telnyx::Models::CallRetrieveStatusResponse
Returns the status of a call (data is available 10 minutes after call ended).
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.
199 200 201 202 |
# File 'lib/telnyx/resources/calls.rb', line 199 def initialize(client:) @client = client @actions = Telnyx::Resources::Calls::Actions.new(client: client) end |
Instance Attribute Details
#actions ⇒ Telnyx::Resources::Calls::Actions (readonly)
Call Control command operations
8 9 10 |
# File 'lib/telnyx/resources/calls.rb', line 8 def actions @actions end |
Instance Method Details
#dial(connection_id:, from:, to:, answering_machine_detection: nil, answering_machine_detection_config: nil, assistant: nil, audio_url: nil, billing_group_id: nil, bridge_intent: nil, bridge_on_answer: nil, client_state: nil, command_id: nil, conference_config: nil, custom_headers: nil, deepfake_detection: nil, dialogflow_config: nil, enable_dialogflow: nil, from_display_name: nil, link_to: nil, media_encryption: nil, media_name: nil, park_after_unbridge: nil, preferred_codecs: nil, prevent_double_bridge: nil, privacy: nil, record: nil, record_channels: nil, record_custom_file_name: nil, record_format: nil, record_max_length: nil, record_timeout_secs: nil, record_track: nil, record_trim: nil, send_silence_when_idle: nil, sip_auth_password: nil, sip_auth_username: nil, sip_headers: nil, sip_region: nil, sip_transport_protocol: nil, sound_modifications: nil, stream_auth_token: nil, stream_bidirectional_codec: nil, stream_bidirectional_mode: nil, stream_bidirectional_sampling_rate: nil, stream_bidirectional_target_legs: nil, stream_codec: nil, stream_establish_before_call_originate: nil, stream_track: nil, stream_url: nil, supervise_call_control_id: nil, supervisor_role: nil, time_limit_secs: nil, timeout_secs: nil, transcription: nil, transcription_config: nil, webhook_retries_policies: nil, webhook_url: nil, webhook_url_method: nil, webhook_urls: nil, webhook_urls_method: nil, request_options: {}) ⇒ Telnyx::Models::CallDialResponse
Some parameter documentations has been truncated, see Models::CallDialParams for more details.
Dial a number or SIP URI from a given connection. A successful response will include a ‘call_leg_id` which can be used to correlate the command with subsequent webhooks.
**Expected Webhooks:**
-
‘call.initiated`
-
‘call.answered` or `call.hangup`
-
‘call.machine.detection.ended` if `answering_machine_detection` was requested
-
‘call.machine.greeting.ended` if `answering_machine_detection` was requested to detect the end of machine greeting
-
‘call.machine.premium.detection.ended` if `answering_machine_detection=premium` was requested
-
‘call.machine.premium.greeting.ended` if `answering_machine_detection=premium` was requested and a beep was detected
-
‘call.deepfake_detection.result` if `deepfake_detection` was enabled
-
‘call.deepfake_detection.error` if `deepfake_detection` was enabled and an error occurred
-
‘streaming.started`, `streaming.stopped` or `streaming.failed` if `stream_url` was set
When the ‘record` parameter is set to `record-from-answer`, the response will include a `recording_id` field.
stream_
165 166 167 168 169 170 171 172 173 174 |
# File 'lib/telnyx/resources/calls.rb', line 165 def dial(params) parsed, = Telnyx::CallDialParams.dump_request(params) @client.request( method: :post, path: "calls", body: parsed, model: Telnyx::Models::CallDialResponse, options: ) end |
#retrieve_status(call_control_id, request_options: {}) ⇒ Telnyx::Models::CallRetrieveStatusResponse
Returns the status of a call (data is available 10 minutes after call ended).
187 188 189 190 191 192 193 194 |
# File 'lib/telnyx/resources/calls.rb', line 187 def retrieve_status(call_control_id, params = {}) @client.request( method: :get, path: ["calls/%1$s", call_control_id], model: Telnyx::Models::CallRetrieveStatusResponse, options: params[:request_options] ) end |