Call Insights Event Resource
A Call Insights Event is an object representing an event which occurred during a voice call.
The Call Insights Event resource supports the following event types:
Using the Call Insights Event Resource, you can read a list of Call Insights Events for a specific voice call.
Warning
Voice Insights Advanced Features must be active to use this API Resource.
Info
Events are typically available via the API within 90 seconds.
The following table details the properties of a single Call Insights Event instance.
The unique SID identifier of the Call.
^CA[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique SID identifier of the Account.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The Edge of this Event. One of unknown_edge, carrier_edge, sip_edge, sdk_edge or client_edge.
unknown_edgecarrier_edgesip_edgesdk_edgeclient_edgeThe Level of this Event. One of UNKNOWN, DEBUG, INFO, WARNING or ERROR.
UNKNOWNDEBUGINFOWARNINGERRORobject Represents the connection between Twilio and our immediate carrier partners. The events here describe the call lifecycle as reported by Twilio's carrier media gateways. See Details: Call Summary for the object properties.
object Represents the Twilio media gateway for SIP interface and SIP trunking calls. The events here describe the call lifecycle as reported by Twilio's public media gateways. See Details: Call Summary for the object properties.
object Represents the Voice SDK running locally in the browser or in the Android/iOS application. The events here are emitted by the Voice SDK in response to certain call progress events, network changes, or call quality conditions. See Details: Call Summary for the object properties.
object Represents the Twilio media gateway for Client calls. The events here describe the call lifecycle as reported by Twilio's Voice SDK media gateways. See Details: Call Summary for the object properties.
GET https://insights.twilio.com/v1/Voice/{CallSid}/Events
Use this action to retrieve a list of Call Insights Events for the specified voice call.
You can use the optional edge parameter to filter the list by media edge. See Understanding Twilio Media Edges for more information.
If no edge parameter is provided, the resulting list will depend on the call type:
| Call Type | Default Edge | Additional Edge |
|---|---|---|
| Carrier | carrier_edge | N/A |
| SIP | sip_edge | N/A |
| Client | sdk_edge | client_edge |
| Trunking Originating | carrier_edge | sip_edge |
| Trunking Terminating | sip_edge | carrier_edge |
The unique SID identifier of the Call.
^CA[0-9a-fA-F]{32}$Min length: 34Max length: 34The Edge of this Event. One of unknown_edge, carrier_edge, sip_edge, sdk_edge or client_edge.
unknown_edgecarrier_edgesip_edgesdk_edgeclient_edgeHow many resources to return in each list page. The default is 50, and the maximum is 1000.
1Maximum: 1000The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listEvent() {11const events = await client.insights.v112.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.events.list({ limit: 20 });1415events.forEach((e) => console.log(e.timestamp));16}1718listEvent();
Response
1{2"meta": {3"page": 0,4"page_size": 50,5"first_page_url": "https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0",6"previous_page_url": null,7"next_page_url": null,8"key": "events",9"url": "https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0"10},11"events": [12{13"timestamp": "2019-09-19T22:15:23Z",14"call_sid": "CA03a02b156c6faa96c86906f7e9ad0f38",15"account_sid": "AC998c10b68cbfda9f67277f7d8f4439c9",16"edge": "sdk_edge",17"group": "connection",18"name": "error",19"level": "ERROR",20"sdk_edge": {21"error": {22"code": 3160023},24"metadata": {25"client_name": "GTI9300323095d271b890c91568931321395",26"location": {27"lat": 37.4192,28"lon": -122.057429},30"city": "Mountain View",31"country_code": "US",32"country_subdivision": "California",33"ip_address": "108.177.7.83",34"sdk": {35"type": "twilio-voice-android",36"version": "4.5.1",37"platform": "android",38"selected_region": "gll",39"os": {40"name": "android",41"version": "4.3"42},43"device": {44"model": "GT-I9300",45"type": "GT-I9300",46"vendor": "samsung",47"arch": "armeabi-v7a"48}49}50}51},52"client_edge": null,53"carrier_edge": null,54"sip_edge": null55},56{57"timestamp": "2019-09-19T22:15:23Z",58"call_sid": "CA03a02b156c6faa96c86906f7e9ad0f38",59"account_sid": "AC998c10b68cbfda9f67277f7d8f4439c9",60"name": "configurations",61"group": "conversation_relay",62"sdk_edge": null,63"sip_edge": null,64"client_edge": null,65"carrier_edge": null,66"level": null,67"edge": null68},69{70"timestamp": "2019-09-19T22:15:23Z",71"call_sid": "CA03a02b156c6faa96c86906f7e9ad0f38",72"account_sid": "AC998c10b68cbfda9f67277f7d8f4439c9",73"name": "call_wrap_up",74"group": "conversation_relay",75"sdk_edge": null,76"sip_edge": null,77"client_edge": null,78"carrier_edge": null,79"edge": null,80"level": null81},82{83"timestamp": "2019-09-19T22:15:23Z",84"call_sid": "CA03a02b156c6faa96c86906f7e9ad0f38",85"account_sid": "AC998c10b68cbfda9f67277f7d8f4439c9",86"name": "final_token_received",87"group": "conversation_relay",88"sdk_edge": null,89"sip_edge": null,90"client_edge": null,91"carrier_edge": null,92"level": null93}94]95}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listEvent() {11const events = await client.insights.v112.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.events.list({14edge: "sdk_edge",15limit: 20,16});1718events.forEach((e) => console.log(e.timestamp));19}2021listEvent();
Response
1{2"meta": {3"page": 0,4"page_size": 50,5"first_page_url": "https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0",6"previous_page_url": null,7"next_page_url": null,8"key": "events",9"url": "https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0"10},11"events": [12{13"timestamp": "2019-09-19T22:15:23Z",14"call_sid": "CA03a02b156c6faa96c86906f7e9ad0f38",15"account_sid": "AC998c10b68cbfda9f67277f7d8f4439c9",16"edge": "sdk_edge",17"group": "connection",18"name": "error",19"level": "ERROR",20"sdk_edge": {21"error": {22"code": 3160023},24"metadata": {25"client_name": "GTI9300323095d271b890c91568931321395",26"location": {27"lat": 37.4192,28"lon": -122.057429},30"city": "Mountain View",31"country_code": "US",32"country_subdivision": "California",33"ip_address": "108.177.7.83",34"sdk": {35"type": "twilio-voice-android",36"version": "4.5.1",37"platform": "android",38"selected_region": "gll",39"os": {40"name": "android",41"version": "4.3"42},43"device": {44"model": "GT-I9300",45"type": "GT-I9300",46"vendor": "samsung",47"arch": "armeabi-v7a"48}49}50}51},52"client_edge": null,53"carrier_edge": null,54"sip_edge": null55},56{57"timestamp": "2019-09-19T22:15:23Z",58"call_sid": "CA03a02b156c6faa96c86906f7e9ad0f38",59"account_sid": "AC998c10b68cbfda9f67277f7d8f4439c9",60"name": "configurations",61"group": "conversation_relay",62"sdk_edge": null,63"sip_edge": null,64"client_edge": null,65"carrier_edge": null,66"level": null,67"edge": null68},69{70"timestamp": "2019-09-19T22:15:23Z",71"call_sid": "CA03a02b156c6faa96c86906f7e9ad0f38",72"account_sid": "AC998c10b68cbfda9f67277f7d8f4439c9",73"name": "call_wrap_up",74"group": "conversation_relay",75"sdk_edge": null,76"sip_edge": null,77"client_edge": null,78"carrier_edge": null,79"edge": null,80"level": null81},82{83"timestamp": "2019-09-19T22:15:23Z",84"call_sid": "CA03a02b156c6faa96c86906f7e9ad0f38",85"account_sid": "AC998c10b68cbfda9f67277f7d8f4439c9",86"name": "final_token_received",87"group": "conversation_relay",88"sdk_edge": null,89"sip_edge": null,90"client_edge": null,91"carrier_edge": null,92"level": null93}94]95}