steampipe plugin install twilio

Table: twilio_account_incoming_phone_number - Query Twilio Incoming Phone Numbers using SQL

Twilio Incoming Phone Numbers are unique phone numbers that are assigned to your Twilio account. These numbers can be used to make and receive calls and text messages. They come with various features and capabilities, such as voice, fax, SMS, and MMS.

Table Usage Guide

The twilio_account_incoming_phone_number table provides insights into the incoming phone numbers associated with your Twilio account. As a developer or a system administrator, you can use this table to retrieve detailed information about each phone number, including its capabilities (voice, fax, SMS, MMS), status, and more. This information can be useful for managing and monitoring your communication capabilities with Twilio.

Examples

Basic info

Explore which phone numbers are associated with your Twilio account, identify their current status, and gain insights into when they were created. This is useful for managing and tracking your Twilio resources effectively.

select
sid,
friendly_name,
phone_number,
status,
date_created,
account_sid
from
twilio_account_incoming_phone_number;
select
sid,
friendly_name,
phone_number,
status,
date_created,
account_sid
from
twilio_account_incoming_phone_number;

List phone numbers with no emergency address registered

Identify phone numbers that have not registered an emergency address. This is useful for ensuring that all numbers are properly set up for emergency situations.

select
sid,
friendly_name,
phone_number,
status,
date_created,
account_sid
from
twilio_account_incoming_phone_number
where
emergency_address_status = 'unregistered';
select
sid,
friendly_name,
phone_number,
status,
date_created,
account_sid
from
twilio_account_incoming_phone_number
where
emergency_address_status = 'unregistered';

List call logs for a phone number

Gain insights into the completed calls associated with a specific phone number, including details such as the caller, receiver, timing, duration, and cost. This can be particularly useful for tracking communication patterns, monitoring costs, or identifying potential misuse of services.

select
c.called_from as caller,
c.called_to as receiver,
c.start_time,
c.end_time,
c.duration,
c.price,
c.price_unit,
c.account_sid
from
twilio_account_call as c,
twilio_account_incoming_phone_number as ph
where
c.status = 'completed'
and (
ph.phone_number = c.called_to
or ph.phone_number = c.called_from
);
select
c.called_from as caller,
c.called_to as receiver,
c.start_time,
c.end_time,
c.duration,
c.price,
c.price_unit,
c.account_sid
from
twilio_account_call as c,
twilio_account_incoming_phone_number as ph
where
c.status = 'completed'
and (
ph.phone_number = c.called_to
or ph.phone_number = c.called_from
);

Schema for twilio_account_incoming_phone_number

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
account_sidtextThe SID of the Account that created the resource.
address_requirementstextIndicates whether the phone number requires an address registered with Twilio, or not.
address_sidtextThe SID of the Address resource associated with the phone number.
api_versiontextThe API version used to start a new TwiML session.
betaboolean!=, =Indicates whether the phone number is new to the Twilio platform, or not.
bundle_sidtextThe SID of the Bundle resource associated with number.
capabilitiesjsonbThe set of Boolean properties that indicate whether a phone number can receive calls or messages.
date_createdtimestamp with time zoneThe date and time that the resource was created.
date_updatedtimestamp with time zoneThe date and time that the resource was last updated.
emergency_address_sidtextThe emergency address configuration to use for emergency calling.
emergency_address_statustextState of the emergency address configuration for the phone number.
emergency_statustextDisplays if emergency calling is enabled for this number.
friendly_nametext=The string that you assigned to describe the resource.
identity_sidtextThe SID of the Identity resource associated with number.
origintext=The phone number's origin. Can be twilio or hosted.
phone_numbertext=The phone number in E.164 format.
sidtextThe unique string that identifies the resource.
sms_application_sidtextThe SID of the application that handles SMS messages sent to the phone number.
sms_fallback_methodtextThe HTTP method used with sms_fallback_url.
sms_fallback_urltextThe URL that we call when an error occurs while retrieving or executing the TwiML.
sms_methodtextThe HTTP method to use with sms_url.
sms_urltextThe URL we call when the phone number receives an incoming SMS message.
statustextThe status of this resource.
status_callbacktextThe URL to send status information to your application.
status_callback_methodtextThe HTTP method we use to call status_callback.
titletextTitle of the resource.
trunk_sidtextThe SID of the Trunk that handles calls to the phone number.
uritextThe URI of the resource, relative to 'https://api.twilio.com'.
voice_application_sidtextThe SID of the application that handles calls to the phone number.
voice_caller_id_lookupbooleanIndicates whether to lookup the caller's name, or not.
voice_fallback_methodtextThe HTTP method used with voice_fallback_url.
voice_fallback_urltextThe URL we call when an error occurs in TwiML.
voice_methodtextThe HTTP method used with the voice_url.
voice_receive_modetextThe mode of the voice receive.
voice_urltextThe URL we call when the phone number receives a call.

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_incoming_phone_number