Skip to contentSkip to navigationSkip to topbar
On this page

Call Summaries Resource


A Call Summary provides an overview of

  • metadata, and
  • quality metrics

for a single call.

Using the Call Summaries Resource, you can get a list of Call Summaries.

To get the Call Summary for an individual call use the Call Summary Resource.

(information)

Info

Voice Insights Advanced Features must be active to use this API Resource.

(information)

Info

A completed Call Summary may take up to a half hour to generate, but a partial summary record will be available within ten minutes of a call ending.


Call Summary properties

call-summary-properties page anchor

The following table contains the top-level properties of a single Call Summary instance.

A Call Summary is a complex data structure with several of the top-level properties constituting nested objects.

The top level contains attributes and properties objects, and each edge of a call has metrics for both directions of the media stream as well as properties and summarized metrics. Further information for these object-typed properties can be found on the Details: Call Summary page.

Whether a particular edge is present will depend on the call type. A Voice SDK call will have an sdk_edge and a client_edge. A SIP trunking call will have a sip_edge and a carrier_edge. A SIP domain or <Dial><Sip> call will have only a sip_edge. A PSTN call will have only a carrier_edge. See Understanding Twilio Media Edges for a conceptual explanation.

Property nameTypeRequiredDescriptionChild properties
account_sidSID<AC>

Optional

Not PII

The unique SID identifier of the Account.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

call_sidSID<CA>

Optional

The unique SID identifier of the Call.

Pattern: ^CA[0-9a-fA-F]{32}$Min length: 34Max length: 34

answered_byenum<string>

Optional

The Answered By value for the summarized call based on Answering Machine Detection (AMD). One of unknown, machine_start, machine_end_beep, machine_end_silence, machine_end_other, human or fax. Refer to AMD for more detail.

Possible values:
unknownmachine_startmachine_end_beepmachine_end_silencemachine_end_otherhumanfax

call_typeenum<string>

Optional

The Call Type of the summarized Call. One of carrier, sip, trunking or client.

Possible values:
carriersiptrunkingclient

call_stateenum<string>

Optional

The Call State of the summarized Call. One of ringing, completed, busy, fail, noanswer, canceled, answered, undialed.

Possible values:
ringingcompletedbusyfailnoanswercanceledansweredundialed

processing_stateenum<string>

Optional

The Processing State of the Call Summary. The Processing State will be partial until the assembly of the Call Summary finishes, which occurs approximately 30 minutes after Call end. Then the Processing State changes to complete

Possible values:
completepartial

created_timestring<date-time>

Optional

The time at which the Call was created, given in ISO 8601 format. Can be different from start_time in the event of queueing due to CPS


start_timestring<date-time>

Optional

The time at which the Call was started, given in ISO 8601 format.


end_timestring<date-time>

Optional

The time at which the Call was ended, given in ISO 8601 format.


durationinteger

Optional

Duration between when the call was initiated and the call was ended


connect_durationinteger

Optional

Duration between when the call was answered and when it ended


fromobject

Optional

PII MTL: 30 days

The calling party.


toobject

Optional

The called party.


carrier_edgeobject

Optional

Contains metrics and properties for the Twilio media gateway of a PSTN call.


client_edgeobject

Optional

Contains metrics and properties for the Twilio media gateway of a Client call.


sdk_edgeobject

Optional

Contains metrics and properties for the SDK sensor library for Client calls.


sip_edgeobject

Optional

Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call.


tagsarray[string]

Optional

Tags applied to calls by Voice Insights analysis indicating a condition that could result in subjective degradation of the call quality.


urlstring<uri>

Optional

The URL of this resource.


attributesobject

Optional

Attributes capturing call-flow-specific details.


propertiesobject

Optional

Contains edge-agnostic call-level details.


trustobject

Optional

Contains trusted communications details including Branded Call and verified caller ID.


annotationnull

Optional


Read multiple Call Summary resources

read-multiple-call-summary-resources page anchor
GET https://insights.twilio.com/v1/Voice/Summaries

Query parameters

query-parameters page anchor
Property nameTypeRequiredPIIDescription
Fromstring

Optional

A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.


Tostring

Optional

A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name.


FromCarrierstring

Optional

An origination carrier.


ToCarrierstring

Optional

A destination carrier.


FromCountryCodestring

Optional

A source country code based on phone number in From.


ToCountryCodestring

Optional

A destination country code. Based on phone number in To.


VerifiedCallerboolean

Optional

A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.One of 'true' or 'false'.


HasTagboolean

Optional

A boolean flag indicating the presence of one or more Voice Insights Call Tags.


StartTimestring

Optional

A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h.


EndTimestring

Optional

An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m.


CallTypestring

Optional

A Call Type of the calls. One of carrier, sip, trunking or client.


CallStatestring

Optional

