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 telnyx
bash
gem install telnyx

Setup

配置

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
client
is already initialized as shown above.
ruby
require "telnyx"

client = Telnyx::Client.new(
  api_key: ENV["TELNYX_API_KEY"], # 这是默认配置,可以省略
)
以下所有示例都默认
client
已经按照上面的方式完成初始化。

Error 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
end
Common error codes:
401
invalid API key,
403
insufficient permissions,
404
resource not found,
422
validation error (check field formats),
429
rate limited (retry with exponential backoff).
所有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
常见错误码:
401
API密钥无效,
403
权限不足,
404
资源不存在,
422
验证错误(请检查字段格式),
429
触发限流(请使用指数退避策略重试)。

Important Notes

重要说明

  • Pagination: Use
    .auto_paging_each
    for automatic iteration:
    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/enqueue
— Required:
queue_name
Optional:
client_state
(string),
command_id
(string),
keep_after_hangup
(boolean),
max_size
(integer),
max_wait_time_secs
(integer)
ruby
response = client.calls.actions.enqueue("call_control_id", queue_name: "support")

puts(response)
Returns:
result
(string)
将通话加入队列。
POST /calls/{call_control_id}/actions/enqueue
— 必填参数:
queue_name
可选参数:
client_state
(字符串),
command_id
(字符串),
keep_after_hangup
(布尔值),
max_size
(整数),
max_wait_time_secs
(整数)
ruby
response = client.calls.actions.enqueue("call_control_id", queue_name: "support")

puts(response)
返回值:
result
(字符串)

Remove call from a queue

将通话移出队列

Removes the call from a queue.
POST /calls/{call_control_id}/actions/leave_queue
Optional:
client_state
(string),
command_id
(string)
ruby
response = client.calls.actions.leave_queue("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")

puts(response)
Returns:
result
(string)
将通话从队列中移除。
POST /calls/{call_control_id}/actions/leave_queue
可选参数:
client_state
(字符串),
command_id
(字符串)
ruby
response = client.calls.actions.leave_queue("v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ")

puts(response)
返回值:
result
(字符串)

List 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_at
.
GET /conferences
ruby
page = client.conferences.list

puts(page)
Returns:
connection_id
(string),
created_at
(string),
end_reason
(enum: all_left, ended_via_api, host_left, time_exceeded),
ended_by
(object),
expires_at
(string),
id
(string),
name
(string),
record_type
(enum: conference),
region
(string),
status
(enum: init, in_progress, completed),
updated_at
(string)
查询会议列表。会议为按需创建,所有参会者离开后自动过期,无论参会人数多少,最长存续时间为4小时。会议列表按照
expires_at
字段倒序排列。
GET /conferences
ruby
page = client.conferences.list

puts(page)
返回值:
connection_id
(字符串),
created_at
(字符串),
end_reason
(枚举:all_left, ended_via_api, host_left, time_exceeded),
ended_by
(对象),
expires_at
(字符串),
id
(字符串),
name
(字符串),
record_type
(枚举:conference),
region
(字符串),
status
(枚举:init, in_progress, completed),
updated_at
(字符串)

Create conference

创建会议

Create a conference from an existing call leg using a
call_control_id
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.
POST /conferences
— Required:
call_control_id
,
name
Optional:
beep_enabled
(enum: always, never, on_enter, on_exit),
client_state
(string),
comfort_noise
(boolean),
command_id
(string),
duration_minutes
(integer),
hold_audio_url
(string),
hold_media_name
(string),
max_participants
(integer),
region
(enum: Australia, Europe, Middle East, US),
start_conference_on_create
(boolean)
ruby
conference = client.conferences.create(
  call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
  name: "Business"
)

puts(conference)
Returns:
connection_id
(string),
created_at
(string),
end_reason
(enum: all_left, ended_via_api, host_left, time_exceeded),
ended_by
(object),
expires_at
(string),
id
(string),
name
(string),
record_type
(enum: conference),
region
(string),
status
(enum: init, in_progress, completed),
updated_at
(string)
使用
call_control_id
和会议名称,从已有的通话支路创建会议。创建完成后,该通话会自动桥接到会议中。所有参会者离开后会议自动过期,无论参会人数多少,最长存续时间为4小时。
POST /conferences
— 必填参数:
call_control_id
,
name
可选参数:
beep_enabled
(枚举:always, never, on_enter, on_exit),
client_state
(字符串),
comfort_noise
(布尔值),
command_id
(字符串),
duration_minutes
(整数),
hold_audio_url
(字符串),
hold_media_name
(字符串),
max_participants
(整数),
region
(枚举:Australia, Europe, Middle East, US),
start_conference_on_create
(布尔值)
ruby
conference = client.conferences.create(
  call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
  name: "Business"
)

