Loading...
Loading...
Compare original and translation side by side
Authorization: Basic base64(APPLICATION_KEY:APPLICATION_SECRET)Authorization: Basic base64(APPLICATION_KEY:APPLICATION_SECRET)| Region | Base URL |
|---|---|
| Global (default) | |
| North America | |
| Europe | |
| Southeast Asia 1 | |
| Southeast Asia 2 | |
| South America | |
https://callingapi.sinch.com| 区域 | 基础URL |
|---|---|
| 全球(默认) | |
| 北美 | |
| 欧洲 | |
| 东南亚1 | |
| 东南亚2 | |
| 南美 | |
https://callingapi.sinch.com| Language | Package | Install |
|---|---|---|
| Node.js | | |
| Java | | Maven dependency |
| Python | | |
| .NET | | |
| 语言 | 包名 | 安装命令 |
|---|---|---|
| Node.js | | |
| Java | | Maven依赖 |
| Python | | |
| .NET | | |
curl -X POST "https://calling.api.sinch.com/calling/v1/callouts" \
-H "Content-Type: application/json" \
-u "YOUR_APPLICATION_KEY:YOUR_APPLICATION_SECRET" \
-d '{
"method": "ttsCallout",
"ttsCallout": {
"destination": { "type": "number", "endpoint": "+14045005000" },
"cli": "+14045001000",
"locale": "en-US",
"text": "Hello! This is a test call from Sinch."
}
}'import { SinchClient } from "@sinch/sdk-core";
const sinch = new SinchClient({
applicationKey: "YOUR_APPLICATION_KEY",
applicationSecret: "YOUR_APPLICATION_SECRET",
});
const response = await sinch.voice.callouts.tts({
ttsCalloutRequestBody: {
destination: { type: "number", endpoint: "+14045005000" },
cli: "+14045001000",
locale: "en-US",
text: "Hello! This is a test call from Sinch.",
},
});
console.log("Call ID:", response.callId);curl -X POST "https://calling.api.sinch.com/calling/v1/callouts" \
-H "Content-Type: application/json" \
-u "YOUR_APPLICATION_KEY:YOUR_APPLICATION_SECRET" \
-d '{
"method": "ttsCallout",
"ttsCallout": {
"destination": { "type": "number", "endpoint": "+14045005000" },
"cli": "+14045001000",
"locale": "en-US",
"text": "Hello! This is a test call from Sinch."
}
}'import { SinchClient } from "@sinch/sdk-core";
const sinch = new SinchClient({
applicationKey: "YOUR_APPLICATION_KEY",
applicationSecret: "YOUR_APPLICATION_SECRET",
});
const response = await sinch.voice.callouts.tts({
ttsCalloutRequestBody: {
destination: { type: "number", endpoint: "+14045005000" },
cli: "+14045001000",
locale: "en-US",
text: "Hello! This is a test call from Sinch.",
},
});
console.log("Call ID:", response.callId);| Action | Description |
|---|---|
| Terminate the call |
| Continue call setup (ACE response to proceed without rerouting) |
| Connect to PSTN number. Supports |
| Connect to Sinch SDK (in-app) endpoint |
| Connect to conference room by |
| Connect to SIP endpoint |
| Connect to a WebSocket server for real-time audio streaming (closed beta — contact Sinch to enable) |
| IVR menu with DTMF collection (supports |
| Park (hold) the call with looping prompt |
| 操作 | 描述 |
|---|---|
| 终止呼叫 |
| 继续呼叫设置(ACE响应,用于无需重路由的情况) |
| 连接到PSTN号码。支持 |
| 连接到Sinch SDK(应用内)端点 |
| 通过 |
| 连接到SIP端点 |
| 连接到WebSocket服务器进行实时音频流(封闭测试版——请联系Sinch启用) |
| 支持DTMF输入的IVR菜单(支持 |
| 保持呼叫并循环播放提示音 |
| Instruction | Description |
|---|---|
| Play audio files, TTS via |
| Synthesize and play text-to-speech |
| Send DTMF tones |
| Persist key-value state across callback events in the session |
| Answer the call (sends a SIP 200 OK to the INVITE, which starts billing). Required before playing prompts on unanswered calls |
| Begin recording. Supports |
| Stop an active recording |
| 指令 | 描述 |
|---|---|
| 播放音频文件,通过 |
| 合成并播放文本转语音内容 |
| 发送DTMF音调 |
| 在会话的回调事件之间持久化键值对状态 |
| 接听呼叫(向INVITE发送SIP 200 OK,开始计费)。在未接听的呼叫上播放提示音前必须执行此操作 |
| 开始录音。支持 |
| 停止正在进行的录音 |
| Event | Trigger | SVAML Response |
|---|---|---|
| ICE | Call received by Sinch platform | Yes |
| ACE | Call answered by callee | Yes |
| DiCE | Call disconnected | No (fire-and-forget, logging only) |
| PIE | DTMF/voice input from | Yes |
| Notify | Notification (e.g., recording finished) | No |
| 事件 | 触发条件 | SVAML响应 |
|---|---|---|
| ICE | Sinch平台接收到呼叫 | 需要 |
| ACE | 被叫方接听呼叫 | 需要 |
| DiCE | 呼叫断开 | 不需要(仅为通知事件,用于日志记录) |
| PIE | | 需要 |
| Notify | 通知事件(例如录音完成) | 不需要 |
| Method | Use Case |
|---|---|
| Call and play synthesized speech. Supports |
| Call and connect to a conference room |
| Full SVAML control with inline ICE/ACE/PIE |
enableAcefalseenableDicefalseenablePiefalse| 方法 | 使用场景 |
|---|---|
| 发起呼叫并播放合成语音。支持 |
| 发起呼叫并连接到会议室 |
| 通过内联ICE/ACE/PIE实现完整的SVAML控制 |
enableAcefalseenableDicefalseenablePiefalse/calling/v1//v1/configuration/https://callingapi.sinch.com| Method | Endpoint | Description |
|---|---|---|
| POST | | Place a callout (TTS, conference, or custom) |
| PATCH | | Update in-progress call with SVAML (PSTN/SIP only) |
| GET | | Get call info |
| PATCH | | Manage a call leg (PlayFiles/Say only) |
| GET | | Get conference info |
| DELETE | | Kick all participants |
| PATCH | | Mute/unmute/hold participant |
| DELETE | | Kick specific participant |
| GET | | List numbers and capabilities |
| POST | | Assign numbers to an application |
| DELETE | | Un-assign a number |
| GET/POST | | Get/update callback URLs |
/calling/v1//v1/configuration/https://callingapi.sinch.com| 方法 | 端点 | 描述 |
|---|---|---|
| POST | | 发起呼叫(TTS、会议或自定义类型) |
| PATCH | | 使用SVAML更新进行中的呼叫(仅支持PSTN/SIP) |
| GET | | 获取呼叫信息 |
| PATCH | | 管理呼叫分支(仅支持PlayFiles/Say操作) |
| GET | | 获取会议信息 |
| DELETE | | 踢出所有参会者 |
| PATCH | | 静音/取消静音/保持参会者 |
| DELETE | | 踢出指定参会者 |
| GET | | 列出号码及其功能 |
| POST | | 将号码分配给应用 |
| DELETE | | 解除号码与应用的关联 |
| GET/POST | | 获取/更新回调URL |
{
"instructions": [
{ "name": "setCookie", "key": "step", "value": "ivr" }
],
"action": {
"name": "runMenu",
"mainMenu": "main",
"menus": [{
"id": "main",
"mainPrompt": "#tts[Press 1 for sales or 2 for support.]",
"options": [
{ "dtmf": 1, "action": "return(sales)" },
{ "dtmf": 2, "action": "return(support)" }
]
}]
}
}{
"instructions": [
{ "name": "setCookie", "key": "step", "value": "ivr" }
],
"action": {
"name": "runMenu",
"mainMenu": "main",
"menus": [{
"id": "main",
"mainPrompt": "#tts[Press 1 for sales or 2 for support.]",
"options": [
{ "dtmf": 1, "action": "return(sales)" },
{ "dtmf": 2, "action": "return(support)" }
]
}]
}
}{
"instructions": [
{ "name": "startRecording", "options": { "notificationEvents": true } }
],
"action": {
"name": "connectConf",
"conferenceId": "myRoom",
"moh": "ring"
}
}{
"instructions": [
{ "name": "startRecording", "options": { "notificationEvents": true } }
],
"action": {
"name": "connectConf",
"conferenceId": "myRoom",
"moh": "ring"
}
}{
"action": {
"name": "connectPstn",
"number": "+14045009000",
"cli": "+14045001000",
"maxDuration": 3600,
"amd": { "enabled": true }
}
}{
"action": {
"name": "connectPstn",
"number": "+14045009000",
"cli": "+14045001000",
"maxDuration": 3600,
"amd": { "enabled": true }
}
}export SINCH_APPLICATION_KEY="your-app-key"
export SINCH_APPLICATION_SECRET="your-app-secret"
export SINCH_VOICE_REGION="global" # optional| Script | Description | Example |
|---|---|---|
| TTS callout | |
| Conference callout | |
| Get call details | |
| List voice numbers | |
export SINCH_APPLICATION_KEY="your-app-key"
export SINCH_APPLICATION_SECRET="your-app-secret"
export SINCH_VOICE_REGION="global" # 可选| 脚本 | 描述 | 示例 |
|---|---|---|
| TTS呼叫发起 | |
| 会议呼叫发起 | |
| 获取呼叫详情 | |
| 列出语音号码 | |
usernameenableAce: trueanswerplayFilesstartRecordingmaxDurationconnectPstnconnectSipAuthorizationsetCookieconnectMxpstartRecordingstopRecordingconnectMxprunMenubargetruetimeoutMills5000connectPstnamd: { enabled: true, async: true/false }startRecordingtranscriptionOptions: { enabled: true, locale: "en-US" }conferenceDtmfOptionsconferenceCalloutconnectConfignoreforwarddetectcliclicli"+14151112223333"usernameenableAce: trueplayFilesanswerstartRecordingconnectPstnconnectSipmaxDurationAuthorizationsetCookieconnectMxpstartRecordingstopRecordingconnectMxprunMenubargetruetimeoutMills5000connectPstnamd: { enabled: true, async: true/false }startRecordingtranscriptionOptions: { enabled: true, locale: "en-US" }conferenceCalloutconnectConfconferenceDtmfOptionsignoreforwarddetectcliclicli"+14151112223333"