Calls
Create, query, update, and delete calls between phones and Twilio.
Table-Specific Information
SELECT
The provider uses the Twilio API to process WHERE clause conditions built with the following columns and operators. The rest of the filter is executed client-side within the provider.
| Column | Supported Operators |
| Sid | = |
| ParentCallSid | = |
| Status | = |
| StartTime | =, >, >=, <, <= |
| EndTime | =, >, >=, <, <= |
For example:
SELECT * FROM Calls WHERE StartTime >= '2014-10-10' AND EndTime <= '2015-10-10'
INSERT
From, To, and one of Url, Twiml, or ApplicationSid are required for INSERT. Because this is a conditional one-of-three requirement, the driver does not enforce it locally; if none of the three is provided, Twilio will reject the request with an API error.
INSERT INTO Calls([From], [To], Url) VALUES ('+12243318812', '+919870123123', 'https://example.com')
UPDATE
UPDATE Calls SET Status = 'canceled' WHERE Sid = 'CAa123'
DELETE
The following is an example of how to delete from the Calls table.DELETE FROM Calls WHERE Sid = 'CAa123'
Columns
| Name | Type | ReadOnly | References | Description |
| Sid [KEY] | String | True |
The Id of the call. | |
| DateCreated | Datetime | True |
The creation date of the call. | |
| DateUpdated | Datetime | True |
The modification date of the call. | |
| ParentCallSid | String | True |
The Id of the parent call. | |
| AccountSid | String | True |
The Id of the account that created the call. | |
| To | String | False |
The phone number, SIP address, or client identifier that is called. | |
| ToFormatted | String | True |
The formatted phone number, SIP address, or client identifier that is called. | |
| From | String | False |
The phone number, SIP address, or client identifier that has made the call. | |
| FromFormatted | String | True |
The formatted number, SIP address, or client identifier that has made the call. | |
| PhoneNumberSid | String | True |
If the call was inbound, the Sid of the IncomingPhoneNumber that received the call. For an outbound call, the Sid of the OutgoingCallerId that made the call. | |
| Status | String | False |
The status of the call. One of the following values: queued, ringing, in-progress, canceled, completed, failed, busy, or no-answer. Set to canceled or completed to end an in-progress call. The allowed values are queued, ringing, in-progress, canceled, completed, failed, busy, no-answer. | |
| StartTime | Datetime | True |
The start time of the call. Empty if the call has not yet been dialed. | |
| EndTime | Datetime | True |
The end time of the call. Empty if the call did not complete successfully. | |
| Duration | Integer | True |
The duration of the call. Empty for busy, failed, unanswered, or ongoing calls. | |
| Price | Decimal | True |
The price of the call after the call is completed. | |
| Direction | String | True |
The direction of the call. One of the following values: inbound, outbound-api, or outbound-dial. The allowed values are inbound, outbound-api, outbound-dial. | |
| AnsweredBy | String | True |
One of the following values if the call was initiated with answering machine detection: human or machine. Empty otherwise. | |
| ApiVersion | String | True |
The API version of the call. | |
| ForwardedFrom | String | True |
The phone number that forwarded an incoming call. Note that the carrier must support forwarding. | |
| CallerName | String | True |
The caller name to a phone number that has Caller Id Lookup enabled. | |
| Uri | String | True |
The URI for the call. | |
| PriceUnit | String | True |
The currency used in the price property. | |
| TrunkSid | String | True |
The Id of the trunk resource used for this call. | |
| QueueTime | Long | True |
The wait time in milliseconds before the call is placed. | |
| GroupSid | String | True |
The Group SID associated with this call. If no Group is associated with the call, the field is empty. | |
| SubresourceUris | String | True |
The subresources available for the given call. | |
| Annotation | String | True |
A user-defined string that provides additional information about the call. |
Pseudocolumns
Pseudocolumn fields can be used in SELECT, INSERT, and UPDATE statements to provide additional control over data retrieval and modification in the data source.
| Name | Type | Description |
| Url | String |
The absolute URL that returns TwiML instructions for the call. Required for INSERT unless Twiml or ApplicationSid is provided. Applicable to INSERT and UPDATE queries. |
| Twiml | String |
TwiML instructions for the call. Mutually exclusive with Url and ApplicationSid. Applicable to INSERT and UPDATE queries. |
| ApplicationSid | String |
The SID of the Application that should handle the call. Mutually exclusive with Url and Twiml. Applicable to INSERT queries only. |
| Method | String |
The HTTP method to use when calling Url. Allowed values: GET, POST. Default is POST. Applicable to INSERT and UPDATE queries. |
| FallbackUrl | String |
The URL to call if an error occurs when fetching or executing the TwiML from Url. Applicable to INSERT and UPDATE queries. |
| FallbackMethod | String |
The HTTP method to use when requesting FallbackUrl. Allowed values: GET, POST. Default is POST. Applicable to INSERT and UPDATE queries. |
| StatusCallback | String |
The URL to call with status updates. Applicable to INSERT and UPDATE queries. |
| StatusCallbackMethod | String |
The HTTP method to use when calling StatusCallback. Allowed values: GET, POST. Default is POST. Applicable to INSERT and UPDATE queries. |
| StatusCallbackEvent | String |
The call progress events that trigger a StatusCallback. Allowed values: initiated, ringing, answered, completed. Applicable to INSERT queries only. |
| SendDigits | String |
A string of keys to dial after connecting to the number. Valid digits: 0-9, #, *, and w (wait 0.5 seconds). Applicable to INSERT queries only. |
| Timeout | Integer |
The integer number of seconds to wait for an answer. Default is 60 seconds. Applicable to INSERT queries only. |
| Record | Boolean |
Whether to record the call. Applicable to INSERT queries only. |
| RecordingChannels | String |
The number of channels in the recording. Allowed values: mono, dual. Applicable to INSERT queries only. |
| RecordingTrack | String |
The audio track to record. Allowed values: inbound, outbound, both. Applicable to INSERT queries only. |
| RecordingStatusCallback | String |
The URL to call when the recording is available. Applicable to INSERT queries only. |
| RecordingStatusCallbackMethod | String |
The HTTP method to use when calling RecordingStatusCallback. Allowed values: GET, POST. Applicable to INSERT queries only. |
| Trim | String |
Whether to trim silence from the recording. Allowed values: trim-silence, do-not-trim. Applicable to INSERT queries only. |
| TimeLimit | Integer |
The maximum duration of the call in seconds. Applicable to INSERT and UPDATE queries. |
| MachineDetection | String |
Whether to detect if a human or an answering machine picks up the call. Allowed values: Enable, DetectMessageEnd. Applicable to INSERT queries only. |