Latest Legacy

The Zentrunk Call

The Zentrunk REST API provides details of completed calls.

API Endpoint

BaseURI https://zt.plivo.com/v1/Account/{auth_id}/Call/

The Zentrunk Call object

A Zentrunk object is created when an outbound call is initiated or when an inbound call is received. You can use the Call object to retrieve details about completed calls.

Attributes

call_uuid string

The unique identifier used to identify the call.

duration string

The duration of the call in seconds. This might be different from the bill_duration based on the billing interval of the prefix called.

from_number string

The number from which the calls were made.

to_number string

The destination number to which the call was made.

trunk_id string

Unique ID of the trunk on which the call was made.

trunk_domain string

The unique name of the trunk.

region string

The regional server through which the call went.

bill_duration optional

The duration for which the call was billed in seconds. This might be different from the duration based on the billing interval of the prefix called.

end_time optional

The timestamp when the call ended.

call_direction string

Indicates whether the call was outbound or inbound.

hangup_initiator optional

The source for the call hangup. Refer to our list of hangup causes and sources.

hangup_cause optional

The reason for the call hangup. Refer to our list of hangup causes and sources. Refer to our list of hangup causes and sources.

rate integer

The per-minute rate charged based on the destination number.

initiation_time string

The timestamp when the call was initiated.

answer_time string

The timestamp when the call was answered.

from_country string

The call origination country.

to_counrty string

The call destination country.

transport_protocol string

The protocol used to transport the media.

srtp boolean

If connection made was srtp or RTP.

secure_trunking string

The rate associated for secure trunking

secure_trunking_rate string

If Secure Trunking is enabled: Zentrunk will communicate with your PBX or SBC over TLS for Signaling.

If Secure Trunking is disabled: The calls will be over TCP/UDP for Signaling.

stir_verification optional

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:

  • Verified means the call is from a verified caller who has authorized access to the customer’s caller ID, and hence should be treated with confidence. Verified is equivalent to attestation level A.
  • Not Verified means that, for this call, either the caller is not verified, or it’s uncertain whether they have access to the caller ID used, or both. Not Verified means the call received attestation level B or C.
  • Not Applicable means STIR/SHAKEN doesn’t apply to this call, as would be the case if a call is not addressed to a US number or if it’s a cloud call (WebRTC or SIP).

Read more about STIR/SHAKEN here.

hangup_code integer

The integer code for the hangup cause. Refer to our list of hangup causes and sources.

total_amount integer

The total amount charged for the call.

Example Object

{
      "call_uuid": "6c3a8b60-26e0-4842-9387-2350de79f16b",
      "bill_duration": 7200,
      "trunk_id": "126041xxxx",
      "end_time": "2022-05-26 13:32:37",
      "from_number": 552135006716,
      "to_number": 12604109832,
      "call_direction": "outbound",
      "duration": 28,
      "hangup_cause": "normal_hangup",
      "hangup_initiator": "customer",
      "rate": 0.318,
      "total_amount": 0.318,
      "initiation_time": "2022-05-26 13:32:06",
      "answer_time": "2022-05-26 13:32:09",
      "trunk_domain": "31723558297410168.zt.plivops.com",
      "region": "us-east-1",
      "from_country": "BR",
      "to_country": "US",
      "transport_protocol": "udp",
      "srtp": false,
      "hangup_code": 3010,
      "secure_trunking": true,
      "secure_trunking_rate": 0,
      "stir_verification": "Not Verified"
    }

Pagination

Plivo uses offset-based pagination to list resources.

For instance, if your search request has a result of 100 objects with limit = 10 and offset = 5, then objects with indices 51 through 60 are returned.

Parameters used for pagination

limit integer

A limit on the number of results to be returned. limit can range between 1 and 20, and the default is 20.

offset integer

A pagination cursor to denote the number of objects by which the results should be offset.

Retrieve details of all calls

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.

API Endpoint

GET https://zt.plivo.com/v1/Account/{auth_id}/Call/

Arguments

initiation_time string

The timestamp when the call was initiated.

Timezone: Local timezone as updated in the Plivo console

Format: yyyy-MM-dd HH:mm:ss

call_direction string

The direction of the call, if you want to filter results by call direction.

Allowed values: </mark>inbound</mark>, outbound.

from_number string

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 string

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.

trunk_id string

The ID of a trunk, if you want to retrieve only calls made from a specific trunk.

bill_duration optional

Filters calls by billed duration in seconds. The filter can be used in these five forms:

  • bill_duration: Input the exact value. For example, to retrieve calls that were exactly three minutes long, use bill_duration=180

  • bill_duration__gt: gt stands for greater than. To retrieve calls that were more than two hours long, use bill_duration__gt=7200

  • bill_duration__gte: gte stands for greater than or equal to. To retrieve calls that were two hours or more in duration, use bill_duration__gte=7200

  • bill_duration__lt: lt stands for less than. To retrieve calls that were less than seven minutes long, use bill_duration__lt=420

  • bill_duration__lte: lte stands for lesser than or equal to. To retrieve calls that were two hours or less in duration, use bill_duration__lte=7200

end_time optional

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:

  • end_time: To get all calls that ended at 2021-03-21 11:47[:30], use end_time=2021-03-21 11:47[:30]

  • end_time__gt: gt stands for greater than. To get all calls that ended after 2021-03-21 11:47, use end_time__gt=2021-03-21 11:47

  • end_time__gte: gte stands for greater than or equal to. To get all calls that ended after or exactly at 2021-03-21 11:47[:30], use end_time__gte=2021-03-21 11:47[:30]

  • end_time__lt: lt stands for less than. To get all calls that ended before 2021-03-21 11:47, use end_time__lt=2021-03-21 11:47

  • end_time__lte: lte stands for less than or equal to. To get all calls that ended before or exactly at 2021-03-21 11:47[:30], use end_time__lte=2021-03-21 11:47[:30]

limit optional

Limits the number of results retrieved. The maximum it can be set to is 20.

Defaults to 20.

offset optional

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.

Response

HTTP Status Code: 200

{
  "api_id": "91d15144-e8c1-45fa-8226-061702f297fe",
  "meta": {
    "limit": 20,
    "next": true,
    "offset": 0,
    "previous": false,
    "total_count": 4
  },
  "objects": [
    {
      "call_uuid": "6c3a8b60-26e0-4842-9387-2350de79f16b",
      "bill_duration": 7200,
      "trunk_id": "126041xxxx",
      "end_time": "2022-05-26 13:32:37",
      "from_number": 552135006716,
      "to_number": 12604109832,
      "call_direction": "outbound",
      "duration": 28,
      "hangup_cause": "normal_hangup",
      "hangup_initiator": "customer",
      "rate": 0.318,
      "total_amount": 0.318,
      "initiation_time": "2022-05-26 13:32:06",
      "answer_time": "2022-05-26 13:32:09",
      "trunk_domain": "31723558297410168.zt.plivops.com",
      "region": "us-east-1",
      "from_country": "BR",
      "to_country": "US",
      "transport_protocol": "udp",
      "srtp": false,
      "hangup_code": 3010,
      "secure_trunking": true,
      "secure_trunking_rate": 0,
      "stir_verification": "Not Verified"
    }
  ]
}