telnyx-voice-conferencing-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 Conferencing - Ruby
Telnyx 语音会议 - 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"], # 这是默认配置,可以省略
)以下所有示例都默认已经按照上面的方式完成初始化。
clientError Handling
错误处理
All API calls can fail with network errors, rate limits (429), validation errors (422),
or authentication errors (401). Always handle errors in production code:
ruby
begin
result = client.messages.send_(to: "+13125550001", from: "+13125550002", text: "Hello")
rescue Telnyx::Errors::APIConnectionError
puts "Network error — check connectivity and retry"
rescue Telnyx::Errors::RateLimitError
# 429: rate limited — wait and retry with exponential backoff
sleep(1) # Check Retry-After header for actual delay
rescue Telnyx::Errors::APIStatusError => e
puts "API error #{e.status}: #{e.message}"
if e.status == 422
puts "Validation error — check required fields and formats"
end
endCommon error codes: invalid API key, insufficient permissions,
resource not found, validation error (check field formats),
rate limited (retry with exponential backoff).
401403404422429所有API调用都可能因为网络错误、触发限流(429)、验证错误(422)或者认证错误(401)而失败,生产环境代码中请务必做好错误处理:
ruby
begin
result = client.messages.send_(to: "+13125550001", from: "+13125550002", text: "Hello")
rescue Telnyx::Errors::APIConnectionError
puts "网络错误 — 检查网络连接后重试"
rescue Telnyx::Errors::RateLimitError
# 429:触发限流 — 等待后使用指数退避策略重试
sleep(1) # 实际等待时长请参考Retry-After响应头
rescue Telnyx::Errors::APIStatusError => e
puts "API错误 #{e.status}: #{e.message}"
if e.status == 422
puts "验证错误 — 检查必填字段和格式是否正确"
end
end常见错误码: API密钥无效, 权限不足, 资源不存在, 验证错误(请检查字段格式), 触发限流(请使用指数退避策略重试)。
401403404422429Important Notes
重要说明
- Pagination: Use for automatic iteration:
.auto_paging_each.page.auto_paging_each { |item| puts item.id }
- 分页: 使用实现自动遍历:
.auto_paging_each。page.auto_paging_each { |item| puts item.id }
Enqueue call
通话入列
Put the call in a queue.
POST /calls/{call_control_id}/actions/enqueuequeue_nameOptional: (string), (string), (boolean), (integer), (integer)
client_statecommand_idkeep_after_hangupmax_sizemax_wait_time_secsruby
response = client.calls.actions.enqueue("call_control_id", queue_name: "support")
puts(response)Returns: (string)
result将通话加入队列。
POST /calls/{call_control_id}/actions/enqueuequeue_name可选参数: (字符串), (字符串), (布尔值), (整数), (整数)
client_statecommand_idkeep_after_hangupmax_sizemax_wait_time_secsruby
response = client.calls.actions.enqueue("call_control_id", queue_name: "support")
puts(response)返回值: (字符串)
resultRemove call from a queue
将通话移出队列
Removes the call from a queue.
POST /calls/{call_control_id}/actions/leave_queueOptional: (string), (string)
client_statecommand_idruby
response = client.calls.actions.leave_queue("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
puts(response)Returns: (string)
result将通话从队列中移除。
POST /calls/{call_control_id}/actions/leave_queue可选参数: (字符串), (字符串)
client_statecommand_idruby
response = client.calls.actions.leave_queue("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")
puts(response)返回值: (字符串)
resultList conferences
查询会议列表
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_atGET /conferencesruby
page = client.conferences.list
puts(page)Returns: (string), (string), (enum: all_left, ended_via_api, host_left, time_exceeded), (object), (string), (string), (string), (enum: conference), (string), (enum: init, in_progress, completed), (string)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_at查询会议列表。会议为按需创建,所有参会者离开后自动过期,无论参会人数多少,最长存续时间为4小时。会议列表按照字段倒序排列。
expires_atGET /conferencesruby
page = client.conferences.list
puts(page)返回值: (字符串), (字符串), (枚举:all_left, ended_via_api, host_left, time_exceeded), (对象), (字符串), (字符串), (字符串), (枚举:conference), (字符串), (枚举:init, in_progress, completed), (字符串)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_atCreate conference
创建会议
Create a conference from an existing call leg using a 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.
call_control_idPOST /conferencescall_control_idnameOptional: (enum: always, never, on_enter, on_exit), (string), (boolean), (string), (integer), (string), (string), (integer), (enum: Australia, Europe, Middle East, US), (boolean)
beep_enabledclient_statecomfort_noisecommand_idduration_minuteshold_audio_urlhold_media_namemax_participantsregionstart_conference_on_createruby
conference = client.conferences.create(
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
name: "Business"
)
puts(conference)Returns: (string), (string), (enum: all_left, ended_via_api, host_left, time_exceeded), (object), (string), (string), (string), (enum: conference), (string), (enum: init, in_progress, completed), (string)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_at使用和会议名称,从已有的通话支路创建会议。创建完成后,该通话会自动桥接到会议中。所有参会者离开后会议自动过期,无论参会人数多少,最长存续时间为4小时。
call_control_idPOST /conferencescall_control_idname可选参数: (枚举:always, never, on_enter, on_exit), (字符串), (布尔值), (字符串), (整数), (字符串), (字符串), (整数), (枚举:Australia, Europe, Middle East, US), (布尔值)
beep_enabledclient_statecomfort_noisecommand_idduration_minuteshold_audio_urlhold_media_namemax_participantsregionstart_conference_on_createruby
conference = client.conferences.create(
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
name: "Business"
)
puts(conference)返回值: (字符串), (字符串), (枚举:all_left, ended_via_api, host_left, time_exceeded), (对象), (字符串), (字符串), (字符串), (枚举:conference), (字符串), (枚举:init, in_progress, completed), (字符串)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_atList conference participants
查询会议参会者列表
Lists conference participants
GET /conferences/{conference_id}/participantsruby
page = client.conferences.list_participants("550e8400-e29b-41d4-a716-446655440000")
puts(page)Returns: (string), (string), (object), (string), (boolean), (string), (boolean), (boolean), (enum: participant), (boolean), (enum: joining, joined, left), (string), (array[string])
call_control_idcall_leg_idconferencecreated_atend_conference_on_exitidmutedon_holdrecord_typesoft_end_conference_on_exitstatusupdated_atwhisper_call_control_ids查询会议的参会者列表
GET /conferences/{conference_id}/participantsruby
page = client.conferences.list_participants("550e8400-e29b-41d4-a716-446655440000")
puts(page)返回值: (字符串), (字符串), (对象), (字符串), (布尔值), (字符串), (布尔值), (布尔值), (枚举:participant), (布尔值), (枚举:joining, joined, left), (字符串), (字符串数组)
call_control_idcall_leg_idconferencecreated_atend_conference_on_exitidmutedon_holdrecord_typesoft_end_conference_on_exitstatusupdated_atwhisper_call_control_idsRetrieve a conference
获取单个会议详情
Retrieve an existing conference
GET /conferences/{id}ruby
conference = client.conferences.retrieve("550e8400-e29b-41d4-a716-446655440000")
puts(conference)Returns: (string), (string), (enum: all_left, ended_via_api, host_left, time_exceeded), (object), (string), (string), (string), (enum: conference), (string), (enum: init, in_progress, completed), (string)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_at查询已存在的会议的详情
GET /conferences/{id}ruby
conference = client.conferences.retrieve("550e8400-e29b-41d4-a716-446655440000")
puts(conference)返回值: (字符串), (字符串), (枚举:all_left, ended_via_api, host_left, time_exceeded), (对象), (字符串), (字符串), (字符串), (枚举:conference), (字符串), (枚举:init, in_progress, completed), (字符串)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_atEnd a conference
结束会议
End a conference and terminate all active participants.
POST /conferences/{id}/actions/endOptional: (string)
command_idruby
response = client.conferences.actions.end_conference("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(response)Returns: (string)
result结束会议并终止所有活跃参会者的连接。
POST /conferences/{id}/actions/end可选参数: (字符串)
command_idruby
response = client.conferences.actions.end_conference("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(response)返回值: (字符串)
resultGather DTMF using audio prompt in a conference
会议中使用音频提示收集DTMF输入
Play an audio file to a specific conference participant and gather DTMF input.
POST /conferences/{id}/actions/gather_using_audiocall_control_idOptional: (string), (string), (string), (integer), (integer), (string), (string), (integer), (integer), (string), (integer), (boolean), (string), (integer), (string)
audio_urlclient_stategather_idinitial_timeout_millisinter_digit_timeout_millisinvalid_audio_urlinvalid_media_namemaximum_digitsmaximum_triesmedia_nameminimum_digitsstop_playback_on_dtmfterminating_digittimeout_millisvalid_digitsruby
response = client.conferences.actions.gather_dtmf_audio(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)
puts(response)Returns: (string)
result向指定的会议参会者播放音频文件并收集DTMF输入。
POST /conferences/{id}/actions/gather_using_audiocall_control_id可选参数: (字符串), (字符串), (字符串), (整数), (整数), (字符串), (字符串), (整数), (整数), (字符串), (整数), (布尔值), (字符串), (整数), (字符串)
audio_urlclient_stategather_idinitial_timeout_millisinter_digit_timeout_millisinvalid_audio_urlinvalid_media_namemaximum_digitsmaximum_triesmedia_nameminimum_digitsstop_playback_on_dtmfterminating_digittimeout_millisvalid_digitsruby
response = client.conferences.actions.gather_dtmf_audio(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)
puts(response)返回值: (字符串)
resultHold conference participants
保持会议参会者
Hold a list of participants in a conference call
POST /conferences/{id}/actions/holdOptional: (string), (array[string]), (string), (enum: Australia, Europe, Middle East, US)
audio_urlcall_control_idsmedia_nameregionruby
response = client.conferences.actions.hold("550e8400-e29b-41d4-a716-446655440000")
puts(response)Returns: (string)
result将会议中的指定参会者置为保持状态
POST /conferences/{id}/actions/hold可选参数: (字符串), (字符串数组), (字符串), (枚举:Australia, Europe, Middle East, US)
audio_urlcall_control_idsmedia_nameregionruby
response = client.conferences.actions.hold("550e8400-e29b-41d4-a716-446655440000")
puts(response)返回值: (字符串)
resultJoin a conference
加入会议
Join an existing call leg to a conference. Issue the Join Conference command with the conference ID in the path and the of the leg you wish to join to the conference as an attribute. The conference can have up to a certain amount of active participants, as set by the parameter in conference creation request.
call_control_idmax_participantsPOST /conferences/{id}/actions/joincall_control_idOptional: (enum: always, never, on_enter, on_exit), (string), (string), (boolean), (boolean), (string), (string), (boolean), (enum: Australia, Europe, Middle East, US), (boolean), (boolean), (enum: barge, monitor, none, whisper), (array[string])
beep_enabledclient_statecommand_idend_conference_on_exitholdhold_audio_urlhold_media_namemuteregionsoft_end_conference_on_exitstart_conference_on_entersupervisor_rolewhisper_call_control_idsruby
response = client.conferences.actions.join(
"id",
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)
puts(response)Returns: (string)
result将已有的通话支路加入会议。调用加入会议接口时,路径参数传入会议ID,属性中传入要加入会议的通话支路的即可。会议的最大活跃参会人数由创建会议时设置的参数决定。
call_control_idmax_participantsPOST /conferences/{id}/actions/joincall_control_id可选参数: (枚举:always, never, on_enter, on_exit), (字符串), (字符串), (布尔值), (布尔值), (字符串), (字符串), (布尔值), (枚举:Australia, Europe, Middle East, US), (布尔值), (布尔值), (枚举:barge, monitor, none, whisper), (字符串数组)
beep_enabledclient_statecommand_idend_conference_on_exitholdhold_audio_urlhold_media_namemuteregionsoft_end_conference_on_exitstart_conference_on_entersupervisor_rolewhisper_call_control_idsruby
response = client.conferences.actions.join(
"id",
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)
puts(response)返回值: (字符串)
resultLeave a conference
离开会议
Removes a call leg from a conference and moves it back to parked state. Expected Webhooks:
conference.participant.left
POST /conferences/{id}/actions/leavecall_control_idOptional: (enum: always, never, on_enter, on_exit), (string), (enum: Australia, Europe, Middle East, US)
beep_enabledcommand_idregionruby
response = client.conferences.actions.leave("id", call_control_id: "c46e06d7-b78f-4b13-96b6-c576af9640ff")
puts(response)Returns: (string)
result将通话支路从会议中移除,回到驻留状态。预期Webhook事件:
conference.participant.left
POST /conferences/{id}/actions/leavecall_control_id可选参数: (枚举:always, never, on_enter, on_exit), (字符串), (枚举:Australia, Europe, Middle East, US)
beep_enabledcommand_idregionruby
response = client.conferences.actions.leave("id", call_control_id: "c46e06d7-b78f-4b13-96b6-c576af9640ff")
puts(response)返回值: (字符串)
resultMute conference participants
静音会议参会者
Mute a list of participants in a conference call
POST /conferences/{id}/actions/muteOptional: (array[string]), (enum: Australia, Europe, Middle East, US)
call_control_idsregionruby
response = client.conferences.actions.mute("550e8400-e29b-41d4-a716-446655440000")
puts(response)Returns: (string)
result将会议中的指定参会者静音
POST /conferences/{id}/actions/mute可选参数: (字符串数组), (枚举:Australia, Europe, Middle East, US)
call_control_idsregionruby
response = client.conferences.actions.mute("550e8400-e29b-41d4-a716-446655440000")
puts(response)返回值: (字符串)
resultPlay audio to conference participants
向会议参会者播放音频
Play audio to all or some participants on a conference call.
POST /conferences/{id}/actions/playOptional: (string), (array[string]), (string), (string), (enum: Australia, Europe, Middle East, US)
audio_urlcall_control_idsloopmedia_nameregionruby
response = client.conferences.actions.play("550e8400-e29b-41d4-a716-446655440000")
puts(response)Returns: (string)
result向会议的全部或部分参会者播放音频。
POST /conferences/{id}/actions/play可选参数: (字符串), (字符串数组), (字符串), (字符串), (枚举:Australia, Europe, Middle East, US)
audio_urlcall_control_idsloopmedia_nameregionruby
response = client.conferences.actions.play("550e8400-e29b-41d4-a716-446655440000")
puts(response)返回值: (字符串)
resultConference recording pause
暂停会议录制
Pause conference recording.
POST /conferences/{id}/actions/record_pauseOptional: (string), (string), (enum: Australia, Europe, Middle East, US)
command_idrecording_idregionruby
response = client.conferences.actions.record_pause("550e8400-e29b-41d4-a716-446655440000")
puts(response)Returns: (string)
result暂停会议录制。
POST /conferences/{id}/actions/record_pause可选参数: (字符串), (字符串), (枚举:Australia, Europe, Middle East, US)
command_idrecording_idregionruby
response = client.conferences.actions.record_pause("550e8400-e29b-41d4-a716-446655440000")
puts(response)返回值: (字符串)
resultConference recording resume
恢复会议录制
Resume conference recording.
POST /conferences/{id}/actions/record_resumeOptional: (string), (string), (enum: Australia, Europe, Middle East, US)
command_idrecording_idregionruby
response = client.conferences.actions.record_resume("550e8400-e29b-41d4-a716-446655440000")
puts(response)Returns: (string)
result恢复会议录制。
POST /conferences/{id}/actions/record_resume可选参数: (字符串), (字符串), (枚举:Australia, Europe, Middle East, US)
command_idrecording_idregionruby
response = client.conferences.actions.record_resume("550e8400-e29b-41d4-a716-446655440000")
puts(response)返回值: (字符串)
resultConference recording start
开始会议录制
Start recording the conference. Recording will stop on conference end, or via the Stop Recording command. Expected Webhooks:
conference.recording.saved
POST /conferences/{id}/actions/record_startformatOptional: (enum: single, dual), (string), (string), (boolean), (enum: Australia, Europe, Middle East, US), (enum: trim-silence)
channelscommand_idcustom_file_nameplay_beepregiontrimruby
response = client.conferences.actions.record_start("id", format_: :wav)
puts(response)Returns: (string)
result开始录制会议。会议结束时或调用停止录制接口时会自动停止录制。预期Webhook事件:
conference.recording.saved
POST /conferences/{id}/actions/record_startformat可选参数: (枚举:single, dual), (字符串), (字符串), (布尔值), (枚举:Australia, Europe, Middle East, US), (枚举:trim-silence)
channelscommand_idcustom_file_nameplay_beepregiontrimruby
response = client.conferences.actions.record_start("id", format_: :wav)
puts(response)返回值: (字符串)
resultConference recording stop
停止会议录制
Stop recording the conference. Expected Webhooks:
conference.recording.saved
POST /conferences/{id}/actions/record_stopOptional: (string), (string), (uuid), (enum: Australia, Europe, Middle East, US)
client_statecommand_idrecording_idregionruby
response = client.conferences.actions.record_stop("550e8400-e29b-41d4-a716-446655440000")
puts(response)Returns: (string)
result停止录制会议。预期Webhook事件:
conference.recording.saved
POST /conferences/{id}/actions/record_stop可选参数: (字符串), (字符串), (uuid), (枚举:Australia, Europe, Middle East, US)
client_statecommand_idrecording_idregionruby
response = client.conferences.actions.record_stop("550e8400-e29b-41d4-a716-446655440000")
puts(response)返回值: (字符串)
resultSend DTMF to conference participants
向会议参会者发送DTMF
Send DTMF tones to one or more conference participants.
POST /conferences/{id}/actions/send_dtmfdigitsOptional: (array[string]), (string), (integer)
call_control_idsclient_stateduration_millisruby
response = client.conferences.actions.send_dtmf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", digits: "1234#")
puts(response)Returns: (string)
result向一个或多个会议参会者发送DTMF音。
POST /conferences/{id}/actions/send_dtmfdigits可选参数: (字符串数组), (字符串), (整数)
call_control_idsclient_stateduration_millisruby
response = client.conferences.actions.send_dtmf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", digits: "1234#")
puts(response)返回值: (字符串)
resultSpeak text to conference participants
向会议参会者播放语音合成内容
Convert text to speech and play it to all or some participants.
POST /conferences/{id}/actions/speakpayloadvoiceOptional: (array[string]), (string), (enum: arb, cmn-CN, cy-GB, da-DK, de-DE, en-AU, en-GB, en-GB-WLS, en-IN, en-US, es-ES, es-MX, es-US, fr-CA, fr-FR, hi-IN, is-IS, it-IT, ja-JP, ko-KR, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sv-SE, tr-TR), (enum: text, ssml), (enum: Australia, Europe, Middle East, US), (object)
call_control_idscommand_idlanguagepayload_typeregionvoice_settingsruby
response = client.conferences.actions.speak("id", payload: "Say this to participants", voice: "female")
puts(response)Returns: (string)
result将文本转换为语音,向全部或部分参会者播放。
POST /conferences/{id}/actions/speakpayloadvoice可选参数: (字符串数组), (字符串), (枚举:arb, cmn-CN, cy-GB, da-DK, de-DE, en-AU, en-GB, en-GB-WLS, en-IN, en-US, es-ES, es-MX, es-US, fr-CA, fr-FR, hi-IN, is-IS, it-IT, ja-JP, ko-KR, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sv-SE, tr-TR), (枚举:text, ssml), (枚举:Australia, Europe, Middle East, US), (对象)
call_control_idscommand_idlanguagepayload_typeregionvoice_settingsruby
response = client.conferences.actions.speak("id", payload: "Say this to participants", voice: "female")
puts(response)返回值: (字符串)
resultStop audio being played on the conference
停止会议中正在播放的音频
Stop audio being played to all or some participants on a conference call.
POST /conferences/{id}/actions/stopOptional: (array[string]), (enum: Australia, Europe, Middle East, US)
call_control_idsregionruby
response = client.conferences.actions.stop("550e8400-e29b-41d4-a716-446655440000")
puts(response)Returns: (string)
result停止向会议的全部或部分参会者播放音频。
POST /conferences/{id}/actions/stop可选参数: (字符串数组), (枚举:Australia, Europe, Middle East, US)
call_control_idsregionruby
response = client.conferences.actions.stop("550e8400-e29b-41d4-a716-446655440000")
puts(response)返回值: (字符串)
resultUnhold conference participants
取消会议参会者的保持状态
Unhold a list of participants in a conference call
POST /conferences/{id}/actions/unholdcall_control_idsOptional: (enum: Australia, Europe, Middle East, US)
regionruby
response = client.conferences.actions.unhold(
"id",
call_control_ids: ["v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"]
)
puts(response)Returns: (string)
result取消会议中指定参会者的保持状态
POST /conferences/{id}/actions/unholdcall_control_ids可选参数: (枚举:Australia, Europe, Middle East, US)
regionruby
response = client.conferences.actions.unhold(
"id",
call_control_ids: ["v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"]
)
puts(response)返回值: (字符串)
resultUnmute conference participants
取消会议参会者的静音状态
Unmute a list of participants in a conference call
POST /conferences/{id}/actions/unmuteOptional: (array[string]), (enum: Australia, Europe, Middle East, US)
call_control_idsregionruby
response = client.conferences.actions.unmute("550e8400-e29b-41d4-a716-446655440000")
puts(response)Returns: (string)
result取消会议中指定参会者的静音状态
POST /conferences/{id}/actions/unmute可选参数: (字符串数组), (枚举:Australia, Europe, Middle East, US)
call_control_idsregionruby
response = client.conferences.actions.unmute("550e8400-e29b-41d4-a716-446655440000")
puts(response)返回值: (字符串)
resultUpdate conference participant
更新会议参会者权限
Update conference participant supervisor_role
POST /conferences/{id}/actions/updatecall_control_idsupervisor_roleOptional: (string), (enum: Australia, Europe, Middle East, US), (array[string])
command_idregionwhisper_call_control_idsruby
action = client.conferences.actions.update(
"id",
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
supervisor_role: :whisper
)
puts(action)Returns: (string)
result更新会议参会者的supervisor_role权限
POST /conferences/{id}/actions/updatecall_control_idsupervisor_role可选参数: (字符串), (枚举:Australia, Europe, Middle East, US), (字符串数组)
command_idregionwhisper_call_control_idsruby
action = client.conferences.actions.update(
"id",
call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
supervisor_role: :whisper
)
puts(action)返回值: (字符串)
resultRetrieve a conference participant
获取单个参会者详情
Retrieve details of a specific conference participant by their ID or label.
GET /conferences/{id}/participants/{participant_id}ruby
response = client.conferences.retrieve_participant("participant_id", id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(response)Returns: (string), (string), (string), (date-time), (boolean), (string), (string), (boolean), (boolean), (boolean), (enum: joining, joined, left), (date-time), (array[string])
call_control_idcall_leg_idconference_idcreated_atend_conference_on_exitidlabelmutedon_holdsoft_end_conference_on_exitstatusupdated_atwhisper_call_control_ids通过参会者ID或标签查询指定会议参会者的详情。
GET /conferences/{id}/participants/{participant_id}ruby
response = client.conferences.retrieve_participant("participant_id", id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(response)返回值: (字符串), (字符串), (字符串), (date-time), (布尔值), (字符串), (字符串), (布尔值), (布尔值), (布尔值), (枚举:joining, joined, left), (date-time), (字符串数组)
call_control_idcall_leg_idconference_idcreated_atend_conference_on_exitidlabelmutedon_holdsoft_end_conference_on_exitstatusupdated_atwhisper_call_control_idsUpdate a conference participant
更新会议参会者信息
Update properties of a conference participant.
PATCH /conferences/{id}/participants/{participant_id}Optional: (enum: always, never, on_enter, on_exit), (boolean), (boolean)
beep_enabledend_conference_on_exitsoft_end_conference_on_exitruby
response = client.conferences.update_participant("participant_id", id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(response)Returns: (string), (string), (string), (date-time), (boolean), (string), (string), (boolean), (boolean), (boolean), (enum: joining, joined, left), (date-time), (array[string])
call_control_idcall_leg_idconference_idcreated_atend_conference_on_exitidlabelmutedon_holdsoft_end_conference_on_exitstatusupdated_atwhisper_call_control_ids更新会议参会者的属性。
PATCH /conferences/{id}/participants/{participant_id}可选参数: (枚举:always, never, on_enter, on_exit), (布尔值), (布尔值)
beep_enabledend_conference_on_exitsoft_end_conference_on_exitruby
response = client.conferences.update_participant("participant_id", id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(response)返回值: (字符串), (字符串), (字符串), (date-time), (布尔值), (字符串), (字符串), (布尔值), (布尔值), (布尔值), (枚举:joining, joined, left), (date-time), (字符串数组)
call_control_idcall_leg_idconference_idcreated_atend_conference_on_exitidlabelmutedon_holdsoft_end_conference_on_exitstatusupdated_atwhisper_call_control_idsList queues
查询队列列表
List all queues for the authenticated user.
GET /queuesruby
page = client.queues.list
puts(page)Returns: (integer), (string), (integer), (string), (integer), (string), (enum: queue), (string)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_at查询当前认证用户的所有队列。
GET /queuesruby
page = client.queues.list
puts(page)返回值: (整数), (字符串), (整数), (字符串), (整数), (字符串), (枚举:queue), (字符串)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_atCreate a queue
创建队列
Create a new call queue.
POST /queuesqueue_nameOptional: (integer)
max_sizeruby
queue = client.queues.create(queue_name: "tier_1_support")
puts(queue)Returns: (integer), (string), (integer), (string), (integer), (string), (enum: queue), (string)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_at创建新的呼叫队列。
POST /queuesqueue_name可选参数: (整数)
max_sizeruby
queue = client.queues.create(queue_name: "tier_1_support")
puts(queue)返回值: (整数), (字符串), (整数), (字符串), (整数), (字符串), (枚举:queue), (字符串)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_atRetrieve a call queue
查询单个呼叫队列详情
Retrieve an existing call queue
GET /queues/{queue_name}ruby
queue = client.queues.retrieve("queue_name")
puts(queue)Returns: (integer), (string), (integer), (string), (integer), (string), (enum: queue), (string)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_at查询已存在的呼叫队列的详情
GET /queues/{queue_name}ruby
queue = client.queues.retrieve("queue_name")
puts(queue)返回值: (整数), (字符串), (整数), (字符串), (整数), (字符串), (枚举:queue), (字符串)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_atUpdate a queue
更新队列
Update properties of an existing call queue.
POST /queues/{queue_name}max_sizeruby
queue = client.queues.update("queue_name", max_size: 200)
puts(queue)Returns: (integer), (string), (integer), (string), (integer), (string), (enum: queue), (string)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_at更新已存在的呼叫队列的属性。
POST /queues/{queue_name}max_sizeruby
queue = client.queues.update("queue_name", max_size: 200)
puts(queue)返回值: (整数), (字符串), (整数), (字符串), (整数), (字符串), (枚举:queue), (字符串)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_atDelete a queue
删除队列
Delete an existing call queue.
DELETE /queues/{queue_name}ruby
result = client.queues.delete("queue_name")
puts(result)删除已存在的呼叫队列。
DELETE /queues/{queue_name}ruby
result = client.queues.delete("queue_name")
puts(result)Retrieve calls from a queue
查询队列中的通话列表
Retrieve the list of calls in an existing queue
GET /queues/{queue_name}/callsruby
page = client.queues.calls.list("queue_name")
puts(page)Returns: (string), (string), (string), (string), (string), (string), (boolean), (string), (integer), (enum: queue_call), (string), (integer)
call_control_idcall_leg_idcall_session_idconnection_idenqueued_atfromis_alivequeue_idqueue_positionrecord_typetowait_time_secs查询现有队列中的通话列表
GET /queues/{queue_name}/callsruby
page = client.queues.calls.list("queue_name")
puts(page)返回值: (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (布尔值), (字符串), (整数), (枚举:queue_call), (字符串), (整数)
call_control_idcall_leg_idcall_session_idconnection_idenqueued_atfromis_alivequeue_idqueue_positionrecord_typetowait_time_secsRetrieve a call from a queue
查询队列中的单个通话详情
Retrieve an existing call from an existing queue
GET /queues/{queue_name}/calls/{call_control_id}ruby
call = client.queues.calls.retrieve("call_control_id", queue_name: "my-queue")
puts(call)Returns: (string), (string), (string), (string), (string), (string), (boolean), (string), (integer), (enum: queue_call), (string), (integer)
call_control_idcall_leg_idcall_session_idconnection_idenqueued_atfromis_alivequeue_idqueue_positionrecord_typetowait_time_secs查询现有队列中的指定通话详情
GET /queues/{queue_name}/calls/{call_control_id}ruby
call = client.queues.calls.retrieve("call_control_id", queue_name: "my-queue")
puts(call)返回值: (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (布尔值), (字符串), (整数), (枚举:queue_call), (字符串), (整数)
call_control_idcall_leg_idcall_session_idconnection_idenqueued_atfromis_alivequeue_idqueue_positionrecord_typetowait_time_secsUpdate queued call
更新队列中通话的属性
Update queued call's keep_after_hangup flag
PATCH /queues/{queue_name}/calls/{call_control_id}Optional: (boolean)
keep_after_hangupruby
result = client.queues.calls.update("call_control_id", queue_name: "my-queue")
puts(result)更新队列中通话的keep_after_hangup标记
PATCH /queues/{queue_name}/calls/{call_control_id}可选参数: (布尔值)
keep_after_hangupruby
result = client.queues.calls.update("call_control_id", queue_name: "my-queue")
puts(result)Force remove a call from a queue
强制将通话移出队列
Removes an inactive call from a queue. If the call is no longer active, use this command to remove it from the queue.
DELETE /queues/{queue_name}/calls/{call_control_id}ruby
result = client.queues.calls.remove("call_control_id", queue_name: "my-queue")
puts(result)从队列中移除不活跃的通话。如果通话已经不再活跃,可以使用该接口将其从队列中移除。
DELETE /queues/{queue_name}/calls/{call_control_id}ruby
result = client.queues.calls.remove("call_control_id", queue_name: "my-queue")
puts(result)Webhooks
Webhooks
Webhook Verification
Webhook 验证
Telnyx signs webhooks with Ed25519. Each request includes
and headers. Always verify signatures in production:
telnyx-signature-ed25519telnyx-timestampruby
undefinedTelnyx使用Ed25519对Webhook进行签名,每个请求都会携带和请求头。生产环境中请务必验证签名:
telnyx-signature-ed25519telnyx-timestampruby
undefinedIn your webhook handler (e.g., Sinatra — use raw body):
在你的Webhook处理逻辑中(例如Sinatra — 使用原始请求体):
post "/webhooks" do
payload = request.body.read
headers = {
"telnyx-signature-ed25519" => request.env["HTTP_TELNYX_SIGNATURE_ED25519"],
"telnyx-timestamp" => request.env["HTTP_TELNYX_TIMESTAMP"],
}
begin
event = client.webhooks.unwrap(payload, headers)
rescue => e
halt 400, "Invalid signature: #{e.message}"
end
Signature valid — event is the parsed webhook payload
puts "Received event: #{event.data.event_type}"
status 200
end
The following webhook events are sent to your configured webhook URL.
All webhooks include `telnyx-timestamp` and `telnyx-signature-ed25519` headers for Ed25519 signature verification. Use `client.webhooks.unwrap()` to verify.
| Event | Description |
|-------|-------------|
| `callEnqueued` | Call Enqueued |
| `callLeftQueue` | Call Left Queue |
| `conferenceCreated` | Conference Created |
| `conferenceEnded` | Conference Ended |
| `conferenceFloorChanged` | Conference Floor Changed |
| `conferenceParticipantJoined` | Conference Participant Joined |
| `conferenceParticipantLeft` | Conference Participant Left |
| `conferenceParticipantPlaybackEnded` | Conference Participant Playback Ended |
| `conferenceParticipantPlaybackStarted` | Conference Participant Playback Started |
| `conferenceParticipantSpeakEnded` | Conference Participant Speak Ended |
| `conferenceParticipantSpeakStarted` | Conference Participant Speak Started |
| `conferencePlaybackEnded` | Conference Playback Ended |
| `conferencePlaybackStarted` | Conference Playback Started |
| `conferenceRecordingSaved` | Conference Recording Saved |
| `conferenceSpeakEnded` | Conference Speak Ended |
| `conferenceSpeakStarted` | Conference Speak Started |post "/webhooks" do
payload = request.body.read
headers = {
"telnyx-signature-ed25519" => request.env["HTTP_TELNYX_SIGNATURE_ED25519"],
"telnyx-timestamp" => request.env["HTTP_TELNYX_TIMESTAMP"],
}
begin
event = client.webhooks.unwrap(payload, headers)
rescue => e
halt 400, "无效签名: #{e.message}"
end
签名验证通过 — event是解析后的Webhook payload
puts "收到事件: #{event.data.event_type}"
status 200
end
以下Webhook事件会发送到你配置的Webhook地址。所有Webhook都携带`telnyx-timestamp`和`telnyx-signature-ed25519`请求头用于Ed25519签名验证,可以使用`client.webhooks.unwrap()`进行验证。
| 事件 | 描述 |
|-------|-------------|
| `callEnqueued` | 通话已入列 |
| `callLeftQueue` | 通话已出列 |
| `conferenceCreated` | 会议已创建 |
| `conferenceEnded` | 会议已结束 |
| `conferenceFloorChanged` | 会议发言权限变更 |
| `conferenceParticipantJoined` | 参会者已加入会议 |
| `conferenceParticipantLeft` | 参会者已离开会议 |
| `conferenceParticipantPlaybackEnded` | 参会者侧音频播放结束 |
| `conferenceParticipantPlaybackStarted` | 参会者侧音频播放开始 |
| `conferenceParticipantSpeakEnded` | 参会者侧语音合成播放结束 |
| `conferenceParticipantSpeakStarted` | 参会者侧语音合成播放开始 |
| `conferencePlaybackEnded` | 会议全局音频播放结束 |
| `conferencePlaybackStarted` | 会议全局音频播放开始 |
| `conferenceRecordingSaved` | 会议录制文件已保存 |
| `conferenceSpeakEnded` | 会议全局语音合成播放结束 |
| `conferenceSpeakStarted` | 会议全局语音合成播放开始 |Webhook payload fields
Webhook payload 字段
callEnqueued| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.enqueued | 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 | The name of the queue |
| integer | Current position of the call in the queue. |
| integer | Average time call spends in the queue in seconds. |
callLeftQueue| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.dequeued | 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 | The name of the queue |
| integer | Last position of the call in the queue. |
| enum: bridged, bridging-in-process, hangup, leave, timeout | The reason for leaving the queue |
| integer | Time call spent in the queue in seconds. |
conferenceCreated| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.created | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| 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 | Conference ID that the participant joined. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| 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 | Conference ID that the participant joined. |
| date-time | ISO 8601 datetime of when the event occurred. |
| enum: all_left, host_left, time_exceeded | Reason the conference ended. |
conferenceFloorChanged| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.floor.changed | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control ID of the new speaker. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | Call Leg ID of the new speaker. |
| string | Call Session ID of the new speaker. |
| string | State received from a command. |
| string | Conference ID that had a speaker change event. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantJoined| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.joined | 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 | Conference ID that the participant joined. |
conferenceParticipantLeft| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.left | 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 | Conference ID that the participant joined. |
conferenceParticipantPlaybackEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.playback.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| 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 | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantPlaybackStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.playback.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| 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 | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantSpeakEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.speak.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| 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 | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantSpeakStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.speak.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| 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 | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferencePlaybackEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.playback.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferencePlaybackStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.playback.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceRecordingSaved| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.recording.saved | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| enum: single, dual | Whether recording was recorded in |
| uuid | ID of the conference that is being recorded. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| enum: wav, mp3 | The audio file format used when storing the call recording. |
| date-time | ISO 8601 datetime of when recording ended. |
| uuid | ID of the conference recording. |
| date-time | ISO 8601 datetime of when recording started. |
conferenceSpeakEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.speak.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceSpeakStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.speak.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
callEnqueued| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:call.enqueued | 推送的事件类型 |
| uuid | 标识资源类型 |
| date-time | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过呼叫控制API下发指令的通话ID |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 队列名称 |
| 整数 | 通话在队列中的当前位置 |
| 整数 | 队列中通话的平均等待时长,单位秒 |
callLeftQueue| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:call.dequeued | 推送的事件类型 |
| uuid | 标识资源类型 |
| date-time | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过呼叫控制API下发指令的通话ID |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 队列名称 |
| 整数 | 通话在队列中的最后位置 |
| 枚举:bridged, bridging-in-process, hangup, leave, timeout | 离开队列的原因 |
| 整数 | 通话在队列中的等待时长,单位秒 |
conferenceCreated| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.created | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 用于通过呼叫控制API下发指令的通话ID |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 参会者加入的会议ID |
| date-time | 事件发生的ISO 8601格式时间 |
conferenceEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.ended | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 用于通过呼叫控制API下发指令的通话ID |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 参会者加入的会议ID |
| date-time | 事件发生的ISO 8601格式时间 |
| 枚举:all_left, host_left, time_exceeded | 会议结束的原因 |
conferenceFloorChanged| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.floor.changed | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 新发言人的呼叫控制ID |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 新发言人的通话支路ID |
| 字符串 | 新发言人的通话会话ID |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 发生发言人变更的会议ID |
| date-time | 事件发生的ISO 8601格式时间 |
conferenceParticipantJoined| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.participant.joined | 推送的事件类型 |
| uuid | 标识资源类型 |
| date-time | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过呼叫控制API下发指令的通话ID |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 参会者加入的会议ID |
conferenceParticipantLeft| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.participant.left | 推送的事件类型 |
| uuid | 标识资源类型 |
| date-time | 事件发生的ISO 8601格式时间 |
| 字符串 | 用于通过呼叫控制API下发指令的通话ID |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 参会者加入的会议ID |
conferenceParticipantPlaybackEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.participant.playback.ended | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 参会者的呼叫控制ID,用于通过呼叫控制API下发指令 |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 发起会议的通话会话的唯一ID |
| 字符串 | 播放音频的会议ID |
| 字符串 | 播放的音频URL(通过audio_url启动播放时存在) |
| 字符串 | 播放的音频媒体文件名称(通过media_name启动播放时存在) |
| date-time | 事件发生的ISO 8601格式时间 |
conferenceParticipantPlaybackStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.participant.playback.started | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 参会者的呼叫控制ID,用于通过呼叫控制API下发指令 |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 发起会议的通话会话的唯一ID |
| 字符串 | 播放音频的会议ID |
| 字符串 | 播放的音频URL(通过audio_url启动播放时存在) |
| 字符串 | 播放的音频媒体文件名称(通过media_name启动播放时存在) |
| date-time | 事件发生的ISO 8601格式时间 |
conferenceParticipantSpeakEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.participant.speak.ended | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 参会者的呼叫控制ID,用于通过呼叫控制API下发指令 |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 发起会议的通话会话的唯一ID |
| 字符串 | 播放语音合成内容的会议ID |
| date-time | 事件发生的ISO 8601格式时间 |
conferenceParticipantSpeakStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.participant.speak.started | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 参会者的呼叫控制ID,用于通过呼叫控制API下发指令 |
| 字符串 | 通话唯一ID,可用于关联Webhook事件 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 发起会议的通话会话的唯一ID |
| 字符串 | 播放语音合成内容的会议ID |
| date-time | 事件发生的ISO 8601格式时间 |
conferencePlaybackEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.playback.ended | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 发起会议的通话会话的唯一ID |
| 字符串 | 播放音频的会议ID |
| 字符串 | 播放的音频URL(通过audio_url启动播放时存在) |
| 字符串 | 播放的音频媒体文件名称(通过media_name启动播放时存在) |
| date-time | 事件发生的ISO 8601格式时间 |
conferencePlaybackStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.playback.started | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 发起会议的通话会话的唯一ID |
| 字符串 | 播放音频的会议ID |
| 字符串 | 播放的音频URL(通过audio_url启动播放时存在) |
| 字符串 | 播放的音频媒体文件名称(通过media_name启动播放时存在) |
| date-time | 事件发生的ISO 8601格式时间 |
conferenceRecordingSaved| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.recording.saved | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 参会者的呼叫控制ID,用于通过呼叫控制API下发指令 |
| 字符串 | 通话会话唯一ID,可用于关联Webhook事件 |
| 字符串 | 从指令中获取的状态信息 |
| 枚举:single, dual | 录制的声道类型:单声道 |
| uuid | 被录制的会议ID |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 枚举:wav, mp3 | 通话录制的音频文件存储格式 |
| date-time | 录制结束的ISO 8601格式时间 |
| uuid | 会议录制的ID |
| date-time | 录制开始的ISO 8601格式时间 |
conferenceSpeakEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.speak.ended | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 发起会议的通话会话的唯一ID |
| 字符串 | 播放语音合成内容的会议ID |
| date-time | 事件发生的ISO 8601格式时间 |
conferenceSpeakStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举:event | 标识资源类型 |
| 枚举:conference.speak.started | 推送的事件类型 |
| uuid | 标识资源类型 |
| 字符串 | 通话使用的呼叫控制应用ID(原Telnyx连接ID) |
| 字符串 | 发起会议的通话会话的唯一ID |
| 字符串 | 播放语音合成内容的会议ID |
| date-time | 事件发生的ISO 8601格式时间 |