Table: twilio_account_call - Query Twilio Calls using SQL
Twilio Calls represent individual voice calls made through the Twilio platform. They include details such as the call's status, start and end times, duration, and the phone numbers involved. Twilio's call resource is a key component of its voice communication services.
Table Usage Guide
The twilio_account_call
table provides insights into individual call details within the Twilio platform. As a developer or system administrator, explore call-specific details through this table, including call status, duration, and associated phone numbers. Utilize it to analyze call patterns, troubleshoot call issues, and monitor the usage of Twilio's voice communication services.
Examples
Basic info
Gain insights into the direction and status of calls made through a specific account, including when each call started and ended. This can help in tracking call activities and understanding call patterns for customer service improvement.
select sid, called_to, direction, status, start_time, end_time, account_sidfrom twilio_account_call;
select sid, called_to, direction, status, start_time, end_time, account_sidfrom twilio_account_call;
List outgoing calls
Analyze the details of outgoing calls made via an application's API, providing insights into call statuses and durations, which can be useful for assessing call performance and usage patterns.
select sid, called_to, direction, status, start_time, end_time, account_sidfrom twilio_account_callwhere direction = 'outbound-api';
select sid, called_to, direction, status, start_time, end_time, account_sidfrom twilio_account_callwhere direction = 'outbound-api';
List unsuccessful calls
Explore which calls were unsuccessful to identify potential issues with your telecommunication system. This can help in troubleshooting and improving the overall call success rate.
select sid, called_to, direction, status, start_time, end_time, account_sidfrom twilio_account_callwhere status = 'failed';
select sid, called_to, direction, status, start_time, end_time, account_sidfrom twilio_account_callwhere status = 'failed';
Schema for twilio_account_call
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_sid | text | =, !=, ~~, ~~*, !~~, !~~* | The SID of the Account that created the resource. |
annotation | text | The annotation provided for the call. | |
answered_by | text | Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise. | |
api_version | text | The API version used to process the message. | |
called_from | text | = | The phone number, SIP address or Client identifier that made this call. |
called_to | text | = | The phone number, SIP address or Client identifier that received this call. |
caller_name | text | The caller's name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty. | |
date_created | timestamp with time zone | The date and time that the resource was created. | |
date_updated | timestamp with time zone | The date and time that the resource was last updated. | |
direction | text | A string describing the direction of the call. `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `Dial` verb. | |
duration | bigint | The length of the call in seconds. | |
end_time | timestamp with time zone | >, >=, =, <, <= | The end time of the call. Null if the call did not complete successfully. |
forwarded_from | text | The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty. | |
from_formatted | text | The calling phone number, SIP address, or Client identifier formatted for display. | |
group_sid | text | The Group SID associated with this call. If no Group is associated with the call, the field is empty. | |
parent_call_sid | text | The SID that identifies the call that created this leg. | |
phone_number_sid | text | If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed. | |
price | double precision | The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. | |
price_unit | text | The currency in which 'price' is measured. | |
queue_time | bigint | The wait time in milliseconds before the call is placed. | |
sid | text | = | The unique string that identifies the resource. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
start_time | timestamp with time zone | >, >=, =, <, <= | The start time of the call. Null if the call has not yet been dialed. |
status | text | = | The status of this call. |
sub_resource_uris | jsonb | A list of related subresources identified by their relative URIs. | |
to_formatted | text | The phone number, SIP address or Client identifier that received this call. Formatted for display. | |
trunk_sid | text | The unique identifier of the trunk resource that was used for this call. | |
uri | text | The URI of the resource, relative to 'https://api.twilio.com'. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- twilio
You can pass the configuration to the command with the --config
argument:
steampipe_export_twilio --config '<your_config>' twilio_account_call