VoiceReport

Updated at:

You can subscribe to call record messages (VoiceReport) to obtain call record information after a call ends.

Parameters

Parameter name

Parameter type

Description

call_id

String

The call ID.

start_time

String

The time when the call was connected. This is the time when the callee answered the phone. This field is empty if the call was not connected.

end_time

String

The time when the call ended. This field is empty if the call was not connected.

duration

String

The call duration in seconds. The value is 0 if the call was not connected.

status_code

String

The status code of the call result. For more information about status codes, see Call status codes.

smart_status_code

String

The status code of the smart call result. For more information about status codes, see Smart status codes.

status_msg

String

The description of the result.

out_id

String

Returns the extension field that you passed in the API call.

Note

For APIs related to the Outbound Bot SAAS assistant, the value of out_id is in the format ALICOM_SMART_SAAS^111111^2222222, where 111111 is the batch task ID.

caller

String

The caller's number.

callee

String

The callee's number.

early_media_code

String

The status code of the early media result. To use this feature, you must enable number status detection (early media), which incurs speech recognition fees. This feature helps detect number statuses, such as out of service or disconnected, and automatically hangs up the call based on the detected status. For more information about status codes, see Call status codes.

Note

hangup_direction

String

The party that hung up the call. Valid values:

  • user

  • machine

toll_type (deprecated)

String

The call type. This parameter is deprecated. Default value:

  • UNKNOWN: An unknown value.

originate_time

String

The time when the call was initiated. This is the time when Voice Service sent the call request to the carrier.

ring_time

String

The time when the callee's phone started ringing. This is the time when the callee received the call request after the outbound call was initiated. This field is empty if the callee's phone did not ring.

b_ring_time

String

The time when the B-leg callee's phone started ringing. This field is empty if the callee's phone did not ring.

b_start_time

String

The time when the B-leg call started.

b_end_time

String

The time when the B-leg call ended.

b_duration

String

The duration of the B-leg call in seconds. The value is 0 if the call was not connected.

b_originate_time

String

The time when the B-leg call was initiated.

voice_type

String

The type of the call detail record (CDR). Valid values:

  • Voice: Mandarin (single speaker)

  • asr: an ASR CDR.

  • smart_transfer: a CDR for a smart transfer call.

extend

String

The extension code or additional information.

parallel_leg_hangup_cause

String

The reason why the smart transfer call failed.

dialog_id

String

The robot script ID. This parameter is specific to the Outbound Bot SAAS assistant.

Sample request

The request body is a JSON array.

[
 {
	"status_code": "200000",
	"smart_status_code": "ANSWERED",
	"hangup_direction": "user",
	"callee": "1390000****",
	"ring_time": "2023-03-15 14:46:12",
	"duration": "10",
	"voice_type": "voice",
	"b_duration": 10,
	"dialog_id": "100003303****",
	"originate_time": "2023-03-15 14:46:10",
	"b_ring_time": "2023-03-15 14:46:12",
	"b_start_time": "2023-03-15 14:46:17",
	"b_originate_time": "2023-03-15 14:46:10",
	"end_time": "2023-03-15 14:46:27",
	"call_id": "1***********3^1***********2",
	"start_time": "2023-03-15 14:46:17",
	"caller": "0216230****",
	"b_end_time": "2023-03-15 14:46:27",
	"status_msg": "User finished listening to the voice message",
	"out_id": "12****************5",
	"toll_type": "UNKNOWN"
 }
]

Sample smart transfer

The request body is a JSON array.

[
 {
	"status_code": "200000",
	"smart_status_code": "ANSWERED",
	"hangup_direction": "machine",
	"callee": "1390000****",
	"ring_time": "2023-03-10 17:38:27",
	"duration": "80",
	"voice_type": "voice",
	"b_duration": 80,
	"parallel_leg_hangup_cause": "TRANSFER_FAIL",
	"originate_time": "2023-03-10 17:38:23",
	"b_ring_time": "2023-03-10 17:38:27",
	"b_start_time": "2023-03-10 17:38:37",
	"b_originate_time": "2023-03-10 17:38:23",
	"end_time": "2023-03-10 17:39:56",
	"call_id": "1***********3^1***********2",
	"start_time": "2023-03-10 17:38:37",
	"caller": "0105175****",
	"b_end_time": "2023-03-10 17:39:56",
	"status_msg": "User finished listening to the voice message",
	"out_id": "PRE**************************CN#",
	"toll_type": "UNKNOWN"
 }
]