SmartCall

Updated at:

Intelligent Speech Interaction is a human-machine interaction technology that enables users to hold natural, voice-based conversations with machines.

Operation description

  • You can use SmartCall with the Smart Outbound Call HTTP Callback Interface. After the voice platform initiates a call, it sends the transcribed speech text to your business system. Your business system then returns the next action to the voice platform.

  • The following characters are not allowed in SmartCall callbacks: @ = : "" $ { } ^ * ¥.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dyvms:SmartCall

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

CalledShowNumber

string

Yes

Displayed number for the called party. This must be a number you have purchased.

Log on to the Voice Service console. Go to Voice Numbers > Real Number Management to view your purchased numbers.

0571****5678

CalledNumber

string

Yes

Called number. Only numbers from the Chinese mainland are supported.

1590****0000

VoiceCode

string

Yes

Voice file for smart outbound calls.

If the voice file is uploaded to the console, set VoiceCode to the voice ID of the file. Log on to the Voice Service console. Go to Voice File Management > Intelligent Speech Interaction Voice Files. Click Details to view the voice ID.

2d4c-4e78-8d2a-afbb06cf****.wav,$name$

RecordFlag

boolean

No

Whether to record the call. Valid values:

  • true: Record the call.

  • false: Do not record the call.

true

Volume

integer

No

Volume for playing audio. Valid values: -4 to 4. We recommend setting this to 1.

1

Speed

integer

No

This parameter is not supported.

1

AsrModelId

string

No

The Automatic Speech Recognition (ASR) model. The valid values are:

  • customer_service_8k (default): Mandarin.

  • dialect_customer_service_8k: Mandarin with a strong accent.

Note

When you call the SmartCall operation, you can specify the ASR model by setting either the AsrModelId or AsrBaseId parameter.

  • If you set only the AsrModelId parameter, the system uses the specified ASR model.

  • If you set only the AsrBaseId parameter, the system uses the specified ASR foundation model.

  • If you do not set either parameter, the system uses the default ASR foundation model. The AsrBaseId parameter defaults to customer_service_8k, which is the Mandarin ASR foundation model.

  • If you set both parameters, confirm that they are compatible.

customer_service_8k

PauseTime

integer

No

Pause duration. Sets how long a user must pause before the system treats it as the end of a sentence. Unit: milliseconds. Valid values: 300 to 1200.

Note
  • If the value is outside this range, the default value 800 is used.

  • This parameter takes effect only the first time it is set.

800

MuteTime

integer

No

Mute duration. Sets how long a user must remain silent before the call ends. Unit: milliseconds. Valid values: 1000 to 20000.

Note
  • If the value is outside this range, the default value 10000 is used.

  • You can set this parameter dynamically during the call. The last setting takes effect.

10000

ActionCodeBreak

boolean

No

Whether the current media file can be interrupted. Default value: true.

If this is false, the current playback cannot be interrupted—even if the next action (action_break) is true.

Note

action_code_break has higher priority than action_break.

true

OutId

string

No

ID reserved for the caller. This ID is returned to the caller in the callback message.

String. Length: 1 to 15 bytes.

342268*****

DynamicId

string

No

Dynamic extension ID reserved for the caller. Returned in the callback URL for developer identification.

abcdefgh

EarlyMediaAsr

boolean

No

Early media speech recognition flag. Valid values:

  • false (default): Disabled.

  • true: Enabled.

Note

Set this to true to record why the call was not answered.

true

VoiceCodeParam

string

No

TTS parameter string in JSON format. Must match the TTS parameters in VoiceCode.

{"name":"喂,你好"}

SessionTimeout

integer

No

Maximum call duration. The call ends automatically after this time. Unit: seconds.

Note

Maximum duration is 3600 seconds.

120

ActionCodeTimeBreak

integer

No

Interrupt based on continuous speech duration. Unit: milliseconds.

If ActionCodeBreak is true, continuous speech interrupts the current playback. If this parameter is not set or is 0, it does not take effect.

120

TtsStyle

string

No

Voice style for TTS variables. Default value: xiaoyun. For a full list, see Voice Styles.

xiaoyun

TtsVolume

integer

No

Volume for playing TTS variables. Valid values: 0 to 100. Default value: 0.

10

TtsSpeed

integer

No

Speech speed for TTS variables. Valid values: -200 to 200. Default value: 0.

100

TtsConf

boolean

No

Whether to configure TTS voice settings. Valid values:

  • true: Configure. Use TtsStyle, TtsVolume, and TtsSpeed to set voice style.

  • false: Do not configure. Other TTS parameters are ignored even if set.

true

AsrBaseId

string

No

ASR foundation model. Valid values:

  • customer_service_8k (default): Mandarin.

  • dialect_customer_service_8k: Heavy accent.

Note

When you call the SmartCall API, specify an ASR model. Set either AsrModelId or AsrBaseId, but not both.

  • If you set only AsrModelId, the specified ASR model is used.

  • If you set only AsrBaseId, the specified ASR foundation model is used.

  • If you set neither, the default ASR foundation model is used. The default value of AsrBaseId is customer_service_8k, which means the Mandarin ASR foundation model is used.

  • If you set both, make sure they match correctly.

customer_service_8k

StreamAsr

integer

No

Streaming ASR. Uses the first few spoken words to infer meaning. Valid values:

  • 0: Disabled.

  • 1: Enabled.

1

BackgroundFileCode

string

No

Background voice file ID played during user-robot conversations.

Log on to the Voice Service console. Go to Voice File Management > Intelligent Speech Interaction Voice Files. Click Details to view the voice ID.

2d4c-4e78-8d2a-afbb06cf****.wav

BackgroundVolume

integer

No

This parameter is not supported.

1

BackgroundSpeed

integer

No

This parameter is not supported.

1

EnableITN

boolean

No

Whether to apply inverse text normalization (ITN) during post-processing. Default value: false.

If set to true, Chinese numerals convert to Arabic numerals in output.

false

NoiseThreshold

number

No

Voice Styles

For more information, see Voice Styles.

Response elements

Element

Type

Description

Example

object

Response data.

Code

string

Request status code.

  • OK means the request succeeded.

  • For other error codes, see API Error Codes.

OK

Message

string

Description of the status code.

OK

RequestId

string

Request ID.

A90E4451-FED7-49D2-87C8-00700A8C4D0D

CallId

string

Unique receipt ID for this call.

Use the QueryCallDetailByCallId API to query call details by CallId.

116012854210^10281427****

Examples

Success response

JSON format

{
  "Code": "OK",
  "Message": "OK",
  "RequestId": "A90E4451-FED7-49D2-87C8-00700A8C4D0D",
  "CallId": "116012854210^10281427****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.