Menu

Expand
Rate this page:

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
string Not PII

Timestamp of metric sample. Samples are taken every 10 seconds and contain the metrics for the previous 10 seconds.

call_sid
sid<CA> Not PII

The unique SID identifier of the Call.

account_sid
sid<AC> Not PII

The unique SID identifier of the Account.

edge
enum:twilio_edge Not PII

The Twilio media edge this Metric was captured on. One of unknown_edge, carrier_edge, sip_edge, sdk_edge or client_edge.

direction
enum:stream_direction Not PII

The Direction of the media stream from the perspective of the Twilio media edge. One of unknown, inbound, outbound or both.

carrier_edge
object Not PII

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

sip_edge
object Not PII

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

sdk_edge
object Not PII

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

client_edge
object Not PII

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

get
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
get sid<CA> Not PII

The unique SID identifier of the Call.

edge
Optional
get ienum:twilio_edge Not PII

The Edge of this Metric. One of unknown_edge, carrier_edge, sip_edge, sdk_edge or client_edge.

direction
Optional
get ienum:stream_direction Not PII

The Direction of this Metric. One of unknown, inbound, outbound or both.

Example 1
Loading Code Sample...
        
        

        Read multiple Call Metrics for a Call

        Example 2
        Loading Code Sample...
              
              

              Read multiple Call Metrics for a Call filtered by Media Edge

              Rate this page:

              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.

              Loading Code Sample...
                    
                    
                    

                    Thank you for your feedback!

                    Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                    Sending your feedback...
                    🎉 Thank you for your feedback!
                    Something went wrong. Please try again.

                    Thanks for your feedback!

                    thanks-feedback-gif