SendDigits
在调用的任何分支上发送最多 50 个双音多频 (DTMF) 数字。信号可包括:
-
数字 0 到 9
-
特殊字符星号 (*) 和井号 (#)
-
网络控制信号 A、B、C、D
-
逗号字符 (,)。该信号在前一个信号和下一个信号之间增加了 0.5 秒的延迟。
使用 SendDigits 操作
以下示例显示典型的 SendDigits
操作:
{ "SchemaVersion": "1.0", "Actions":[ { "Type": "SendDigits", "Parameters": { "CallId": "
call-id-1
", // required "Digits": ",,*1234,56,7890ABCD#
", // required "ToneDurationInMilliseconds":100
// optional } } ] }
- CallId
-
描述 — AWS Lambda 函数调用的
CallDetails
中参与者的CallId
允许的值 — 有效的调用 ID
必填 — 是
默认值 – 无
- Digits
-
描述 — 要在调用分支上发送的数字,对应于
CallId
允许的值 — 0-9、*、#、A、B、C、D、逗号 (,)
必填 — 是
默认值 – 无
- ToneDurationInMilliseconds
-
描述 — 传输每个数字所允许的时间(以毫秒为单位)。
允许的值 — 介于 50 和 24000 之间的任何整数
必填 — 否
默认值 — 250
处理 ACTION_SUCCESSFUL 事件
以下示例显示 SendDigits
操作的典型 ACTION_SUCCESSFUL
事件。
{ "SchemaVersion": "1.0", "Sequence":
3
, "InvocationEventType": "ACTION_SUCCESSFUL", "ActionData": { "Type": "SendDigits", "Parameters": { "Digits": "1,2A#
", "ToneDurationInMilliseconds":100
, "CallId": "call-id-1
" }, "CallDetails": { ... } } }
处理 ACTION_FAILED 事件
以下示例显示 SendDigits
操作的典型 ACTION_FAILED
事件。
{ "SchemaVersion": "1.0", "Sequence":
3
, "InvocationEventType": "ACTION_FAILED", "ActionData": { "Type": "SendDigits", "Parameters": { "Digits": "1,2A#
", "ToneDurationInMilliseconds":20000000
, "CallId": "call-id-1
" }, "ErrorType": "InvalidActionParameter", "ErrorMessage": "ToneDuration parameter value is invalid." }, "CallDetails": { ... } } }
调用流
下图显示从呼叫方向被叫方发送数字的程序流程。