A Call State of the calls. One of ringing, completed, busy, fail, noanswer, canceled, answered, undialed.


Directionstring

Optional

A Direction of the calls. One of outbound_api, outbound_dial, inbound, trunking_originating, trunking_terminating.


ProcessingStateenum<string>

Optional

A Processing State of the Call Summaries. One of completed, partial or all.

Possible values:
completedstartedpartialall

SortByenum<string>

Optional

A Sort By criterion for the returned list of Call Summaries. One of start_time or end_time.

Possible values:
start_timeend_time

SubaccountSID<AC>

Optional

A unique SID identifier of a Subaccount.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

AbnormalSessionboolean

Optional

A boolean flag indicating an abnormal session where the last SIP response was not 200 OK.


AnsweredByenum<string>

Optional

An Answered By value for the calls based on Answering Machine Detection (AMD). One of unknown, machine_start, machine_end_beep, machine_end_silence, machine_end_other, human or fax.

Possible values:
unknownmachine_startmachine_end_beepmachine_end_silencemachine_end_otherhumanfax

AnsweredByAnnotationstring

Optional

Either machine or human.


ConnectivityIssueAnnotationstring

Optional

A Connectivity Issue with the calls. One of no_connectivity_issue, invalid_number, caller_id, dropped_call, or number_reachability.


QualityIssueAnnotationstring

Optional

A subjective Quality Issue with the calls. One of no_quality_issue, low_volume, choppy_robotic, echo, dtmf, latency, owa, static_noise.


SpamAnnotationboolean

Optional

A boolean flag indicating spam calls.


CallScoreAnnotationstring

Optional

A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad].


BrandedEnabledboolean

Optional

A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. One of 'true' or 'false'


VoiceIntegrityEnabledboolean

Optional

A boolean flag indicating whether or not the phone number had voice integrity enabled.One of 'true' or 'false'


BrandedBundleSidstring

Optional

A unique SID identifier of the Branded Call.


VoiceIntegrityBundleSidstring

Optional

A unique SID identifier of the Voice Integrity Profile.


VoiceIntegrityUseCasestring

Optional

A Voice Integrity Use Case . Is of type enum. One of 'abandoned_cart', 'appointment_reminders', 'appointment_scheduling', 'asset_management', 'automated_support', 'call_tracking', 'click_to_call', 'contact_tracing', 'contactless_delivery', 'customer_support', 'dating/social', 'delivery_notifications', 'distance_learning', 'emergency_notifications', 'employee_notifications', 'exam_proctoring', 'field_notifications', 'first_responder', 'fraud_alerts', 'group_messaging', 'identify_&verification', 'intelligent_routing', 'lead_alerts', 'lead_distribution', 'lead_generation', 'lead_management', 'lead_nurturing', 'marketing_events', 'mass_alerts', 'meetings/collaboration', 'order_notifications', 'outbound_dialer', 'pharmacy', 'phone_system', 'purchase_confirmation', 'remote_appointments', 'rewards_program', 'self-service', 'service_alerts', 'shift_management', 'survey/research', 'telehealth', 'telemarketing', 'therapy(individual+group)'.


BusinessProfileIdentitystring

Optional

A Business Identity of the calls. Is of type enum. One of 'direct_customer', 'isv_reseller_or_partner'.


BusinessProfileIndustrystring

Optional

A Business Industry of the calls. Is of type enum. One of 'automotive', 'agriculture', 'banking', 'consumer', 'construction', 'education', 'engineering', 'energy', 'oil_and_gas', 'fast_moving_consumer_goods', 'financial', 'fintech', 'food_and_beverage', 'government', 'healthcare', 'hospitality', 'insurance', 'legal', 'manufacturing', 'media', 'online', 'professional_services', 'raw_materials', 'real_estate', 'religion', 'retail', 'jewelry', 'technology', 'telecommunications', 'transportation', 'travel', 'electronics', 'not_for_profit'


BusinessProfileBundleSidstring

Optional

A unique SID identifier of the Business Profile.


BusinessProfileTypestring

Optional

A Business Profile Type of the calls. Is of type enum. One of 'primary', 'secondary'.


PageSizeinteger

Optional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

Pageinteger

Optional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstring

Optional

The page token. This is provided by the API.

Read multiple Call SummariesLink to code sample: Read multiple Call Summaries
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listCallSummaries() {
11
const callSummaries = await client.insights.v1.callSummaries.list({
12
limit: 20,
13
});
14
15
callSummaries.forEach((c) => console.log(c.accountSid));
16
}
17
18
listCallSummaries();

Output

