SecretReport

Updated at:

You can subscribe to SecretReport messages to receive call detail reports via batch HTTP push after a call ends. These reports contain call records, such as call start and end times and the caller and callee numbers, to help you manage your platform.

Protocol

Parameter

Description

Protocol

HTTP + JSON

Encoding

UTF-8

Request

The request body is a JSON array. A single request may contain multiple call records.

Request sample

[{
    "phone_no": "171****3225",
    "city": "Beijing",
    "call_out_time": "2021-08-25 20:11:30",
    "ring_time": "2021-08-25 20:11:35",
    "record_url": "https://*****.oss-cn-shanghai.aliyuncs.com",
    "ring_record_url": "https://****.oss-cn-shanghai.aliyuncs.com",
    "free_ring_time": "2021-08-25 20:11:35",
    "control_msg": "OK",
    "id": 101456851****,
    "secret_no": "186****7614",
    "call_type": 1,
    "control_type": "CONTINUE",
    "release_time": "2021-08-25 20:11:41",
    "pool_key": "FC10000009708****",
    "sub_id": 100004306803****,
    "unconnected_cause": 0,
    "call_time": "2021-08-25 20:11:29",
    "peer_no": "152****1504",
    "called_display_no": "158****0000",
    "release_dir": 1,
    "call_id": "43612633712c****",
    "start_time": "2021-08-25 20:11:38",
    "partner_key": "FC10000009708****",
    "out_id": "7368136812621****",
    "release_cause": 31
}]

Parameters

Parameter

Type

Required

Example

Description

phone_no

String

Yes

171****3225

Number A.

city

String

No

Beijing

The home region of the number X.

call_out_time

String

Yes

2021-08-25 20:11:30

The time the call to the callee was initiated. If the call was not initiated, this parameter has the same value as call_time. For SMS records, this is the message reception time.

ring_time

String

Yes

2021-08-25 20:11:35

The time the callee's phone started ringing. If the phone did not ring, this parameter has the same value as call_out_time. For SMS records, this is the message reception time.

record_url

String

No

https://*****.oss-cn-shanghai.aliyuncs.com

The URL to download the call recording from an Object Storage Service (OSS) bucket in the China (Shanghai) region.

Note

The recording download URL is valid for 30 days. It may take 15 to 20 minutes for the recording file to be generated. Wait for this period before downloading the file.

ring_record_url

String

No

https://****.oss-cn-shanghai.aliyuncs.com

The URL for the recording of the ringback tone the caller hears.

Note

The ringback tone recording URL is valid for 30 days. This URL is generated only if you have subscribed to ringback tone recordings.

free_ring_time

String

Yes

2021-08-25 20:11:35

The time the callee's phone actually started ringing.

  • If free_ring_time is later than call_out_time, it indicates that the callee's phone actually rang.

  • If free_ring_time is the same as call_out_time, it indicates that the phone did not ring.

  • If this time cannot be obtained, this parameter has the same value as ring_time.

control_msg

String

No

OK

Continuation message. Valid values:

  • OK: Normal.

  • NO_SUBS_EXIST: No subscription exists.

id

String

Yes

101456851****

The unique ID for the report entry.

secret_no

String

Yes

186****7614

The private number, which is the number X.

call_type

Integer

Yes

1

The type of call. Valid values:

  • 0: Outbound call. phone_no calls peer_no.

  • 1: Inbound call. peer_no calls phone_no.

  • 4: call interception.

control_type

String

No

CONTINUE

The current call handling stage. Valid values:

  • IVR

  • CONTINUE

  • REJECT

release_time

String

Yes

2021-08-25 20:11:41

The time the call was released, which marks the end of the billing duration. For SMS records, this is the message reception time.

Note

The difference between release_time and start_time is the call duration. A duration of 0 indicates that the call did not connect.

pool_key

String

Yes

FC10000009708****

The key of the corresponding number pool.

sub_id

Long

Yes

100004306803****

The subscription ID.

unconnected_cause

