This method lets you retrieve details of all completed calls. The maximum number of results that you can fetch with a single API call is 20.
GET
https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Call/
All the below arguments are optional
from_number | The number from which the calls were made. If you want to filter results by source number. You can filter the details by using the exact number or the prefix. |
to_number | The destination number to which the calls were made, if you want to filter results by destination. You can filter the details by using the exact number or the prefix |
call_direction | The direction of the call, if you want to filter results by call direction. Allowed values: inbound, outbound |
bill_duration | Filters calls by billed duration in seconds. The filter can be used in these five forms:
|
end_time | Filters calls by their completion time. The time format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. The filter can be used in these five forms:
|
Note: Calls made only in the last 90-days can be retrieved via APIs.
You can combine these filters to get call detail records that were added during a particular time range. If you don’t use the end_time filter when you search, Plivo uses a search window of the last 30 days from the current date. Alternatively, you can use end_time__[lt|lte] and end_time__[gt|gte] to search a range of times for CDRs of up to 90 days of search boundary. If the provided range exceeds the 90-day boundary, the API will return a 400 response code, signaling an error. Timestamps need to be UTC timestamps. |
|
hangup_cause_code | Retrieves calls that were hung up with a specific hangup cause code. Refer to our list of hangup causes and sources |
hangup_source | Retrieves calls that were hung up by a specific hangup source. Refer to our list of hangup causes and sources Allowed values: customer, carrier & zentrunk |
limit | Limits the number of results retrieved. The maximum it can be set to is 20. Defaults to 20. |
offset | Denotes the number of value items by which the results should be offset. For example, if the results contains 1,000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results. |
stir_verification | For outbound calls: Gives details about the attestation assigned to the call by Plivo For inbound calls: Gives details about the attestation received on the inbound call to your Plivo phone number. Allowed Values:
|
Returns the call objects that match the filters specified in the request.
{
"api_id": "a04ad809-3b78-4bbe-9baf-acfc7800b10f",
"meta": {
"limit": 20,
"offset": 0,
"total_count": 2,
"previous": null,
"next": null
},
"objects": [
{
"call_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
"from_number": "+12025551111",
"to_number": "+13128574907",
"call_direction": "outbound",
"call_duration": 4,
"bill_duration": 60,
"end_time": "2022-12-06 07:02:00",
"hangup_cause_name": "normal_hangup",
"hangup_source": "carrier",
"total_rate": "0.03000",
"total_amount": "0.00200",
“billed_duration”: 60,
"initiation_time": "2022-12-06 07:01:48",
"answer_time": "2022-12-06 07:01:56",
"trunk_domain": "93667062664669661.ap-south-1.zt.plivo.com",
"from_country": "IN",
"to_country": "IN",
"transport_protocol": "udp",
"srtp": false,
"hangup_cause_code": 3000,
"secure_trunking": false,
"secure_trunking_rate": "0.00000",
"stir_verification": "Verified",
"attestation_indicator": "A"
},
{
"call_uuid": "0b6eb07-796c-4d86-a4fd-44ed11667ddbe",
"from_number": "+912235328936",
"to_number": "+919943720205",
"call_direction": "outbound",
"trunk_id": "0b6eb07-796c-4d86-a4fd-44ed11667ddb",
"call_duration": 4,
"bill_duration": 4,
"end_time": "2022-12-06 07:02:00",
"hangup_cause_name": "normal_hangup",
"hangup_source": "carrier",
"total_rate": "0.03000",
"total_amount": "0.00200",
“billed_duration”: 60,
"initiation_time": "2022-12-06 07:01:48",
"answer_time": "2022-12-06 07:01:56",
"trunk_domain": "93667062664669661.ap-south-1.zt.plivo.com",
"from_country": "IN",
"to_country": "IN",
"transport_protocol": "udp",
"srtp": false,
"hangup_cause_code": 3000,
"secure_trunking": false,
"secure_trunking_rate": "0.00000",
"stir_verification": "Not Applicable",
"attestation_indicator": "null"
}
]
}
1
1
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
require 'vendor/autoload.php';
use Plivo\RestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new RestClient("<auth_id>", "<auth_token>");
try {
$response = $client->ZentrunkCalls->list(
[
'limit' => 5,
'offset' => 2
]
);
print_r($response);
}
catch (PlivoRestException $ex)
{
print_r($ex);
}
?>
1
1
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Call/
1