1
{
2
"meta": {
3
"page": 0,
4
"page_size": 25,
5
"first_page_url": "https://insights.twilio.com/v1/Voice/Summaries?PageSize=25&Page=0",
6
"previous_page_url": null,
7
"next_page_url": null,
8
"key": "call_summaries",
9
"url": "https://insights.twilio.com/v1/Voice/Summaries?PageSize=25&Page=0"
10
},
11
"call_summaries": []
12
}
Read multiple Call Summaries from to/from specific carriers for a data rangeLink to code sample: Read multiple Call Summaries from to/from specific carriers for a data range
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listCallSummaries() {
11
const callSummaries = await client.insights.v1.callSummaries.list({
12
startTime: "4h",
13
toCarrier: "AT&T Wireless",
14
limit: 20,
15
});
16
17
callSummaries.forEach((c) => console.log(c.accountSid));
18
}
19
20
listCallSummaries();

Output

1
{
2
"meta": {
3
"page": 0,
4
"page_size": 25,
5
"first_page_url": "https://insights.twilio.com/v1/Voice/Summaries?ToCarrier=AT%26T+Wireless&AnsweredBy=machine_start&VoiceIntegrityEnabled=true&StartTime=4h&BrandedEnabled=true&PageSize=25&Page=0",
6
"previous_page_url": null,
7
"next_page_url": null,
8
"key": "call_summaries",
9
"url": "https://insights.twilio.com/v1/Voice/Summaries?ToCarrier=AT%26T+Wireless&AnsweredBy=machine_start&VoiceIntegrityEnabled=true&StartTime=4h&BrandedEnabled=true&PageSize=25&Page=0"
10
},
11
"call_summaries": [
12
{
13
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
14
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
"created_time": "2021-08-25T03:40:25Z",
16
"start_time": "2021-08-25T03:40:25Z",
17
"end_time": "2021-08-25T03:40:45Z",
18
"duration": 20,
19
"connect_duration": 20,
20
"call_type": "carrier",
21
"call_state": "completed",
22
"answered_by": "machine_start",
23
"from": {
24
"caller": "+15555555555",
25
"carrier": "T-Mobile USA, Inc.",
26
"connection": "mobile",
27
"number_prefix": "1555",
28
"location": {
29
"lat": 40.83885,
30
"lon": -74.04568
31
},
32
"country_code": "US"
33
},
34
"to": {
35
"callee": "+15555555556",
36
"carrier": "AT&T Wireless",
37
"connection": "mobile",
38
"number_prefix": "1555",
39
"location": {
40
"lat": 33.42767,
41
"lon": -86.886475
42
},
43
"country_code": "US"
44
},
45
"processing_state": "complete",
46
"sdk_edge": null,
47
"sip_edge": null,
48
"client_edge": null,
49
"carrier_edge": {
50
"properties": {
51
"media_region": "us1",
52
"signaling_region": "us1",
53
"edge_location": "xxxxx",
54
"direction": "inbound"
55
},
56
"metrics": {
57
"inbound": {
58
"codec": 0,
59
"codec_name": "pcmu",
60
"packets_received": 202,
61
"packets_lost": 0,
62
"packets_loss_percentage": 0,
63
"jitter": {
64
"max": 1.48209,
65
"avg": 0.483035
66
}
67
},
68
"outbound": {
69
"codec": 0,
70
"codec_name": "pcmu",
71
"packets_sent": 218,
72
"packets_lost": 0,
73
"packets_loss_percentage": 0,
74
"jitter": {
75
"max": 0.51868,
76
"avg": 0.364434
77
}
78
}
79
}
80
},
81
"tags": [
82
"high_packet_loss",
83
"high_jitter"
84
],
85
"attributes": {
86
"conference_participant": false
87
},
88
"properties": {
89
"last_sip_response_num": 200,
90
"pdd_ms": 121,
91
"disconnected_by": "callee",
92
"direction": "inbound"
93
},
94
"trust": {
95
"verified_caller": {
96
"verified": true
97
},
98
"branded": {
99
"enabled": true,
100
"display_name": "Owl bank",
101
"long_display_name": "Owl bank Ltd",
102
"bundle_sid": "BU5ceeea51b1424478fc541dfef0e2b167"
103
},
104
"business_profile": {
105
"bundle_sid": "BU5ceeea51b1424478fc541dfef0e2b167",
106
"identity": "direct_customer",
107
"industry": "BANKING",
108
"type": "corporate"
109
},
110
"voice_integrity": {
111
"enabled": true,
112
"bundle_sid": "BU5ceeea51b1424478fc541dfef0e2b167",
113
"use_case": "customer_support"
114
}
115
},
116
"annotation": null,
117
"url": "https://insights.twilio.com/v1/Voice/Summaries"
118
},
119
{
120
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
121
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
122
"created_time": "2021-08-25T02:20:25Z",
123
"start_time": "2021-08-25T02:20:25Z",
124
"end_time": "2021-08-25T02:40:45Z",
125
"duration": 18,
126
"connect_duration": 18,
127
"call_type": "carrier",
128
"call_state": "completed",
129
"answered_by": "machine_start",
130
"from": {
131
"caller": "+15555555555",
132
"carrier": "T-Mobile USA, Inc.",
133
"connection": "mobile",
134
"number_prefix": "1555",
135
"location": {
136
"lat": 40.83885,
137
"lon": -74.04568
138
},
139
"country_code": "US"
140
},
141
"to": {
142
"callee": "+15555555556",
143
"carrier": "AT&T Wireless",
144
"connection": "mobile",
145
"number_prefix": "1555",
146
"location": {
147
"lat": 33.42767,
148
"lon": -86.886475
149
},
150
"country_code": "US"
151
},
152
"processing_state": "complete",
153
"sdk_edge": null,
154
"sip_edge": null,
155
"client_edge": null,
156
"carrier_edge": {
157
"properties": {
158
"media_region": "us1",
159
"signaling_region": "us1",
160
"edge_location": "xxxxx",
161
"direction": "inbound"
162
},
163
"metrics": {
164
"inbound": {
165
"codec": 0,
166
"codec_name": "pcmu",
167
"packets_received": 100,
168
"packets_lost": 0,
169
"packets_loss_percentage": 0,
170
"jitter": {
171
"max": 1.48209,
172
"avg": 0.483035
173
}
174
},
175
"outbound": {
176
"codec": 0,
177
"codec_name": "pcmu",
178
"packets_sent": 102,
179
"packets_lost": 0,
180
"packets_loss_percentage": 0,
181
"jitter": {
182
"max": 0.51868,
183
"avg": 0.364434
184
}
185
}
186
}
187
},
188
"tags": null,
189
"attributes": {
190
"conference_participant": false
191
},
192
"properties": {
193
"last_sip_response_num": 200,
194
"pdd_ms": 121,
195
"disconnected_by": "callee",
196
"direction": "inbound"
197
},
198
"trust": {
199
"verified_caller": {
200
"verified": true
201
},
202
"branded": {
203
"enabled": true,
204
"display_name": "Owl bank",
205
"long_display_name": "Owl bank Ltd",
206
"bundle_sid": "BU5ceeea51b1424478fc541dfef0e2b167"
207
},
208
"business_profile": {
209
"bundle_sid": "BU5ceeea51b1424478fc541dfef0e2b167",
210
"identity": "direct_customer",
211
"industry": "BANKING",
212
"type": "corporate"
213
},
214
"voice_integrity": {
215
"enabled": true,
216
"bundle_sid": "BU5ceeea51b1424478fc541dfef0e2b167",
217
"use_case": "customer_support"
218
}
219
},
220
"annotation": null,
221
"url": "https://insights.twilio.com/v1/Voice/Summaries"
222
}
223
]
224
}
Read multiple Call Summaries from a subaccount with detected issuesLink to code sample: Read multiple Call Summaries from a subaccount with detected issues
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listCallSummaries() {
11
const callSummaries = await client.insights.v1.callSummaries.list({
12
callType: "client",
13
hasTag: true,
14
startTime: "7d",
15
subaccount: "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
16
limit: 20,
17
});
18
19
callSummaries.forEach((c) => console.log(c.accountSid));
20
}
21
22
listCallSummaries();

