Initial inbound call callback

Updated at:

This topic describes the request and response parameters for the initial callback that Alibaba Cloud sends after receiving a user's call.

Request example

http://127.0.0.1/test?call_id=100001616500^10000187****&timestamp=1504174341229&content_type=callin&content={"caller": "1371111****"," callee": "0571111****"," orgcallee": "05712222****" }

Request parameters

Parameter name

Parameter type

Required

Example

Description

call_id

String

Yes

100001616500^10000187****

The unique ID of the call.

content_type

String

Yes

callin

The type of Intelligent Speech Interaction. `callin` indicates that a user initiates a call by dialing a specified number.

content

JSON

Yes

{"caller": "1371111****","callee": "0571111****","orgcallee": "05712222****"}

The specific speech content in JSON format.

  • caller: The caller's number in an inbound call scenario.

  • callee: The service number that was dialed in an inbound call scenario.

  • orgcallee: The original callee's number in an inbound call scenario.

For example, assume that C is a service number and user B has set up call forwarding to number C. If user A dials number B and the call is transferred to C, then `caller` is A, `callee` is C, and `orgcallee` is B.

Response example

The following examples show responses in JSON format:

  • Successful call:

    {
    "result":"success",
    "msg":"Success",
    "code":200,
    "data":{"dynamic_id":"v1_0_start",
            "action_code":"$tts$",
            "action":"answer",
            "record_flag":true,
            "action_code_param":"{\"tts\":\"Hello, I am the interviewer Zhong Liuliu. Let's start the interview. I will ask you a few questions.\"}",
            "call_id":"130420284****117198409016"}
    }
  • Failed call:

    {"result":"fail","msg":"fail reason", "data":{}}

Response parameters

Name

Format

Required

Example

Description

call_id

String

Yes

100001616500^10000187****

The unique ID of this call.

action

String

Yes

answer

The next action to perform.

  • answer: Play the opening acknowledgement.

  • hangup: Hang up the call.

session_timeout

Integer

No

120

The maximum call duration in seconds. The call is automatically hung up after the timeout period.

asr_model_id

String

No

11323223q23****

The ID of the custom model. If not specified, the foundation model is used.

asr_base_id

String

No

customer_service_8k

The foundation model.

record_flag

Boolean

No

true

Specifies whether to enable recording.

mute_time

Integer

No

5000

The duration of silence in milliseconds.

Note

This can be dynamically set during the call. The last setting takes effect.

pause_time

Integer

No

500

The sentence-ending detection duration in milliseconds.

Note

Only the first setting is valid. Subsequent settings are ignored.

action_code

String

No

xxx.wav

The audio file for playback.

action_code_break

Boolean

No

true

Specifies whether the currently returned media file can be interrupted. Valid values:

  • true (default): Interruptible.

  • false: The current playback cannot be interrupted, even if the action_break parameter for the next action is set to true.

Note

Between action_break and action_code_break, action_code_break has a higher priority.

action_break

Boolean

No

true

Specifies whether to interrupt the previous action. Valid values:

  • true (Default): Interrupt the previous action.

  • false: Do not interrupt the previous action.

Note

The previous action cannot be interrupted if its action_code_break parameter was set to false.

action_code_param

String

No

{"name":"Hello"}

The playback parameters.

action_code_time_break

Integer

No

120

Interrupts playback based on the duration of continuous user speech, in milliseconds.

Note

If the action_code_break parameter for the current media file is true, continuous user speech can interrupt the current playback. This parameter does not take effect if it is not set or is set to 0.

dynamic_id

String

No

abcde****

An extension field.

tts_conf

Boolean

No

true

The Text-to-Speech (TTS) voice setting parameter. If this is set to true, set the tts_style, tts_volume, and tts_speed parameters to configure the voice style for TTS variable playback.

tts_style

String

No

xiaoyun

The voice style for TTS variable playback.

tts_volume

Integer

No

100

The volume for TTS variable playback.

tts_speed

Integer

No

0

The speed for TTS variable playback.