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_sidfrom twilio_account_incoming_phone_number;
select sid, friendly_name, phone_number, status, date_created, account_sidfrom 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_sidfrom twilio_account_incoming_phone_numberwhere emergency_address_status = 'unregistered';
select sid, friendly_name, phone_number, status, date_created, account_sidfrom twilio_account_incoming_phone_numberwhere 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_sidfrom twilio_account_call as c, twilio_account_incoming_phone_number as phwhere 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_sidfrom twilio_account_call as c, twilio_account_incoming_phone_number as phwhere c.status = 'completed' and ( ph.phone_number = c.called_to or ph.phone_number = c.called_from );
Schema for twilio_account_incoming_phone_number
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
account_sid | text | The SID of the Account that created the resource. | |
address_requirements | text | Indicates whether the phone number requires an address registered with Twilio, or not. | |
address_sid | text | The SID of the Address resource associated with the phone number. | |
api_version | text | The API version used to start a new TwiML session. | |
beta | boolean | !=, = | Indicates whether the phone number is new to the Twilio platform, or not. |
bundle_sid | text | The SID of the Bundle resource associated with number. | |
capabilities | jsonb | The set of Boolean properties that indicate whether a phone number can receive calls or messages. | |
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. | |
emergency_address_sid | text | The emergency address configuration to use for emergency calling. | |
emergency_address_status | text | State of the emergency address configuration for the phone number. | |
emergency_status | text | Displays if emergency calling is enabled for this number. | |
friendly_name | text | = | The string that you assigned to describe the resource. |
identity_sid | text | The SID of the Identity resource associated with number. | |
origin | text | = | The phone number's origin. Can be twilio or hosted. |
phone_number | text | = | The phone number in E.164 format. |
sid | text | The unique string that identifies the resource. | |
sms_application_sid | text | The SID of the application that handles SMS messages sent to the phone number. | |
sms_fallback_method | text | The HTTP method used with sms_fallback_url. | |
sms_fallback_url | text | The URL that we call when an error occurs while retrieving or executing the TwiML. | |
sms_method | text | The HTTP method to use with sms_url. | |
sms_url | text | The URL we call when the phone number receives an incoming SMS message. | |
status | text | The status of this resource. | |
status_callback | text | The URL to send status information to your application. | |
status_callback_method | text | The HTTP method we use to call status_callback. | |
title | text | Title of the resource. | |
trunk_sid | text | The SID of the Trunk that handles calls to the phone number. | |
uri | text | The URI of the resource, relative to 'https://api.twilio.com'. | |
voice_application_sid | text | The SID of the application that handles calls to the phone number. | |
voice_caller_id_lookup | boolean | Indicates whether to lookup the caller's name, or not. | |
voice_fallback_method | text | The HTTP method used with voice_fallback_url. | |
voice_fallback_url | text | The URL we call when an error occurs in TwiML. | |
voice_method | text | The HTTP method used with the voice_url. | |
voice_receive_mode | text | The mode of the voice receive. | |
voice_url | text | The 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