puts(conference)
返回值:
connection_id
(字符串),
created_at
(字符串),
end_reason
(枚举:all_left, ended_via_api, host_left, time_exceeded),
ended_by
(对象),
expires_at
(字符串),
id
(字符串),
name
(字符串),
record_type
(枚举:conference),
region
(字符串),
status
(枚举:init, in_progress, completed),
updated_at
(字符串)

List conference participants

查询会议参会者列表

Lists conference participants
GET /conferences/{conference_id}/participants
ruby
page = client.conferences.list_participants("550e8400-e29b-41d4-a716-446655440000")

puts(page)
Returns:
call_control_id
(string),
call_leg_id
(string),
conference
(object),
created_at
(string),
end_conference_on_exit
(boolean),
id
(string),
muted
(boolean),
on_hold
(boolean),
record_type
(enum: participant),
soft_end_conference_on_exit
(boolean),
status
(enum: joining, joined, left),
updated_at
(string),
whisper_call_control_ids
(array[string])
查询会议的参会者列表
GET /conferences/{conference_id}/participants
ruby
page = client.conferences.list_participants("550e8400-e29b-41d4-a716-446655440000")

puts(page)
返回值:
call_control_id
(字符串),
call_leg_id
(字符串),
conference
(对象),
created_at
(字符串),
end_conference_on_exit
(布尔值),
id
(字符串),
muted
(布尔值),
on_hold
(布尔值),
record_type
(枚举:participant),
soft_end_conference_on_exit
(布尔值),
status
(枚举:joining, joined, left),
updated_at
(字符串),
whisper_call_control_ids
(字符串数组)

Retrieve a conference

获取单个会议详情

Retrieve an existing conference
GET /conferences/{id}
ruby
conference = client.conferences.retrieve("550e8400-e29b-41d4-a716-446655440000")

puts(conference)
Returns:
connection_id
(string),
created_at
(string),
end_reason
(enum: all_left, ended_via_api, host_left, time_exceeded),
ended_by
(object),
expires_at
(string),
id
(string),
name
(string),
record_type
(enum: conference),
region
(string),
status
(enum: init, in_progress, completed),
updated_at
(string)
查询已存在的会议的详情
GET /conferences/{id}
ruby
conference = client.conferences.retrieve("550e8400-e29b-41d4-a716-446655440000")

puts(conference)
返回值:
connection_id
(字符串),
created_at
(字符串),
end_reason
(枚举:all_left, ended_via_api, host_left, time_exceeded),
ended_by
(对象),
expires_at
(字符串),
id
(字符串),
name
(字符串),
record_type
(枚举:conference),
region
(字符串),
status
(枚举:init, in_progress, completed),
updated_at
(字符串)

End a conference

结束会议