Output

1
{
2
"meta": {
3
"page": 0,
4
"page_size": 25,
5
"first_page_url": "https://insights.twilio.com/v1/Voice/Summaries?CallType=client&StartTime=7d&HasTag=true&Subaccount=ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab&PageSize=25&Page=0",
6
"previous_page_url": null,
7
"next_page_url": null,
8
"key": "call_summaries",
9
"url": "https://insights.twilio.com/v1/Voice/Summaries?CallType=client&StartTime=7d&HasTag=true&Subaccount=ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab&PageSize=25&Page=0"
10
},
11
"call_summaries": [
12
{
13
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
14
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
15
"created_time": "2021-08-25T04:16:35Z",
16
"start_time": "2021-08-25T04:16:36Z",
17
"end_time": "2021-08-25T04:16:42Z",
18
"duration": 7,
19
"connect_duration": 6,
20
"call_type": "client",
21
"call_state": "completed",
22
"answered_by": "machine_start",
23
"from": {
24
"caller": "client:+15555555555",
25
"connection": "twilio_sdk"
26
},
27
"to": {
28
"callee": "client:TBBXXXXXXXXXXXX",
29
"connection": "twilio_sdk"
30
},
31
"processing_state": "complete",
32
"sdk_edge": null,
33
"sip_edge": null,
34
"client_edge": {
35
"properties": {
36
"media_region": "us1",
37
"signaling_region": "us1",
38
"twilio_media_ip": "54.xxx.xx.xxx",
39
"external_media_ip": "54.xxx.xx.xxx",
40
"edge_location": "xxxxxx",
41
"direction": "inbound"
42
},
43
"metrics": {
44
"inbound": {
45
"codec": 0,
46
"codec_name": "pcmu",
47
"packets_received": 252,
48
"packets_lost": 0,
49
"packets_loss_percentage": 0,
50
"jitter": {
51
"max": 5.60994,
52
"avg": 0.933334
53
}
54
},
55
"outbound": {
56
"codec": 0,
57
"codec_name": "pcmu",
58
"packets_sent": 229,
59
"packets_lost": 0,
60
"packets_loss_percentage": 0,
61
"jitter": {
62
"max": 0.960786,
63
"avg": 0.399859
64
}
65
}
66
}
67
},
68
"carrier_edge": null,
69
"tags": [
70
"high_pdd"
71
],
72
"attributes": {
73
"conference_participant": false
74
},
75
"properties": {
76
"last_sip_response_num": 200,
77
"pdd_ms": 58,
78
"disconnected_by": "callee",
79
"direction": "inbound"
80
},
81
"trust": null,
82
"annotation": null,
83
"url": "https://insights.twilio.com/v1/Voice/Summaries"
84
},
85
{
86
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
87
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
88
"created_time": "2021-08-25T04:16:35Z",
89
"start_time": "2021-08-25T04:16:37Z",
90
"end_time": "2021-08-25T04:16:40Z",
91
"duration": 5,
92
"connect_duration": 3,
93
"call_type": "client",
94
"call_state": "completed",
95
"answered_by": "machine_start",
96
"from": {
97
"caller": "+15555555555",
98
"carrier": "Verizon",
99
"connection": "landline",
100
"number_prefix": "1555",
101
"location": {
102
"lat": 40.83885,
103
"lon": -74.04568
104
},
105
"country_code": "US"
106
},
107
"to": {
108
"callee": "client:TBBTXXXXXX",
109
"connection": "twilio_sdk"
110
},
111
"processing_state": "complete",
112
"sdk_edge": null,
113
"sip_edge": null,
114
"client_edge": {
115
"properties": {
116
"media_region": "us1",
117
"signaling_region": "us1",
118
"twilio_media_ip": "54.xxx.xx.xxx",
119
"external_media_ip": "54.xxx.xx.xxx",
120
"edge_location": "xxxxx",
121
"direction": "outbound"
122
},
123
"metrics": {
124
"inbound": {
125
"codec": 0,
126
"codec_name": "pcmu",
127
"packets_received": 110,
128
"packets_lost": 0,
129
"packets_loss_percentage": 0,
130
"jitter": {
131
"max": 1.05918,
132
"avg": 0.461966
133
}
134
},
135
"outbound": {
136
"codec": 0,
137
"codec_name": "pcmu",
138
"packets_sent": 147,
139
"packets_lost": 0,
140
"packets_loss_percentage": 0,
141
"jitter": {
142
"max": 0.869174,
143
"avg": 0.319674
144
}
145
}
146
}
147
},
148
"carrier_edge": null,
149
"tags": null,
150
"attributes": {
151
"conference_participant": false
152
},
153
"properties": {
154
"last_sip_response_num": 200,
155
"pdd_ms": 35,
156
"disconnected_by": "callee",
157
"direction": "outbound_api"
158
},
159
"trust": null,
160
"annotation": null,
161
"url": "https://insights.twilio.com/v1/Voice/Summaries"
162
}
163
]
164
}
Read multiple Call Summaries for outbound calls signed with SHAKEN/STIRLink to code sample: Read multiple Call Summaries for outbound calls signed with SHAKEN/STIR
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listCallSummaries() {
11
const callSummaries = await client.insights.v1.callSummaries.list({
12
direction: "outbound_api,outbound_dial,trunking_terminating",
13
startTime: "1d",
14
verifiedCaller: true,
15
limit: 20,
16
});
17
18
callSummaries.forEach((c) => console.log(c.accountSid));
19
}
20
21
listCallSummaries();

