Subsequent inbound call callback

Updated at:

This topic describes the request and response parameters for the subsequent inbound call callback in the Intelligent Speech Interaction HTTP API.

Request example

http://127.0.0.1/test?call_id=100001616500^10000187****&timestamp=1504174341229&content_type=normal&content={"role": "B","identity": "id2","words": "Hello","begin_offset": "1000","end_offset": "9000","begin_time": "2017-06-01 10:00:00"}

Request parameters

Parameter Name

Parameter type

Required

Example

Description

call_id

String

Yes

1100001616500^10000187****

The unique ID of the call.

timestamp

Long

Yes

1504174341229

The current timestamp.

content_type

String

Yes

normal

The message type. Valid values:

  • normal: Standard.

  • mute: Mute.

  • timebreak: Message interrupted based on duration.

  • dtmf: DTMF message.

content

JSON

Yes

{"role": "B","identity":"id2","words": "Hello","begin_offset":"1000","end_offset":"9000","begin_time":"2017-06-01 10:00:00"}

The specific voice content in JSON format. For more information, see the following table.

  • If content_type is set to normal, the content parameter is described as follows:

    Name

    Type

    Required

    Example

    Description

    role

    String

    Yes

    B

    The role in the conversation.

    identity

    Long

    Yes

    id2

    The specific identity of the role.

    words

    String

    Yes

    Hello

    The words spoken by the role.

    begin_offset

    String

    Yes

    6000000

    The start time offset relative to the start of the session. Unit: milliseconds.

    end_offset

    String

    Yes

    7000000

    The end time offset relative to the start of the session. Unit: milliseconds.

    begin_time

    String

    Yes

    7000000

    The start time of the call. Unit: seconds.

    is_playing

    String

    No

    true

    Indicates whether audio is being played.

    current_media_code

    String

    No

    xxxx.wav

    The audio file that is being played.

    Note

    If the value is early_media, it indicates an early media message.

    dynamic_id

    String

    No

    abcdefgh

    A dynamic extension ID reserved for the caller. This ID is returned in the next webhook address and can be used as a developer identity.

    record_begin_time

    Long

    No

    1543856399000

    The time when the recording started.

    asr_begin_time

    String

    No

    1543856399000

    The time when the user started speaking. This is a Unix timestamp. Unit: milliseconds.

    asr_end_time

    String

    No

    1543856399000

    The time when the user stopped speaking. This is a Unix timestamp. Unit: milliseconds.

    play_begin_time

    String

    No

    1543856399000

    The time when the server started audio playback. This is a Unix timestamp. Unit: milliseconds.

    play_end_time

    String

    No

    1543856399000

    The time when the server stopped audio playback. This is a Unix timestamp. Unit: milliseconds. If the playback is not finished, the value is 0.

  • If content_type is set to mute, the content parameter is described as follows:

    Name

    Type

    Required

    Example

    Description

    dynamic_id

    String

    No

    abcdefgh****

    A dynamic extension ID reserved for the caller. This ID is returned in the next webhook address and can be used as a developer identity.

  • If content_type is set to dtmf, the content parameter is described as follows:

    Name

    Type

    Required

    Example

    Description

    dynamic_id

    String

    No

    abcdefgh

    A dynamic extension ID reserved for the caller. This ID is returned in the next webhook address and can be used as a developer identity.

    dtmf_digits

    String

    No

    1

    A field specific to the dtmf content type. It represents the key pressed by the user.

    Note

    If the user does not press a key before the timeout period ends, the string `noInputTimeout` is returned.

  • If content_type is set to timebreak, the content parameter is described as follows:

    Name

    Type

    Required

    Example

    Description

    current_media_code

    String

    No

    xxxx.wav

    The audio file that is being played.

    asr_begin_time

    String

    No

    1543856399000

    The time when the user started speaking. This is a Unix timestamp. Unit: milliseconds.

    play_begin_time

    String

    No

    1543856399000

    The time when the server started audio playback. This is a Unix timestamp. Unit: milliseconds.

    dynamic_id

    String

    No

    abcdefgh

    A dynamic extension ID reserved for the caller. This ID is returned in the next webhook address and can be used as a developer identity.

Response examples

The following examples show responses in JSON format:

  • Successful call:

    {
     "result": "success",
     "msg": "success",
     "data": 
       {"call_id": "100001616500^10000187****",
         "action": "play",
         "action_code": "411111"
       }
    }
  • Failed call:

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

Response parameters

Name

Type

Required

Example

Description

call_id

String

Yes

100001616500^10000187****

The unique ID of the call.

action

String

Yes

play

The next action to perform:

  • play: Play the next audio segment.

  • break: Interrupt the current audio playback.

  • continue: Continue playing the current audio.

  • hangup: Hang up.

  • transfer: Transfer.

  • donothing: Do nothing.

  • dtmf: Accept DTMF messages.

  • parallel_transfer: Parallel transfer command.

  • parallel_bridge : Parallel bridge command.

action_break

Boolean

No

true

Specifies whether the current action can be interrupted. The default value is true, which means the action can be interrupted.

Note

If action_code_break for the previous action is set to false, this action cannot be interrupted.

action_code

String

No

abc.wav,def.wav,$name$

The code of the audio file to play. You can play multiple files by separating their codes with commas (,). Text-to-speech (TTS) parameters are supported. Use the dollar sign ($) for TTS parameters.

action_code_break

Boolean

No

true

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

  • true (default): The file can be interrupted.

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

Note

Between action_break and action_code_break, action_code_break has a higher priority.

mute_time

Integer

No

10000

The mute duration in milliseconds. The valid range is 1000 to 20000. The default value is 10000.

dynamic_id

String

No

abc

A dynamic extension ID reserved for the caller. This ID is returned in the next webhook address and can be used as a developer identity.

action_code_param

String

No

{"name":"Hello"}

The TTS parameters in JSON format. The key corresponds to the action_code.

number

String

No

1371111****

The mobile phone number to which the call is transferred. This parameter is valid only when action is set to transfer.

action_code_time_break

Integer

No

120

Interrupts the playback based on the duration of the user's continuous speech. Unit: milliseconds.

Note

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

dtmf_nonin_overtime

Integer

No

3

A field specific to the `dtmf` command. It specifies the timeout period for no input. The default value is 3s. The value ranges from 3s to 60s.

dtmf_max_numbers

Integer

No

5

A field specific to the `dtmf` command. It specifies the maximum number of digits to accept. The value ranges from 1 to 50.

dtmf_end_character

String

No

#

A field specific to the `dtmf` command. It specifies the character that stops digit collection. Only * # are supported. You can also leave this empty.

transfer_playfile

String

No

#

The audio file to play to the agent after a successful parallel transfer.

is_monitor

Boolean

No

true

Specifies whether to enable monitoring after a successful parallel transfer to the call center.

cc_name

String

No

aliyun_cc

The name of the call center after a successful parallel transfer.