Call Metric Resource
A Call Metric is an object representing
- a set of quantitive measurements and
- meta data
related to the quality of a voice call.
Using the Call Metrics Resource, you can read a list of Call Metrics for a specified voice call.
Voice Insights Advanced Features must be active to use this API Resource.
Metrics are typically available via the API within 90 seconds of call completion.
Call Metric properties
The following table details the properties of a single Call Metric sample instance.
Resource Properties in REST API format | |
---|---|
timestamp
|
Timestamp of metric sample. Samples are taken every 10 seconds and contain the metrics for the previous 10 seconds. |
call_sid
|
The unique SID identifier of the Call. |
account_sid
|
The unique SID identifier of the Account. |
edge
|
The Twilio media edge this Metric was captured on. One of |
direction
|
The Direction of the media stream from the perspective of the Twilio media edge. One of |
carrier_edge
|
Contains metrics and properties for the Twilio media gateway of a PSTN call. |
sip_edge
|
Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. |
sdk_edge
|
Contains metrics and properties for the SDK sensor library for Client calls. |
client_edge
|
Contains metrics and properties for the Twilio media gateway of a Client call. |
Edge Metrics and properties
Metric samples from these edges contain the following properties:
Property | Description |
codec |
RTP profile number of the detected codec |
codec_name |
Name of the detected codec |
cumulative |
Cumulative jitter (max/avg), packets lost, and packet count for the stream received at this edge |
interval |
sdk_edge : audio in/out, jitter, packet loss, rtt, and packet loss percentage for the sampling interval. All other edges: packets received, packets lost, and packet loss percentage. |
metadata |
Twilio media region of the selected edge, Twilio and endpoint IP media IP addresses |
Read multiple Call Metric resources
https://insights.twilio.com/v1/Voice/{CallSid}/Metrics
Use this action to retrieve a list of Call Metrics 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 |
Parameters
Parameters in REST API format | |
---|---|
call_sid
Path
|
The unique SID identifier of the Call. |
edge
Optional
|
The Edge of this Metric. One of |
direction
Optional
|
The Direction of this Metric. One of |
Example 1
Example 2
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.