Output

1
{
2
"meta": {
3
"page": 0,
4
"page_size": 25,
5
"first_page_url": "https://insights.twilio.com/v1/Voice/Summaries?Direction=outbound_api%2Coutbound_dial%2Ctrunking_terminating&StartTime=1d&VerifiedCaller=true&PageSize=25&Page=0",
6
"previous_page_url": null,
7
"next_page_url": null,
8
"key": "call_summaries",
9
"url": "https://insights.twilio.com/v1/Voice/Summaries?Direction=outbound_api%2Coutbound_dial%2Ctrunking_terminating&StartTime=1d&VerifiedCaller=true&PageSize=25&Page=0"
10
},
11
"call_summaries": [
12
{
13
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
14
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
"created_time": "2021-08-25T14:31:18Z",
16
"start_time": "2021-08-25T14:31:22Z",
17
"end_time": "2021-08-25T14:32:02Z",
18
"duration": 44,
19
"connect_duration": 41,
20
"call_type": "trunking",
21
"call_state": "completed",
22
"answered_by": "machine_start",
23
"from": {
24
"caller": "+15555555555",
25
"carrier": "ACS",
26
"connection": "landline",
27
"number_prefix": "1555",
28
"location": {
29
"lat": 60.268353,
30
"lon": -141.13632
31
},
32
"country_code": "US"
33
},
34
"to": {
35
"callee": "+15555555556",
36
"carrier": "Hawaiian Telcom, Inc. - HI",
37
"connection": "landline",
38
"number_prefix": "1555",
39
"location": {
40
"lat": 20.956036,
41
"lon": -157.23793
42
},
43
"country_code": "US"
44
},
45
"processing_state": "complete",
46
"sdk_edge": null,
47
"sip_edge": {
48
"properties": {
49
"media_region": "us1",
50
"signaling_region": "us1",
51
"twilio_media_ip": "54.xxx.xx.xx",
52
"twilio_signaling_ip": "54.xxx.xx.xx",
53
"external_signaling_ip": "54.xxx.xx.xx",
54
"sip_call_id": "xxxxx@0.0.0.0",
55
"user_agent": "xxxx",
56
"edge_location": "xxxxx",
57
"trunk_sid": "xxxxxxx",
58
"direction": "inbound"
59
},
60
"metrics": {
61
"outbound": {
62
"codec": 0,
63
"codec_name": "pcmu",
64
"packets_sent": 1953,
65
"packets_lost": 0,
66
"packets_loss_percentage": 0,
67
"jitter": {
68
"max": 1.76407,
69
"avg": 0.23138
70
},
71
"latency": {
72
"max": 0.386,
73
"avg": 0.3765
74
}
75
}
76
}
77
},
78
"client_edge": null,
79
"carrier_edge": {
80
"properties": {
81
"media_region": "us1",
82
"signaling_region": "us1",
83
"edge_location": "xxxx",
84
"direction": "outbound"
85
}
86
},
87
"tags": [
88
"silence"
89
],
90
"attributes": {
91
"conference_participant": false
92
},
93
"properties": {
94
"last_sip_response_num": 200,
95
"pdd_ms": 1990,
96
"disconnected_by": "caller",
97
"direction": "trunking_terminating"
98
},
99
"trust": {
100
"verified_caller": {
101
"verified": true
102
}
103
},
104
"annotation": null,
105
"url": "https://insights.twilio.com/v1/Voice/Summaries"
106
},
107
{
108
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
109
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
110
"created_time": "2021-08-25T14:03:31Z",
111
"start_time": "2021-08-25T14:03:32Z",
112
"end_time": "2021-08-25T14:03:38Z",
113
"duration": 7,
114
"connect_duration": 6,
115
"call_type": "carrier",
116
"call_state": "completed",
117
"answered_by": "machine_start",
118
"from": {
119
"caller": "+15555555555",
120
"carrier": "T-Mobile USA, Inc.",
121
"connection": "mobile",
122
"number_prefix": "1555",
123
"location": {
124
"lat": 40.83885,
125
"lon": -74.04568
126
},
127
"country_code": "US"
128
},
129
"to": {
130
"callee": "+15555555556",
131
"carrier": "T-Mobile USA, Inc.",
132
"connection": "mobile",
133
"number_prefix": "1555",
134
"location": {
135
"lat": 34.186115,
136
"lon": -118.43555
137
},
138
"country_code": "US"
139
},
140
"processing_state": "complete",
141
"sdk_edge": null,
142
"sip_edge": null,
143
"client_edge": null,
144
"carrier_edge": {
145
"properties": {
146
"media_region": "us1",
147
"signaling_region": "us1",
148
"edge_location": "xxxx",
149
"direction": "outbound"
150
},
151
"metrics": {
152
"inbound": {
153
"codec": 0,
154
"codec_name": "pcmu",
155
"packets_received": 229,
156
"packets_lost": 0,
157
"packets_loss_percentage": 0,
158
"jitter": {
159
"max": 1.10303,
160
"avg": 0.449886
161
}
162
},
163
"outbound": {
164
"codec": 0,
165
"codec_name": "pcmu",
166
"packets_sent": 273,
167
"packets_lost": 0,
168
"packets_loss_percentage": 0,
169
"jitter": {
170
"max": 0.410031,
171
"avg": 0.295951
172
}
173
}
174
}
175
},
176
"tags": null,
177
"attributes": {
178
"conference_participant": false
179
},
180
"properties": {
181
"last_sip_response_num": 200,
182
"pdd_ms": 315,
183
"disconnected_by": "callee",
184
"direction": "outbound_api"
185
},
186
"trust": {
187
"verified_caller": {
188
"verified": true
189
}
190
},
191
"annotation": null,
192
"url": "https://insights.twilio.com/v1/Voice/Summaries"
193
},
194
{
195
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
196
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
197
"created_time": "2021-08-24T22:28:17Z",
198
"start_time": "2021-08-24T22:28:20Z",
199
"end_time": "2021-08-24T22:28:23Z",
200
"duration": 4,
201
"connect_duration": 3,
202
"call_type": "carrier",
203
"call_state": "completed",
204
"answered_by": "machine_start",
205
"from": {
206
"caller": "+15555555555",
207
"carrier": "Hawaiian Telcom, Inc. - HI",
208
"connection": "landline",
209
"number_prefix": "1555",
210
"location": {
211
"lat": 20.956036,
212
"lon": -157.23793
213
},
214
"country_code": "US"
215
},
216
"to": {
217
"callee": "+15555555556",
218
"connection": "pstn"
219
},
220
"processing_state": "complete",
221
"sdk_edge": null,
222
"sip_edge": null,
223
"client_edge": null,
224
"carrier_edge": {
225
"properties": {
226
"media_region": "us1",
227
"signaling_region": "us1",
228
"edge_location": "xxxx",
229
"direction": "outbound"
230
},
231
"metrics": {
232
"outbound": {
233
"codec": 0,
234
"codec_name": "pcmu",
235
"packets_sent": 103,
236
"packets_lost": 0,
237
"packets_loss_percentage": 0,
238
"jitter": {
239
"max": 0.596712,
240
"avg": 0.251725
241
}
242
}
243
}
244
},
245
"tags": [
246
"silence"
247
],
248
"attributes": null,
249
"properties": {
250
"last_sip_response_num": 200,
251
"pdd_ms": 105,
252
"disconnected_by": "caller",
253
"direction": "outbound_dial"
254
},
255
"trust": null,
256
"annotation": null,
257
"url": "https://insights.twilio.com/v1/Voice/Summaries"
258
}
259
]
260
}
Read multiple Call Summaries for SIP calls which did not end in 200 OKLink to code sample: Read multiple Call Summaries for SIP calls which did not end in 200 OK
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listCallSummaries() {
11
const callSummaries = await client.insights.v1.callSummaries.list({
12
abnormalSession: true,
13
callState: "completed",
14
callType: "sip,trunking",
15
startTime: "15d",
16
limit: 20,
17
});
18
19
callSummaries.forEach((c) => console.log(c.accountSid));
20
}
21
22
listCallSummaries();