Integer

No

0

The reason the call did not connect. Valid values:

  • 1: Intercepted by blocklist.

  • 2: No subscription found.

  • 3: Call restriction.

  • 4: power-off.

  • 5: suspended.

  • 6: User busy.

  • 7: User rejected.

  • 99: Other.

call_time

String

Yes

2021-08-25 20:11:29

The time the caller initiated the call.

peer_no

String

Yes

152****1504

Number B, N number, or G group number.

called_display_no

String

Yes

158****0000

The number displayed to the callee.

release_dir

Integer

Yes

1

The party that terminated the call. Valid values:

  • 0: platform hang-up.

  • 1: caller hang-up.

  • 2: callee hang-up.

call_id

String

Yes

43612633712c****

The ID of the call record.

Note

The call_id must not exceed 100 characters in length.

start_time

String

Yes

2021-08-10 15:46:16

The time the callee answered the call, which marks the start of the billing duration. If the call did not connect, this parameter has the same value as release_time. For SMS records, this is the message reception time.

partner_key

String

Yes

FC10000013150****

The merchant key.

out_id

String

No

7368136812621****

The external business ID. The maximum length is 128 characters.

release_cause

Integer

No

31

The reason the call was released. For more information, see call record error codes.

extension

String

No

8011

The extension number.

call_status

String

No

BUSY

The intelligent status code.

Note

call_status is an intelligent status code. Due to carrier-side limitations, this field might not be included in every call detail report message. For more information, see the value descriptions below.

call_status values

Value

Status

Description

ANSWERED

Call connected.

The callee answered, and the call was successfully established.

BUSY

Callee busy.

This status is returned in the following scenarios:

When a caller initiates a call, they first hear a prompt such as "The number you are calling is busy, please hold", and are then transferred to a normal call attempt.

  • The caller hangs up during the initial audio prompt.

  • The caller hangs up after the prompt while being transferred.

  • The callee hangs up during the initial audio prompt.

  • The callee hangs up after the prompt while being transferred.

  • The call times out because the callee does not answer. The caller first hears the busy prompt, then hears a timeout prompt such as "The person you are calling is unavailable".

In all of these busy-line scenarios, the final status is BUSY, regardless of whether the callee rejects the call or the caller hangs up.

NO_ANSWER

No answer.

Returned if the callee does not answer or reject the call within 30 seconds while the callee's line is idle.

REJECT

Callee rejected.

Returned if the callee rejects the incoming call within 30 seconds of ringing.

HANGUP

Caller hung up.

Returned if the caller hangs up within 30 seconds while the callee's line is idle and the callee has not rejected the call.

INVALID_NUMBER

Invalid number.

Returned when the callee's phone number is an invalid number.

POWER_OFF

Power-off.

Returned when the callee's phone is powered off or in airplane mode.

UNAVAILABLE

Temporarily unavailable.

Returned for ambiguous failures, such as when the line is out of service or temporarily unreachable, or when ASR recognition is inconclusive.

SUSPEND

Suspended.

Returned when the callee's phone service is suspended.

NETWORK_ERROR

Network restriction.

Includes network restrictions such as carrier interception.

OTHER

Other failure.

-

TP_TIMEOUT

Call without a subscription.

-

Response

Response sample

{
  "code" : 0,
  "msg" : "Received successfully"
}

Parameters

Parameter

Type

Required

Example

Description

code

Number

Yes

0

The response code.

msg

String

No

Received successfully

A descriptive message.

Note
  • The platform expects your endpoint to return an HTTP 200 status code to confirm it received the message. The platform only checks that the code in your JSON response is a number; it does not validate the content. If your endpoint returns a non-200 HTTP status code or the request times out, the platform retries the delivery.

  • If your application encounters a system exception or fails to process the message, return an HTTP 5xx status code.

Retry policy

After an initial failed delivery, the platform retries at intervals of 1 minute, 5 minutes, and 10 minutes. If the delivery fails after three retries, the platform makes no further attempts.