telnyx-voice-ruby
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
Telnyx Voice - Ruby
Telnyx Voice - Ruby
Installation
安装
bash
gem install telnyxbash
gem install telnyxSetup
初始化设置
ruby
require "telnyx"
client = Telnyx::Client.new(
api_key: ENV["TELNYX_API_KEY"], # This is the default and can be omitted
)All examples below assume is already initialized as shown above.
clientruby
require "telnyx"
client = Telnyx::Client.new(
api_key: ENV["TELNYX_API_KEY"], # This is the default and can be omitted
)以下所有示例均假设已按上述方式完成初始化。
clientAnswer call
接听呼叫
Answer an incoming call.
POST /calls/{call_control_id}/actions/answerOptional: (uuid), (string), (string), (array[object]), (enum), (enum), (enum), (string), (enum), (int32), (int32), (enum), (enum), (boolean), (array[object]), (object), (enum), (enum), (enum), (enum), (enum), (string), (boolean), (object), (string), (enum)
billing_group_idclient_statecommand_idcustom_headerspreferred_codecsrecordrecord_channelsrecord_custom_file_namerecord_formatrecord_max_lengthrecord_timeout_secsrecord_trackrecord_trimsend_silence_when_idlesip_headerssound_modificationsstream_bidirectional_codecstream_bidirectional_modestream_bidirectional_target_legsstream_codecstream_trackstream_urltranscriptiontranscription_configwebhook_urlwebhook_url_methodruby
response = client.calls.actions.answer("call_control_id")
puts(response)接听来电。
POST /calls/{call_control_id}/actions/answer可选参数:(uuid)、(字符串)、(字符串)、(对象数组)、(枚举类型)、(枚举类型)、(枚举类型)、(字符串)、(枚举类型)、(32位整数)、(32位整数)、(枚举类型)、(枚举类型)、(布尔值)、(对象数组)、(对象)、(枚举类型)、(枚举类型)、(枚举类型)、(枚举类型)、(枚举类型)、(字符串)、(布尔值)、(对象)、(字符串)、(枚举类型)
billing_group_idclient_statecommand_idcustom_headerspreferred_codecsrecordrecord_channelsrecord_custom_file_namerecord_formatrecord_max_lengthrecord_timeout_secsrecord_trackrecord_trimsend_silence_when_idlesip_headerssound_modificationsstream_bidirectional_codecstream_bidirectional_modestream_bidirectional_target_legsstream_codecstream_trackstream_urltranscriptiontranscription_configwebhook_urlwebhook_url_methodruby
response = client.calls.actions.answer("call_control_id")
puts(response)Bridge calls
桥接呼叫
Bridge two call control calls.
POST /calls/{call_control_id}/actions/bridgecall_control_idOptional: (string), (string), (enum), (string), (boolean), (string), (enum), (enum), (string), (enum), (int32), (int32), (enum), (enum), (enum), (string), (uuid)
client_statecommand_idmute_dtmfpark_after_unbridgeplay_ringtonequeuerecordrecord_channelsrecord_custom_file_namerecord_formatrecord_max_lengthrecord_timeout_secsrecord_trackrecord_trimringtonevideo_room_contextvideo_room_idruby
response = client.calls.actions.bridge(
"call_control_id",
call_control_id_to_bridge_with: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)
puts(response)桥接两个呼叫控制会话。
POST /calls/{call_control_id}/actions/bridgecall_control_id可选参数:(字符串)、(字符串)、(枚举类型)、(字符串)、(布尔值)、(字符串)、(枚举类型)、(枚举类型)、(字符串)、(枚举类型)、(32位整数)、(32位整数)、(枚举类型)、(枚举类型)、(枚举类型)、(字符串)、(uuid)
client_statecommand_idmute_dtmfpark_after_unbridgeplay_ringtonequeuerecordrecord_channelsrecord_custom_file_namerecord_formatrecord_max_lengthrecord_timeout_secsrecord_trackrecord_trimringtonevideo_room_contextvideo_room_idruby
response = client.calls.actions.bridge(
"call_control_id",
call_control_id_to_bridge_with: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)
puts(response)Dial
发起呼叫
Dial a number or SIP URI from a given connection.
POST /callsconnection_idtofromOptional: (enum), (object), (string), (uuid), (boolean), (boolean), (string), (string), (object), (array[object]), (object), (boolean), (string), (string), (enum), (string), (string), (string), (enum), (enum), (string), (enum), (int32), (int32), (enum), (enum), (boolean), (string), (string), (array[object]), (enum), (enum), (object), (string), (enum), (enum), (enum), (enum), (enum), (boolean), (enum), (string), (string), (enum), (int32), (int32), (boolean), (object), (string), (enum)
answering_machine_detectionanswering_machine_detection_configaudio_urlbilling_group_idbridge_intentbridge_on_answerclient_statecommand_idconference_configcustom_headersdialogflow_configenable_dialogflowfrom_display_namelink_tomedia_encryptionmedia_namepark_after_unbridgepreferred_codecsrecordrecord_channelsrecord_custom_file_namerecord_formatrecord_max_lengthrecord_timeout_secsrecord_trackrecord_trimsend_silence_when_idlesip_auth_passwordsip_auth_usernamesip_headerssip_regionsip_transport_protocolsound_modificationsstream_auth_tokenstream_bidirectional_codecstream_bidirectional_modestream_bidirectional_sampling_ratestream_bidirectional_target_legsstream_codecstream_establish_before_call_originatestream_trackstream_urlsupervise_call_control_idsupervisor_roletime_limit_secstimeout_secstranscriptiontranscription_configwebhook_urlwebhook_url_methodruby
response = client.calls.dial(
connection_id: "7267xxxxxxxxxxxxxx",
from: "+18005550101",
to: "+18005550100"
)
puts(response)从指定连接拨打号码或SIP URI。
POST /callsconnection_idtofrom可选参数:(枚举类型)、(对象)、(字符串)、(uuid)、(布尔值)、(布尔值)、(字符串)、(字符串)、(对象)、(对象数组)、(对象)、(布尔值)、(字符串)、(字符串)、(枚举类型)、(字符串)、(字符串)、(字符串)、(枚举类型)、(枚举类型)、(字符串)、(枚举类型)、(32位整数)、(32位整数)、(枚举类型)、(枚举类型)、(布尔值)、(字符串)、(字符串)、(对象数组)、(枚举类型)、(枚举类型)、(对象)、(字符串)、(枚举类型)、(枚举类型)、(枚举类型)、(枚举类型)、(枚举类型)、(布尔值)、(枚举类型)、(字符串)、(字符串)、(枚举类型)、(32位整数)、(32位整数)、(布尔值)、(对象)、(字符串)、(枚举类型)
answering_machine_detectionanswering_machine_detection_configaudio_urlbilling_group_idbridge_intentbridge_on_answerclient_statecommand_idconference_configcustom_headersdialogflow_configenable_dialogflowfrom_display_namelink_tomedia_encryptionmedia_namepark_after_unbridgepreferred_codecsrecordrecord_channelsrecord_custom_file_namerecord_formatrecord_max_lengthrecord_timeout_secsrecord_trackrecord_trimsend_silence_when_idlesip_auth_passwordsip_auth_usernamesip_headerssip_regionsip_transport_protocolsound_modificationsstream_auth_tokenstream_bidirectional_codecstream_bidirectional_modestream_bidirectional_sampling_ratestream_bidirectional_target_legsstream_codecstream_establish_before_call_originatestream_trackstream_urlsupervise_call_control_idsupervisor_roletime_limit_secstimeout_secstranscriptiontranscription_configwebhook_urlwebhook_url_methodruby
response = client.calls.dial(
connection_id: "7267xxxxxxxxxxxxxx",
from: "+18005550101",
to: "+18005550100"
)
puts(response)Hangup call
挂断呼叫
Hang up the call.
POST /calls/{call_control_id}/actions/hangupOptional: (string), (string)
client_statecommand_idruby
response = client.calls.actions.hangup("call_control_id")
puts(response)挂断当前呼叫。
POST /calls/{call_control_id}/actions/hangup可选参数:(字符串)、(字符串)
client_statecommand_idruby
response = client.calls.actions.hangup("call_control_id")
puts(response)Transfer call
转接呼叫
Transfer a call to a new destination.
POST /calls/{call_control_id}/actions/transfertoOptional: (enum), (object), (string), (string), (string), (array[object]), (boolean), (string), (string), (enum), (string), (enum), (string), (string), (enum), (enum), (string), (enum), (int32), (int32), (enum), (enum), (string), (string), (array[object]), (enum), (enum), (object), (string), (int32), (int32), (object), (string), (enum), (object), (enum)
answering_machine_detectionanswering_machine_detection_configaudio_urlclient_statecommand_idcustom_headersearly_mediafromfrom_display_namemedia_encryptionmedia_namemute_dtmfpark_after_unbridgepreferred_codecsrecordrecord_channelsrecord_custom_file_namerecord_formatrecord_max_lengthrecord_timeout_secsrecord_trackrecord_trimsip_auth_passwordsip_auth_usernamesip_headerssip_regionsip_transport_protocolsound_modificationstarget_leg_client_statetime_limit_secstimeout_secswebhook_retries_policieswebhook_urlwebhook_url_methodwebhook_urlswebhook_urls_methodruby
response = client.calls.actions.transfer("call_control_id", to: "+18005550100")
puts(response)将呼叫转接至新的目标地址。
POST /calls/{call_control_id}/actions/transferto可选参数:(枚举类型)、(对象)、(字符串)、(字符串)、(字符串)、(对象数组)、(布尔值)、(字符串)、(字符串)、(枚举类型)、(字符串)、(枚举类型)、(字符串)、(字符串)、(枚举类型)、(枚举类型)、(字符串)、(枚举类型)、(32位整数)、(32位整数)、(枚举类型)、(枚举类型)、(字符串)、(字符串)、(对象数组)、(枚举类型)、(枚举类型)、(对象)、(字符串)、(32位整数)、(32位整数)、(对象)、(字符串)、(枚举类型)、(对象)、(枚举类型)
answering_machine_detectionanswering_machine_detection_configaudio_urlclient_statecommand_idcustom_headersearly_mediafromfrom_display_namemedia_encryptionmedia_namemute_dtmfpark_after_unbridgepreferred_codecsrecordrecord_channelsrecord_custom_file_namerecord_formatrecord_max_lengthrecord_timeout_secsrecord_trackrecord_trimsip_auth_passwordsip_auth_usernamesip_headerssip_regionsip_transport_protocolsound_modificationstarget_leg_client_statetime_limit_secstimeout_secswebhook_retries_policieswebhook_urlwebhook_url_methodwebhook_urlswebhook_urls_methodruby
response = client.calls.actions.transfer("call_control_id", to: "+18005550100")
puts(response)List all active calls for given connection
列出指定连接的所有活跃呼叫
Lists all active calls for given connection.
GET /connections/{connection_id}/active_callsruby
page = client.connections.list_active_calls("1293384261075731461")
puts(page)列出指定连接下的所有活跃呼叫。
GET /connections/{connection_id}/active_callsruby
page = client.connections.list_active_calls("1293384261075731461")
puts(page)List call control applications
列出呼叫控制应用
Return a list of call control applications.
GET /call_control_applicationsruby
page = client.call_control_applications.list
puts(page)返回呼叫控制应用列表。
GET /call_control_applicationsruby
page = client.call_control_applications.list
puts(page)Create a call control application
创建呼叫控制应用
Create a call control application.
POST /call_control_applicationsapplication_namewebhook_event_urlOptional: (boolean), (enum), (boolean), (enum), (boolean), (integer), (object), (object), (boolean), (enum), (url), (['integer', 'null'])
activeanchorsite_overridecall_cost_in_webhooksdtmf_typefirst_command_timeoutfirst_command_timeout_secsinboundoutboundredact_dtmf_debug_loggingwebhook_api_versionwebhook_event_failover_urlwebhook_timeout_secsruby
call_control_application = client.call_control_applications.create(
application_name: "call-router",
webhook_event_url: "https://example.com"
)
puts(call_control_application)创建一个呼叫控制应用。
POST /call_control_applicationsapplication_namewebhook_event_url可选参数:(布尔值)、(枚举类型)、(布尔值)、(枚举类型)、(布尔值)、(整数)、(对象)、(对象)、(布尔值)、(枚举类型)、(URL)、(整数或null)
activeanchorsite_overridecall_cost_in_webhooksdtmf_typefirst_command_timeoutfirst_command_timeout_secsinboundoutboundredact_dtmf_debug_loggingwebhook_api_versionwebhook_event_failover_urlwebhook_timeout_secsruby
call_control_application = client.call_control_applications.create(
application_name: "call-router",
webhook_event_url: "https://example.com"
)
puts(call_control_application)Retrieve a call control application
获取呼叫控制应用详情
Retrieves the details of an existing call control application.
GET /call_control_applications/{id}ruby
call_control_application = client.call_control_applications.retrieve("1293384261075731499")
puts(call_control_application)获取现有呼叫控制应用的详细信息。
GET /call_control_applications/{id}ruby
call_control_application = client.call_control_applications.retrieve("1293384261075731499")
puts(call_control_application)Update a call control application
更新呼叫控制应用
Updates settings of an existing call control application.
PATCH /call_control_applications/{id}application_namewebhook_event_urlOptional: (boolean), (enum), (boolean), (enum), (boolean), (integer), (object), (object), (boolean), (array[string]), (enum), (url), (['integer', 'null'])
activeanchorsite_overridecall_cost_in_webhooksdtmf_typefirst_command_timeoutfirst_command_timeout_secsinboundoutboundredact_dtmf_debug_loggingtagswebhook_api_versionwebhook_event_failover_urlwebhook_timeout_secsruby
call_control_application = client.call_control_applications.update(
"1293384261075731499",
application_name: "call-router",
webhook_event_url: "https://example.com"
)
puts(call_control_application)更新现有呼叫控制应用的设置。
PATCH /call_control_applications/{id}application_namewebhook_event_url可选参数:(布尔值)、(枚举类型)、(布尔值)、(枚举类型)、(布尔值)、(整数)、(对象)、(对象)、(布尔值)、(字符串数组)、(枚举类型)、(URL)、(整数或null)
activeanchorsite_overridecall_cost_in_webhooksdtmf_typefirst_command_timeoutfirst_command_timeout_secsinboundoutboundredact_dtmf_debug_loggingtagswebhook_api_versionwebhook_event_failover_urlwebhook_timeout_secsruby
call_control_application = client.call_control_applications.update(
"1293384261075731499",
application_name: "call-router",
webhook_event_url: "https://example.com"
)
puts(call_control_application)Delete a call control application
删除呼叫控制应用
Deletes a call control application.
DELETE /call_control_applications/{id}ruby
call_control_application = client.call_control_applications.delete("1293384261075731499")
puts(call_control_application)删除一个呼叫控制应用。
DELETE /call_control_applications/{id}ruby
call_control_application = client.call_control_applications.delete("1293384261075731499")
puts(call_control_application)List call events
列出呼叫事件
Filters call events by given filter parameters.
GET /call_eventsruby
page = client.call_events.list
puts(page)根据指定筛选参数过滤呼叫事件。
GET /call_eventsruby
page = client.call_events.list
puts(page)Webhooks
Webhooks
The following webhook events are sent to your configured webhook URL.
All webhooks include and headers for verification (Standard Webhooks compatible).
telnyx-timestamptelnyx-signature-ed25519| Event | Description |
|---|---|
| Call Answered |
| Call Streaming Started |
| Call Streaming Stopped |
| Call Streaming Failed |
| Call Bridged |
| Call Initiated |
| Call Hangup |
| Call Recording Saved |
| Call Machine Detection Ended |
| Call Machine Greeting Ended |
| Call Machine Premium Detection Ended |
| Call Machine Premium Greeting Ended |
以下Webhook事件将发送至您配置的Webhook URL。所有Webhook均包含和头信息用于验证(兼容标准Webhooks)。
telnyx-timestamptelnyx-signature-ed25519| 事件 | 描述 |
|---|---|
| 呼叫已接听 |
| 呼叫流已启动 |
| 呼叫流已停止 |
| 呼叫流启动失败 |
| 呼叫已桥接 |
| 呼叫已发起 |
| 呼叫已挂断 |
| 呼叫录音已保存 |
| 答录机检测已结束 |
| 答录机问候语已结束 |
| 高级答录机检测已结束 |
| 高级答录机问候语已结束 |
Webhook payload fields
Webhook 负载字段
callAnswered| 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| array[object] | Custom headers set on answer command |
| array[object] | User-to-User and Diversion headers from sip invite. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| date-time | ISO 8601 datetime of when the call started. |
| enum | State received from a command. |
| array[string] | Array of tags associated to number. |
callStreamingStarted| 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Destination WebSocket address where the stream is going to be delivered. |
callStreamingStopped| 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Destination WebSocket address where the stream is going to be delivered. |
callStreamingFailed| Field | Type | Description |
|---|---|---|
| enum | Identifies 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | A short description explaning why the media streaming failed. |
| uuid | Identifies the streaming. |
| enum | The type of stream connection the stream is performing. |
callBridged| 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
callInitiated| 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. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | The list of comma-separated codecs enabled for the connection. |
| string | The list of comma-separated codecs offered by caller. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| array[object] | Custom headers from sip invite |
| array[object] | User-to-User and Diversion headers from sip invite. |
| string | SHAKEN/STIR attestation level. |
| boolean | Whether attestation was successfully validated or not. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Caller id. |
| string | Call screening result. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| enum | Whether the call is |
| enum | State received from a command. |
| date-time | ISO 8601 datetime of when the call started. |
| array[string] | Array of tags associated to number. |
callHangup| 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| array[object] | Custom headers set on answer command |
| array[object] | User-to-User and Diversion headers from sip invite. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| date-time | ISO 8601 datetime of when the call started. |
| enum | State received from a command. |
| array[string] | Array of tags associated to number. |
| enum | The reason the call was ended ( |
| enum | The party who ended the call ( |
| string | The reason the call was ended (SIP response code). |
| ['object', 'null'] | Call quality statistics aggregated from the CHANNEL_HANGUP_COMPLETE event. |
callRecordingSaved| 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. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | State received from a command. |
| date-time | ISO 8601 datetime of when recording started. |
| date-time | ISO 8601 datetime of when recording ended. |
| enum | Whether recording was recorded in |
callMachineDetectionEnded| 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| enum | Answering machine detection result. |
callMachineGreetingEnded| 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| enum | Answering machine greeting ended result. |
callMachinePremiumDetectionEnded| 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| enum | Premium Answering Machine Detection result. |
callMachinePremiumGreetingEnded| 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. |
| string | Call ID used to issue commands via Call Control API. |
| 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. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Number or SIP URI placing the call. |
| string | Destination number or SIP URI of the call. |
| enum | Premium Answering Machine Greeting Ended result. |
callAnswered| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 对象数组 | 接听命令中设置的自定义头信息 |
| 对象数组 | SIP邀请中的用户对用户及转移头信息 |
| 字符串 | 发起呼叫的号码或SIP URI |
| 字符串 | 呼叫的目标号码或SIP URI |
| 日期时间 | 呼叫启动的ISO 8601格式时间 |
| 枚举 | 从命令中接收的状态信息 |
| 字符串数组 | 与号码关联的标签数组 |
callStreamingStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 呼叫流将发送至的目标WebSocket地址 |
callStreamingStopped| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 呼叫流将发送至的目标WebSocket地址 |
callStreamingFailed| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 媒体流启动失败的简短说明 |
| uuid | 标识流ID |
| 枚举 | 流连接的类型 |
callBridged| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 发起呼叫的号码或SIP URI |
| 字符串 | 呼叫的目标号码或SIP URI |
callInitiated| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 连接启用的编解码器列表,以逗号分隔 |
| 字符串 | 呼叫方提供的编解码器列表,以逗号分隔 |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 对象数组 | SIP邀请中的自定义头信息 |
| 对象数组 | SIP邀请中的用户对用户及转移头信息 |
| 字符串 | SHAKEN/STIR认证级别 |
| 布尔值 | 认证是否成功验证 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 来电显示名称 |
| 字符串 | 呼叫筛选结果 |
| 字符串 | 发起呼叫的号码或SIP URI |
| 字符串 | 呼叫的目标号码或SIP URI |
| 枚举 | 呼叫方向, |
| 枚举 | 从命令中接收的状态信息 |
| 日期时间 | 呼叫启动的ISO 8601格式时间 |
| 字符串数组 | 与号码关联的标签数组 |
callHangup| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 对象数组 | 接听命令中设置的自定义头信息 |
| 对象数组 | SIP邀请中的用户对用户及转移头信息 |
| 字符串 | 发起呼叫的号码或SIP URI |
| 字符串 | 呼叫的目标号码或SIP URI |
| 日期时间 | 呼叫启动的ISO 8601格式时间 |
| 枚举 | 从命令中接收的状态信息 |
| 字符串数组 | 与号码关联的标签数组 |
| 枚举 | 呼叫结束原因( |
| 枚举 | 结束呼叫的一方( |
| 字符串 | 呼叫结束的SIP响应码原因 |
| 对象或null | 从CHANNEL_HANGUP_COMPLETE事件聚合的呼叫质量统计信息 |
callRecordingSaved| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 从命令中接收的状态信息 |
| 日期时间 | 录音启动的ISO 8601格式时间 |
| 日期时间 | 录音结束的ISO 8601格式时间 |
| 枚举 | 录音声道类型, |
callMachineDetectionEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 发起呼叫的号码或SIP URI |
| 字符串 | 呼叫的目标号码或SIP URI |
| 枚举 | 答录机检测结果 |
callMachineGreetingEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 发起呼叫的号码或SIP URI |
| 字符串 | 呼叫的目标号码或SIP URI |
| 枚举 | 答录机问候语检测结果 |
callMachinePremiumDetectionEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 发起呼叫的号码或SIP URI |
| 字符串 | 呼叫的目标号码或SIP URI |
| 枚举 | 高级答录机检测结果 |
callMachinePremiumGreetingEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所传递的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过Call Control API发送命令的呼叫ID |
| 字符串 | 呼叫中使用的Call Control应用ID(原Telnyx连接ID) |
| 字符串 | 呼叫唯一ID,用于关联Webhook事件 |
| 字符串 | 呼叫会话唯一ID,用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 发起呼叫的号码或SIP URI |
| 字符串 | 呼叫的目标号码或SIP URI |
| 枚举 | 高级答录机问候语检测结果 |