Output

1
{
2
"meta": {
3
"page": 0,
4
"page_size": 25,
5
"first_page_url": "https://insights.twilio.com/v1/Voice/Summaries?CallType=sip%2Ctrunking&CallState=completed&StartTime=15d&AbnormalSession=true&PageSize=25&Page=0",
6
"previous_page_url": null,
7
"next_page_url": null,
8
"key": "call_summaries",
9
"url": "https://insights.twilio.com/v1/Voice/Summaries?CallType=sip%2Ctrunking&CallState=completed&StartTime=15d&AbnormalSession=true&PageSize=25&Page=0"
10
},
11
"call_summaries": [
12
{
13
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
14
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
"created_time": "2021-08-25T14:46:40Z",
16
"start_time": "2021-08-25T14:46:40Z",
17
"end_time": "2021-08-25T14:46:52Z",
18
"duration": 12,
19
"connect_duration": 12,
20
"call_type": "sip",
21
"call_state": "completed",
22
"answered_by": "machine_start",
23
"from": {
24
"caller": "+15555555555",
25
"carrier": "XO Communications, Inc.",
26
"connection": "landline",
27
"number_prefix": "1555",
28
"location": {
29
"lat": 40.83885,
30
"lon": -74.04568
31
},
32
"country_code": "US"
33
},
34
"to": {
35
"callee": "sip:xxxx@xx.xxx.xx.xxx",
36
"connection": "sip_interface"
37
},
38
"processing_state": "complete",
39
"sdk_edge": null,
40
"sip_edge": {
41
"properties": {
42
"media_region": "us1",
43
"signaling_region": "us1",
44
"twilio_media_ip": "xx.xxx.xx.xxx",
45
"twilio_signaling_ip": "xx.xx.xx.xx",
46
"external_media_ip": "xx.xxx.xx.xxx",
47
"external_signaling_ip": "xx.xxx.xx.xxx",
48
"sip_call_id": "xxxxxxxx@0.0.0.0",
49
"edge_location": "xxxxx",
50
"direction": "outbound"
51
},
52
"metrics": {
53
"inbound": {
54
"codec": 0,
55
"codec_name": "pcmu",
56
"packets_received": 525,
57
"packets_lost": 0,
58
"packets_loss_percentage": 0,
59
"jitter": {
60
"max": 0.554729,
61
"avg": 0.229541
62
}
63
},
64
"outbound": {
65
"codec": 0,
66
"codec_name": "pcmu",
67
"packets_sent": 245,
68
"packets_lost": 0,
69
"packets_loss_percentage": 0,
70
"jitter": {
71
"max": 1.03548,
72
"avg": 0.344092
73
}
74
}
75
}
76
},
77
"client_edge": null,
78
"carrier_edge": null,
79
"tags": null,
80
"attributes": {
81
"conference_participant": false
82
},
83
"properties": {
84
"last_sip_response_num": 200,
85
"pdd_ms": 255,
86
"disconnected_by": "callee",
87
"direction": "outbound_dial"
88
},
89
"trust": null,
90
"annotation": null,
91
"url": "https://insights.twilio.com/v1/Voice/Summaries"
92
},
93
{
94
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
95
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
96
"created_time": "2021-08-25T14:31:18Z",
97
"start_time": "2021-08-25T14:31:22Z",
98
"end_time": "2021-08-25T14:32:02Z",
99
"duration": 44,
100
"connect_duration": 41,
101
"call_type": "trunking",
102
"call_state": "completed",
103
"answered_by": "machine_start",
104
"from": {
105
"caller": "+15555555555",
106
"carrier": "ACS",
107
"connection": "landline",
108
"number_prefix": "1555",
109
"location": {
110
"lat": 60.268353,
111
"lon": -141.13632
112
},
113
"country_code": "US"
114
},
115
"to": {
116
"callee": "+15555555556",
117
"carrier": "Hawaiian Telcom, Inc. - HI",
118
"connection": "landline",
119
"number_prefix": "1555",
120
"location": {
121
"lat": 20.956036,
122
"lon": -157.23793
123
},
124
"country_code": "US"
125
},
126
"processing_state": "complete",
127
"sdk_edge": null,
128
"sip_edge": {
129
"properties": {
130
"media_region": "us1",
131
"signaling_region": "us1",
132
"twilio_media_ip": "54.xxx.xx.xx",
133
"twilio_signaling_ip": "54.xxx.xx.xx",
134
"external_signaling_ip": "54.xxx.xx.xx",
135
"sip_call_id": "xxxxx@0.0.0.0",
136
"user_agent": "xxxx",
137
"edge_location": "xxxxx",
138
"trunk_sid": "xxxxxxx",
139
"direction": "inbound"
140
},
141
"metrics": {
142
"outbound": {
143
"codec": 0,
144
"codec_name": "pcmu",
145
"packets_sent": 1953,
146
"packets_lost": 0,
147
"packets_loss_percentage": 0,
148
"jitter": {
149
"max": 1.76407,
150
"avg": 0.23138
151
},
152
"latency": {
153
"max": 0.386,
154
"avg": 0.3765
155
}
156
}
157
}
158
},
159
"client_edge": null,
160
"carrier_edge": {
161
"properties": {
162
"media_region": "us1",
163
"signaling_region": "us1",
164
"edge_location": "xxxx",
165
"direction": "outbound"
166
}
167
},
168
"tags": [
169
"silence"
170
],
171
"attributes": {
172
"conference_participant": false
173
},
174
"properties": {
175
"last_sip_response_num": 200,
176
"pdd_ms": 1990,
177
"disconnected_by": "caller",
178
"direction": "trunking_terminating"
179
},
180
"trust": {
181
"verified_caller": {
182
"verified": true
183
}
184
},
185
"annotation": null,
186
"url": "https://insights.twilio.com/v1/Voice/Summaries"
187
}
188
]
189
}
Read multiple Call Summaries with annotationsLink to code sample: Read multiple Call Summaries with annotations
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listCallSummaries() {
11
const callSummaries = await client.insights.v1.callSummaries.list({
12
answeredBy: "human",
13
callScoreAnnotation: "1",
14
connectivityIssueAnnotation: "no_connectivity_issue",
15
qualityIssueAnnotation: "latency",
16
spamAnnotation: false,
17
startTime: "15d",
18
limit: 20,
19
});
20
21
callSummaries.forEach((c) => console.log(c.accountSid));
22
}
23
24
listCallSummaries();

Output

1
{
2
"meta": {
3
"page": 0,
4
"page_size": 25,
5
"first_page_url": "https://insights.twilio.com/v1/Voice/Summaries?PageSize=25&Page=0",
6
"previous_page_url": null,
7
"next_page_url": null,
8
"key": "call_summaries",
9
"url": "https://insights.twilio.com/v1/Voice/Summaries?PageSize=25&Page=0"
10
},
11
"call_summaries": []
12
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.