End a conference and terminate all active participants.
POST /conferences/{id}/actions/end
Optional:
command_id
(string)
ruby
response = client.conferences.actions.end_conference("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

puts(response)
Returns:
result
(string)
结束会议并终止所有活跃参会者的连接。
POST /conferences/{id}/actions/end
可选参数:
command_id
(字符串)
ruby
response = client.conferences.actions.end_conference("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

puts(response)
返回值:
result
(字符串)

Gather 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_audio
— Required:
call_control_id
Optional:
audio_url
(string),
client_state
(string),
gather_id
(string),
initial_timeout_millis
(integer),
inter_digit_timeout_millis
(integer),
invalid_audio_url
(string),
invalid_media_name
(string),
maximum_digits
(integer),
maximum_tries
(integer),
media_name
(string),
minimum_digits
(integer),
stop_playback_on_dtmf
(boolean),
terminating_digit
(string),
timeout_millis
(integer),
valid_digits
(string)
ruby
response = client.conferences.actions.gather_dtmf_audio(
  "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)

puts(response)
Returns:
result
(string)
向指定的会议参会者播放音频文件并收集DTMF输入。
POST /conferences/{id}/actions/gather_using_audio
— 必填参数:
call_control_id
可选参数:
audio_url
(字符串),
client_state
(字符串),
gather_id
(字符串),
initial_timeout_millis
(整数),
inter_digit_timeout_millis
(整数),
invalid_audio_url
(字符串),
invalid_media_name
(字符串),
maximum_digits
(整数),
maximum_tries
(整数),
media_name
(字符串),
minimum_digits
(整数),
stop_playback_on_dtmf
(布尔值),
terminating_digit
(字符串),
timeout_millis
(整数),
valid_digits
(字符串)
ruby
response = client.conferences.actions.gather_dtmf_audio(
  "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)

puts(response)
返回值:
result
(字符串)

Hold conference participants

保持会议参会者

Hold a list of participants in a conference call
POST /conferences/{id}/actions/hold
Optional:
audio_url
(string),
call_control_ids
(array[string]),
media_name
(string),
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.hold("550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
result
(string)
将会议中的指定参会者置为保持状态
POST /conferences/{id}/actions/hold
可选参数:
audio_url
(字符串),
call_control_ids
(字符串数组),
media_name
(字符串),
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.hold("550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回值:
result
(字符串)

Join a conference

加入会议

Join an existing call leg to a conference. Issue the Join Conference command with the conference ID in the path and the
call_control_id
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
max_participants
parameter in conference creation request.
POST /conferences/{id}/actions/join
— Required:
call_control_id
Optional:
beep_enabled
(enum: always, never, on_enter, on_exit),
client_state
(string),
command_id
(string),
end_conference_on_exit
(boolean),
hold
(boolean),
hold_audio_url
(string),
hold_media_name
(string),
mute
(boolean),
region
(enum: Australia, Europe, Middle East, US),
soft_end_conference_on_exit
(boolean),
start_conference_on_enter
(boolean),
supervisor_role
(enum: barge, monitor, none, whisper),
whisper_call_control_ids
(array[string])
ruby
response = client.conferences.actions.join(
  "id",
  call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)

puts(response)
Returns:
result
(string)
将已有的通话支路加入会议。调用加入会议接口时,路径参数传入会议ID,属性中传入要加入会议的通话支路的
call_control_id
即可。会议的最大活跃参会人数由创建会议时设置的
max_participants
参数决定。
POST /conferences/{id}/actions/join
— 必填参数:
call_control_id
可选参数:
beep_enabled
(枚举:always, never, on_enter, on_exit),
client_state
(字符串),
command_id
(字符串),
end_conference_on_exit
(布尔值),
hold
(布尔值),
hold_audio_url
(字符串),
hold_media_name
(字符串),
mute
(布尔值),
region
(枚举:Australia, Europe, Middle East, US),
soft_end_conference_on_exit
(布尔值),
start_conference_on_enter
(布尔值),
supervisor_role
(枚举:barge, monitor, none, whisper),
whisper_call_control_ids
(字符串数组)
ruby
response = client.conferences.actions.join(
  "id",
  call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
)

puts(response)
返回值:
result
(字符串)

Leave 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/leave
— Required:
call_control_id
Optional:
beep_enabled
(enum: always, never, on_enter, on_exit),
command_id
(string),
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.leave("id", call_control_id: "c46e06d7-b78f-4b13-96b6-c576af9640ff")

puts(response)
Returns:
result
(string)
将通话支路从会议中移除,回到驻留状态。预期Webhook事件:
  • conference.participant.left
POST /conferences/{id}/actions/leave
— 必填参数:
call_control_id
可选参数:
beep_enabled
(枚举:always, never, on_enter, on_exit),
command_id
(字符串),
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.leave("id", call_control_id: "c46e06d7-b78f-4b13-96b6-c576af9640ff")

puts(response)
返回值:
result
(字符串)

Mute conference participants

静音会议参会者

Mute a list of participants in a conference call
POST /conferences/{id}/actions/mute
Optional:
call_control_ids
(array[string]),
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.mute("550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
result
(string)
将会议中的指定参会者静音
POST /conferences/{id}/actions/mute
可选参数:
call_control_ids
(字符串数组),
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.mute("550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回值:
result
(字符串)

Play audio to conference participants

向会议参会者播放音频

Play audio to all or some participants on a conference call.
POST /conferences/{id}/actions/play
Optional:
audio_url
(string),
call_control_ids
(array[string]),
loop
(string),
media_name
(string),
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.play("550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
result
(string)
向会议的全部或部分参会者播放音频。
POST /conferences/{id}/actions/play
可选参数:
audio_url
(字符串),
call_control_ids
(字符串数组),
loop
(字符串),
media_name
(字符串),
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.play("550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回值:
result
(字符串)

Conference recording pause

暂停会议录制

Pause conference recording.
POST /conferences/{id}/actions/record_pause
Optional:
command_id
(string),
recording_id
(string),
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.record_pause("550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
result
(string)
暂停会议录制。
POST /conferences/{id}/actions/record_pause
可选参数:
command_id
(字符串),
recording_id
(字符串),
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.record_pause("550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回值:
result
(字符串)

Conference recording resume

恢复会议录制

Resume conference recording.
POST /conferences/{id}/actions/record_resume
Optional:
command_id
(string),
recording_id
(string),
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.record_resume("550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
result
(string)
恢复会议录制。
POST /conferences/{id}/actions/record_resume
可选参数:
command_id
(字符串),
recording_id
(字符串),
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.record_resume("550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回值:
result
(字符串)

Conference 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_start
— Required:
format
Optional:
channels
(enum: single, dual),
command_id
(string),
custom_file_name
(string),
play_beep
(boolean),
region
(enum: Australia, Europe, Middle East, US),
trim
(enum: trim-silence)
ruby
response = client.conferences.actions.record_start("id", format_: :wav)

puts(response)
Returns:
result
(string)
开始录制会议。会议结束时或调用停止录制接口时会自动停止录制。预期Webhook事件:
  • conference.recording.saved
POST /conferences/{id}/actions/record_start
— 必填参数:
format
可选参数:
channels
(枚举:single, dual),
command_id
(字符串),
custom_file_name
(字符串),
play_beep
(布尔值),
region
(枚举:Australia, Europe, Middle East, US),
trim
(枚举:trim-silence)
ruby
response = client.conferences.actions.record_start("id", format_: :wav)

puts(response)
返回值:
result
(字符串)

Conference recording stop

停止会议录制

Stop recording the conference. Expected Webhooks:
  • conference.recording.saved
POST /conferences/{id}/actions/record_stop
Optional:
client_state
(string),
command_id
(string),
recording_id
(uuid),
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.record_stop("550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
result
(string)
停止录制会议。预期Webhook事件:
  • conference.recording.saved
POST /conferences/{id}/actions/record_stop
可选参数:
client_state
(字符串),
command_id
(字符串),
recording_id
(uuid),
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.record_stop("550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回值:
result
(字符串)

Send DTMF to conference participants

向会议参会者发送DTMF

Send DTMF tones to one or more conference participants.
POST /conferences/{id}/actions/send_dtmf
— Required:
digits
Optional:
call_control_ids
(array[string]),
client_state
(string),
duration_millis
(integer)
ruby
response = client.conferences.actions.send_dtmf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", digits: "1234#")

puts(response)
Returns:
result
(string)
向一个或多个会议参会者发送DTMF音。
POST /conferences/{id}/actions/send_dtmf
— 必填参数:
digits
可选参数:
call_control_ids
(字符串数组),
client_state
(字符串),
duration_millis
(整数)
ruby
response = client.conferences.actions.send_dtmf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", digits: "1234#")

puts(response)
返回值:
result
(字符串)

Speak text to conference participants

向会议参会者播放语音合成内容

Convert text to speech and play it to all or some participants.
POST /conferences/{id}/actions/speak
— Required:
payload
,
voice
Optional:
call_control_ids
(array[string]),
command_id
(string),
language
(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),
payload_type
(enum: text, ssml),
region
(enum: Australia, Europe, Middle East, US),
voice_settings
(object)
ruby
response = client.conferences.actions.speak("id", payload: "Say this to participants", voice: "female")

puts(response)
Returns:
result
(string)
将文本转换为语音,向全部或部分参会者播放。
POST /conferences/{id}/actions/speak
— 必填参数:
payload
,
voice
可选参数:
call_control_ids
(字符串数组),
command_id
(字符串),
language
(枚举: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),
payload_type
(枚举:text, ssml),
region
(枚举:Australia, Europe, Middle East, US),
voice_settings
(对象)
ruby
response = client.conferences.actions.speak("id", payload: "Say this to participants", voice: "female")

puts(response)
返回值:
result
(字符串)

Stop audio being played on the conference

停止会议中正在播放的音频

Stop audio being played to all or some participants on a conference call.
POST /conferences/{id}/actions/stop
Optional:
call_control_ids
(array[string]),
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.stop("550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
result
(string)
停止向会议的全部或部分参会者播放音频。
POST /conferences/{id}/actions/stop
可选参数:
call_control_ids
(字符串数组),
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.stop("550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回值:
result
(字符串)

Unhold conference participants

取消会议参会者的保持状态

Unhold a list of participants in a conference call
POST /conferences/{id}/actions/unhold
— Required:
call_control_ids
Optional:
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.unhold(
  "id",
  call_control_ids: ["v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"]
)

puts(response)
Returns:
result
(string)
取消会议中指定参会者的保持状态
POST /conferences/{id}/actions/unhold
— 必填参数:
call_control_ids
可选参数:
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.unhold(
  "id",
  call_control_ids: ["v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"]
)

puts(response)
返回值:
result
(字符串)

Unmute conference participants

取消会议参会者的静音状态

Unmute a list of participants in a conference call
POST /conferences/{id}/actions/unmute
Optional:
call_control_ids
(array[string]),
region
(enum: Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.unmute("550e8400-e29b-41d4-a716-446655440000")

puts(response)
Returns:
result
(string)
取消会议中指定参会者的静音状态
POST /conferences/{id}/actions/unmute
可选参数:
call_control_ids
(字符串数组),
region
(枚举:Australia, Europe, Middle East, US)
ruby
response = client.conferences.actions.unmute("550e8400-e29b-41d4-a716-446655440000")

puts(response)
返回值:
result
(字符串)

Update conference participant

更新会议参会者权限

Update conference participant supervisor_role
POST /conferences/{id}/actions/update
— Required:
call_control_id
,
supervisor_role
Optional:
command_id
(string),
region
(enum: Australia, Europe, Middle East, US),
whisper_call_control_ids
(array[string])
ruby
action = client.conferences.actions.update(
  "id",
  call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
  supervisor_role: :whisper
)

puts(action)
Returns:
result
(string)
更新会议参会者的supervisor_role权限
POST /conferences/{id}/actions/update
— 必填参数:
call_control_id
,
supervisor_role
可选参数:
command_id
(字符串),
region
(枚举:Australia, Europe, Middle East, US),
whisper_call_control_ids
(字符串数组)
ruby
action = client.conferences.actions.update(
  "id",
  call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
  supervisor_role: :whisper
)

puts(action)
返回值:
result
(字符串)

Retrieve 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:
call_control_id
(string),
call_leg_id
(string),
conference_id
(string),
created_at
(date-time),
end_conference_on_exit
(boolean),
id
(string),
label
(string),
muted
(boolean),
on_hold
(boolean),
soft_end_conference_on_exit
(boolean),
status
(enum: joining, joined, left),
updated_at
(date-time),
whisper_call_control_ids
(array[string])
通过参会者ID或标签查询指定会议参会者的详情。
GET /conferences/{id}/participants/{participant_id}
ruby
response = client.conferences.retrieve_participant("participant_id", id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

puts(response)
返回值:
call_control_id
(字符串),
call_leg_id
(字符串),
conference_id
(字符串),
created_at
(date-time),
end_conference_on_exit
(布尔值),
id
(字符串),
label
(字符串),
muted
(布尔值),
on_hold
(布尔值),
soft_end_conference_on_exit
(布尔值),
status
(枚举:joining, joined, left),
updated_at
(date-time),
whisper_call_control_ids
(字符串数组)

Update a conference participant

更新会议参会者信息

Update properties of a conference participant.
PATCH /conferences/{id}/participants/{participant_id}
Optional:
beep_enabled
(enum: always, never, on_enter, on_exit),
end_conference_on_exit
(boolean),
soft_end_conference_on_exit
(boolean)
ruby
response = client.conferences.update_participant("participant_id", id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

puts(response)
Returns:
call_control_id
(string),
call_leg_id
(string),
conference_id
(string),
created_at
(date-time),
end_conference_on_exit
(boolean),
id
(string),
label
(string),
muted
(boolean),
on_hold
(boolean),
soft_end_conference_on_exit
(boolean),
status
(enum: joining, joined, left),
updated_at
(date-time),
whisper_call_control_ids
(array[string])
更新会议参会者的属性。
PATCH /conferences/{id}/participants/{participant_id}
可选参数:
beep_enabled
(枚举:always, never, on_enter, on_exit),
end_conference_on_exit
(布尔值),
soft_end_conference_on_exit
(布尔值)
ruby
response = client.conferences.update_participant("participant_id", id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

puts(response)
返回值:
call_control_id
(字符串),
call_leg_id
(字符串),
conference_id
(字符串),
created_at
(date-time),
end_conference_on_exit
(布尔值),
id
(字符串),
label
(字符串),
muted
(布尔值),
on_hold
(布尔值),
soft_end_conference_on_exit
(布尔值),
status
(枚举:joining, joined, left),
updated_at
(date-time),
whisper_call_control_ids
(字符串数组)

List queues

查询队列列表

List all queues for the authenticated user.
GET /queues
ruby
page = client.queues.list

puts(page)
Returns:
average_wait_time_secs
(integer),
created_at
(string),
current_size
(integer),
id
(string),
max_size
(integer),
name
(string),
record_type
(enum: queue),
updated_at
(string)
查询当前认证用户的所有队列。
GET /queues
ruby
page = client.queues.list

puts(page)
返回值:
average_wait_time_secs
(整数),
created_at
(字符串),
current_size
(整数),
id
(字符串),
max_size
(整数),
name
(字符串),
record_type
(枚举:queue),
updated_at
(字符串)

Create a queue

创建队列

Create a new call queue.
POST /queues
— Required:
queue_name
Optional:
max_size
(integer)
ruby
queue = client.queues.create(queue_name: "tier_1_support")

puts(queue)
Returns:
average_wait_time_secs
(integer),
created_at
(string),
current_size
(integer),
id
(string),
max_size
(integer),
name
(string),
record_type
(enum: queue),
updated_at
(string)
创建新的呼叫队列。
POST /queues
— 必填参数:
queue_name
可选参数:
max_size
(整数)
ruby
queue = client.queues.create(queue_name: "tier_1_support")

puts(queue)
返回值:
average_wait_time_secs
(整数),
created_at
(字符串),
current_size
(整数),
id
(字符串),
max_size
(整数),
name
(字符串),
record_type
(枚举:queue),
updated_at
(字符串)

Retrieve a call queue

查询单个呼叫队列详情

Retrieve an existing call queue
GET /queues/{queue_name}
ruby
queue = client.queues.retrieve("queue_name")

puts(queue)
Returns:
average_wait_time_secs
(integer),
created_at
(string),
current_size
(integer),
id
(string),
max_size
(integer),
name
(string),
record_type
(enum: queue),
updated_at
(string)
查询已存在的呼叫队列的详情
GET /queues/{queue_name}
ruby
queue = client.queues.retrieve("queue_name")

puts(queue)
返回值:
average_wait_time_secs
(整数),
created_at
(字符串),
current_size
(整数),
id
(字符串),
max_size
(整数),
name
(字符串),
record_type
(枚举:queue),
updated_at
(字符串)

Update a queue

更新队列

Update properties of an existing call queue.
POST /queues/{queue_name}
— Required:
max_size
ruby
queue = client.queues.update("queue_name", max_size: 200)

puts(queue)
Returns:
average_wait_time_secs
(integer),
created_at
(string),
current_size
(integer),
id
(string),
max_size
(integer),
name
(string),
record_type
(enum: queue),
updated_at
(string)
更新已存在的呼叫队列的属性。
POST /queues/{queue_name}
— 必填参数:
max_size
ruby
queue = client.queues.update("queue_name", max_size: 200)

puts(queue)
返回值:
average_wait_time_secs
(整数),
created_at
(字符串),
current_size
(整数),
id
(字符串),
max_size
(整数),
name
(字符串),
record_type
(枚举:queue),
updated_at
(字符串)

Delete 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}/calls
ruby
page = client.queues.calls.list("queue_name")

puts(page)
Returns:
call_control_id
(string),
call_leg_id
(string),
call_session_id
(string),
connection_id
(string),
enqueued_at
(string),
from
(string),
is_alive
(boolean),
queue_id
(string),
queue_position
(integer),
record_type
(enum: queue_call),
to
(string),
wait_time_secs
(integer)
查询现有队列中的通话列表
GET /queues/{queue_name}/calls
ruby
page = client.queues.calls.list("queue_name")

puts(page)
返回值:
call_control_id
(字符串),
call_leg_id
(字符串),
call_session_id
(字符串),
connection_id
(字符串),
enqueued_at
(字符串),
from
(字符串),
is_alive
(布尔值),
queue_id
(字符串),
queue_position
(整数),
record_type
(枚举:queue_call),
to
(字符串),
wait_time_secs
(整数)

Retrieve 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:
call_control_id
(string),
call_leg_id
(string),
call_session_id
(string),
connection_id
(string),
enqueued_at
(string),
from
(string),
is_alive
(boolean),
queue_id
(string),
queue_position
(integer),
record_type
(enum: queue_call),
to
(string),
wait_time_secs
(integer)
查询现有队列中的指定通话详情
GET /queues/{queue_name}/calls/{call_control_id}
ruby
call = client.queues.calls.retrieve("call_control_id", queue_name: "my-queue")

puts(call)
返回值:
call_control_id
(字符串),
call_leg_id
(字符串),
call_session_id
(字符串),
connection_id
(字符串),
enqueued_at
(字符串),
from
(字符串),
is_alive
(布尔值),
queue_id
(字符串),
queue_position
(整数),
record_type
(枚举:queue_call),
to
(字符串),
wait_time_secs
(整数)

Update queued call

更新队列中通话的属性

Update queued call's keep_after_hangup flag
PATCH /queues/{queue_name}/calls/{call_control_id}
Optional:
keep_after_hangup
(boolean)
ruby
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_hangup
(布尔值)
ruby
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
telnyx-signature-ed25519
and
telnyx-timestamp
headers. Always verify signatures in production:
ruby
undefined
Telnyx使用Ed25519对Webhook进行签名,每个请求都会携带
telnyx-signature-ed25519
telnyx-timestamp
请求头。生产环境中请务必验证签名:
ruby
undefined

In 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
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.enqueuedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.queue
stringThe name of the queue
data.payload.current_position
integerCurrent position of the call in the queue.
data.payload.queue_avg_wait_time_secs
integerAverage time call spends in the queue in seconds.
callLeftQueue
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.dequeuedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.queue
stringThe name of the queue
data.payload.queue_position
integerLast position of the call in the queue.
data.payload.reason
enum: bridged, bridging-in-process, hangup, leave, timeoutThe reason for leaving the queue
data.payload.wait_time_secs
integerTime call spent in the queue in seconds.
conferenceCreated
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.createdThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.conference_id
stringConference ID that the participant joined.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.conference_id
stringConference ID that the participant joined.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.reason
enum: all_left, host_left, time_exceededReason the conference ended.
conferenceFloorChanged
FieldTypeDescription
record_type
enum: eventIdentifies the type of the resource.
event_type
enum: conference.floor.changedThe type of event being delivered.
id
uuidIdentifies the type of resource.
payload.call_control_id
stringCall Control ID of the new speaker.
payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
payload.call_leg_id
stringCall Leg ID of the new speaker.
payload.call_session_id
stringCall Session ID of the new speaker.
payload.client_state
stringState received from a command.
payload.conference_id
stringConference ID that had a speaker change event.
payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceParticipantJoined
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.joinedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.conference_id
stringConference ID that the participant joined.
conferenceParticipantLeft
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.leftThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.conference_id
stringConference ID that the participant joined.
conferenceParticipantPlaybackEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.playback.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.media_url
stringThe audio URL being played back, if audio_url has been used to start.
data.payload.media_name
stringThe name of the audio media file being played back, if media_name has been used to start.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceParticipantPlaybackStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.playback.startedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.media_url
stringThe audio URL being played back, if audio_url has been used to start.
data.payload.media_name
stringThe name of the audio media file being played back, if media_name has been used to start.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceParticipantSpeakEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.speak.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceParticipantSpeakStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.speak.startedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferencePlaybackEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.playback.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.media_url
stringThe audio URL being played back, if audio_url has been used to start.
data.payload.media_name
stringThe name of the audio media file being played back, if media_name has been used to start.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferencePlaybackStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.playback.startedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.media_url
stringThe audio URL being played back, if audio_url has been used to start.
data.payload.media_name
stringThe name of the audio media file being played back, if media_name has been used to start.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceRecordingSaved
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.recording.savedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.channels
enum: single, dualWhether recording was recorded in
single
or
dual
channel.
data.payload.conference_id
uuidID of the conference that is being recorded.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.format
enum: wav, mp3The audio file format used when storing the call recording.
data.payload.recording_ended_at
date-timeISO 8601 datetime of when recording ended.
data.payload.recording_id
uuidID of the conference recording.
data.payload.recording_started_at
date-timeISO 8601 datetime of when recording started.
conferenceSpeakEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.speak.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceSpeakStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.speak.startedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
callEnqueued
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:call.enqueued推送的事件类型
data.id
uuid标识资源类型
data.occurred_at
date-time事件发生的ISO 8601格式时间
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的通话ID
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.queue
字符串队列名称
data.payload.current_position
整数通话在队列中的当前位置
data.payload.queue_avg_wait_time_secs
整数队列中通话的平均等待时长,单位秒
callLeftQueue
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:call.dequeued推送的事件类型
data.id
uuid标识资源类型
data.occurred_at
date-time事件发生的ISO 8601格式时间
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的通话ID
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.queue
字符串队列名称
data.payload.queue_position
整数通话在队列中的最后位置
data.payload.reason
枚举:bridged, bridging-in-process, hangup, leave, timeout离开队列的原因
data.payload.wait_time_secs
整数通话在队列中的等待时长,单位秒
conferenceCreated
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.created推送的事件类型
data.id
uuid标识资源类型
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的通话ID
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.conference_id
字符串参会者加入的会议ID
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间
conferenceEnded
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.ended推送的事件类型
data.id
uuid标识资源类型
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的通话ID
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.conference_id
字符串参会者加入的会议ID
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间
data.payload.reason
枚举:all_left, host_left, time_exceeded会议结束的原因
conferenceFloorChanged
字段类型描述
record_type
枚举:event标识资源类型
event_type
枚举:conference.floor.changed推送的事件类型
id
uuid标识资源类型
payload.call_control_id
字符串新发言人的呼叫控制ID
payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
payload.call_leg_id
字符串新发言人的通话支路ID
payload.call_session_id
字符串新发言人的通话会话ID
payload.client_state
字符串从指令中获取的状态信息
payload.conference_id
字符串发生发言人变更的会议ID
payload.occurred_at
date-time事件发生的ISO 8601格式时间
conferenceParticipantJoined
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.participant.joined推送的事件类型
data.id
uuid标识资源类型
data.occurred_at
date-time事件发生的ISO 8601格式时间
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的通话ID
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.conference_id
字符串参会者加入的会议ID
conferenceParticipantLeft
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.participant.left推送的事件类型
data.id
uuid标识资源类型
data.occurred_at
date-time事件发生的ISO 8601格式时间
data.payload.call_control_id
字符串用于通过呼叫控制API下发指令的通话ID
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.conference_id
字符串参会者加入的会议ID
conferenceParticipantPlaybackEnded
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.participant.playback.ended推送的事件类型
data.id
uuid标识资源类型
data.payload.call_control_id
字符串参会者的呼叫控制ID,用于通过呼叫控制API下发指令
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.creator_call_session_id
字符串发起会议的通话会话的唯一ID
data.payload.conference_id
字符串播放音频的会议ID
data.payload.media_url
字符串播放的音频URL(通过audio_url启动播放时存在)
data.payload.media_name
字符串播放的音频媒体文件名称(通过media_name启动播放时存在)
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间
conferenceParticipantPlaybackStarted
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.participant.playback.started推送的事件类型
data.id
uuid标识资源类型
data.payload.call_control_id
字符串参会者的呼叫控制ID,用于通过呼叫控制API下发指令
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.creator_call_session_id
字符串发起会议的通话会话的唯一ID
data.payload.conference_id
字符串播放音频的会议ID
data.payload.media_url
字符串播放的音频URL(通过audio_url启动播放时存在)
data.payload.media_name
字符串播放的音频媒体文件名称(通过media_name启动播放时存在)
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间
conferenceParticipantSpeakEnded
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.participant.speak.ended推送的事件类型
data.id
uuid标识资源类型
data.payload.call_control_id
字符串参会者的呼叫控制ID,用于通过呼叫控制API下发指令
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.creator_call_session_id
字符串发起会议的通话会话的唯一ID
data.payload.conference_id
字符串播放语音合成内容的会议ID
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间
conferenceParticipantSpeakStarted
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.participant.speak.started推送的事件类型
data.id
uuid标识资源类型
data.payload.call_control_id
字符串参会者的呼叫控制ID,用于通过呼叫控制API下发指令
data.payload.call_leg_id
字符串通话唯一ID,可用于关联Webhook事件
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.creator_call_session_id
字符串发起会议的通话会话的唯一ID
data.payload.conference_id
字符串播放语音合成内容的会议ID
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间
conferencePlaybackEnded
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.playback.ended推送的事件类型
data.id
uuid标识资源类型
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.creator_call_session_id
字符串发起会议的通话会话的唯一ID
data.payload.conference_id
字符串播放音频的会议ID
data.payload.media_url
字符串播放的音频URL(通过audio_url启动播放时存在)
data.payload.media_name
字符串播放的音频媒体文件名称(通过media_name启动播放时存在)
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间
conferencePlaybackStarted
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.playback.started推送的事件类型
data.id
uuid标识资源类型
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.creator_call_session_id
字符串发起会议的通话会话的唯一ID
data.payload.conference_id
字符串播放音频的会议ID
data.payload.media_url
字符串播放的音频URL(通过audio_url启动播放时存在)
data.payload.media_name
字符串播放的音频媒体文件名称(通过media_name启动播放时存在)
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间
conferenceRecordingSaved
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.recording.saved推送的事件类型
data.id
uuid标识资源类型
data.payload.call_control_id
字符串参会者的呼叫控制ID,用于通过呼叫控制API下发指令
data.payload.call_session_id
字符串通话会话唯一ID,可用于关联Webhook事件
data.payload.client_state
字符串从指令中获取的状态信息
data.payload.channels
枚举:single, dual录制的声道类型:单声道
single
或双声道
dual
data.payload.conference_id
uuid被录制的会议ID
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.format
枚举:wav, mp3通话录制的音频文件存储格式
data.payload.recording_ended_at
date-time录制结束的ISO 8601格式时间
data.payload.recording_id
uuid会议录制的ID
data.payload.recording_started_at
date-time录制开始的ISO 8601格式时间
conferenceSpeakEnded
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.speak.ended推送的事件类型
data.id
uuid标识资源类型
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.creator_call_session_id
字符串发起会议的通话会话的唯一ID
data.payload.conference_id
字符串播放语音合成内容的会议ID
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间
conferenceSpeakStarted
字段类型描述
data.record_type
枚举:event标识资源类型
data.event_type
枚举:conference.speak.started推送的事件类型
data.id
uuid标识资源类型
data.payload.connection_id
字符串通话使用的呼叫控制应用ID(原Telnyx连接ID)
data.payload.creator_call_session_id
字符串发起会议的通话会话的唯一ID
data.payload.conference_id
字符串播放语音合成内容的会议ID
data.payload.occurred_at
date-time事件发生的ISO 8601格式时间