Loading...
Loading...
Compare original and translation side by side
pip install telnyxpip install telnyximport os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)clientimport os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # 这是默认配置,可省略
)clientPOST /calls/{call_control_id}/actions/fork_startclient_statecommand_idrxstream_typetxresponse = client.calls.actions.start_forking(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/fork_startclient_statecommand_idrxstream_typetxresponse = client.calls.actions.start_forking(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/fork_stopclient_statecommand_idstream_typeresponse = client.calls.actions.stop_forking(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/fork_stopclient_statecommand_idstream_typeresponse = client.calls.actions.stop_forking(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/streaming_startclient_statecommand_idcustom_parametersdialogflow_configenable_dialogflowstream_auth_tokenstream_bidirectional_codecstream_bidirectional_modestream_bidirectional_sampling_ratestream_bidirectional_target_legsstream_codecstream_trackstream_urlresponse = client.calls.actions.start_streaming(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/streaming_startclient_statecommand_idcustom_parametersdialogflow_configenable_dialogflowstream_auth_tokenstream_bidirectional_codecstream_bidirectional_modestream_bidirectional_sampling_ratestream_bidirectional_target_legsstream_codecstream_trackstream_urlresponse = client.calls.actions.start_streaming(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/streaming_stopclient_statecommand_idstream_idresponse = client.calls.actions.stop_streaming(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/streaming_stopclient_statecommand_idstream_idresponse = client.calls.actions.stop_streaming(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/transcription_startclient_statecommand_idtranscription_enginetranscription_engine_configtranscription_tracksresponse = client.calls.actions.start_transcription(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/transcription_startclient_statecommand_idtranscription_enginetranscription_engine_configtranscription_tracksresponse = client.calls.actions.start_transcription(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/transcription_stopclient_statecommand_idresponse = client.calls.actions.stop_transcription(
call_control_id="call_control_id",
)
print(response.data)POST /calls/{call_control_id}/actions/transcription_stopclient_statecommand_idresponse = client.calls.actions.stop_transcription(
call_control_id="call_control_id",
)
print(response.data)telnyx-timestamptelnyx-signature-ed25519| Event | Description |
|---|---|
| Call Fork Started |
| Call Fork Stopped |
| Call Streaming Started |
| Call Streaming Stopped |
| Call Streaming Failed |
| Transcription |
telnyx-timestamptelnyx-signature-ed25519| 事件 | 描述 |
|---|---|
| 通话分流已启动 |
| 通话分流已停止 |
| 通话流式传输已启动 |
| 通话流式传输已停止 |
| 通话流式传输失败 |
| 转写结果 |
callForkStarted| Field | Type | Description |
|---|---|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | Unique ID for controlling 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. |
| enum | Type of media streamed. |
callForkStopped| Field | Type | Description |
|---|---|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | Unique ID for controlling 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. |
| enum | Type of media streamed. |
callStreamingStarted| Field | Type | Description |
|---|---|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Destination WebSocket address where the stream is going to be delivered. |
callStreamingStopped| Field | Type | Description |
|---|---|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Destination WebSocket address where the stream is going to be delivered. |
callStreamingFailed| Field | Type | Description |
|---|---|---|
| enum | Identifies the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | A short description explaning why the media streaming failed. |
| uuid | Identifies the streaming. |
| enum | The type of stream connection the stream is performing. |
transcription| Field | Type | Description |
|---|---|---|
| enum | Identifies the type of the resource. |
| enum | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Unique identifier and token for controlling 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 | Use this field to add state to every subsequent webhook. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
callForkStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所推送的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间戳 |
| 字符串 | 通话中使用的Call Control App ID(原Telnyx连接ID) |
| 字符串 | 用于控制通话的唯一ID |
| 字符串 | 通话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 通话会话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 枚举 | 流式传输的媒体类型 |
callForkStopped| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所推送的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间戳 |
| 字符串 | 通话中使用的Call Control App ID(原Telnyx连接ID) |
| 字符串 | 用于控制通话的唯一ID |
| 字符串 | 通话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 通话会话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 枚举 | 流式传输的媒体类型 |
callStreamingStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所推送的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间戳 |
| 字符串 | 用于通过Call Control API发送命令的通话ID |
| 字符串 | 通话中使用的Call Control App ID(原Telnyx连接ID) |
| 字符串 | 通话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 通话会话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 流式传输的目标WebSocket地址 |
callStreamingStopped| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所推送的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间戳 |
| 字符串 | 用于通过Call Control API发送命令的通话ID |
| 字符串 | 通话中使用的Call Control App ID(原Telnyx连接ID) |
| 字符串 | 通话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 通话会话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 流式传输的目标WebSocket地址 |
callStreamingFailed| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所推送的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间戳 |
| 字符串 | 用于通过Call Control API发送命令的通话ID |
| 字符串 | 通话中使用的Call Control App ID(原Telnyx连接ID) |
| 字符串 | 通话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 通话会话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 从命令中接收的状态信息 |
| 字符串 | 媒体流式传输失败的简短原因说明 |
| uuid | 标识流式传输任务ID |
| 枚举 | 流式传输的连接类型 |
transcription| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举 | 标识资源类型 |
| 枚举 | 标识所推送的事件类型 |
| uuid | 标识资源ID |
| 日期时间 | 事件发生的ISO 8601格式时间戳 |
| 字符串 | 用于控制通话的唯一标识和令牌 |
| 字符串 | 通话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 通话会话的唯一标识ID,可用于关联Webhook事件 |
| 字符串 | 可使用此字段为后续所有Webhook添加状态信息 |
| 字符串 | 通话中使用的Call Control App ID(原Telnyx连接ID) |