NAME
Twilio::Rest::Insights::V1::Call::Metric - The Metric resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
for my $metric ($client->insights->v1->calls($call_sid)->metrics->read({}, 20)) {
...
}
DESCRIPTION
This file holds MetricList, MetricPage and MetricInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
MetricList
Returned by $client->insights->v1->calls($call_sid)->metrics. See also Twilio::ListResource.
read
my @records = $client->insights->v1->calls($call_sid)->metrics->read(\%options, $limit, $page_size);
Get a list of Call Metrics for a Call. Returns the records as a list, fetching as many pages as it needs.
The options are:
direction-
The Direction of this Metric. One of
unknown,inbound,outboundorboth. One ofunknown,inbound,outboundorboth. edge-
The Edge of this Metric. One of
unknown_edge,carrier_edge,sip_edge,sdk_edgeorclient_edge. One ofunknown_edge,carrier_edge,sip_edge,sdk_edgeorclient_edge.
stream
my $stream = $client->insights->v1->calls($call_sid)->metrics->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->insights->v1->calls($call_sid)->metrics->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->insights->v1->calls($call_sid)->metrics->get_page($url);
Fetches the page at a URL given by Twilio.
MetricPage
A Twilio::Page of MetricInstance objects.
records_key
build_instance
Used by Twilio::Page.
MetricInstance
See also Twilio::InstanceResource.
Its fields are:
- account_sid
-
The unique SID identifier of the Account.
- call_sid
-
The unique SID identifier of the Call.
- carrier_edge
-
Contains metrics and properties for the Twilio media gateway of a PSTN call.
- client_edge
-
Contains metrics and properties for the Twilio media gateway of a Client call.
- direction
-
The Direction of the media stream from the perspective of the Twilio media edge. One of
unknown,inbound,outboundorboth. One ofunknown,inbound,outboundorboth. - edge
-
The Twilio media edge this Metric was captured on. One of
unknown_edge,carrier_edge,sip_edge,sdk_edgeorclient_edge. One ofunknown_edge,carrier_edge,sip_edge,sdk_edgeorclient_edge. - sdk_edge
-
Contains metrics and properties for the SDK sensor library for Client calls.
- sip_edge
-
Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call.
- timestamp
-
Timestamp of metric sample. Samples are taken every 10 seconds and contain the metrics for the previous 10 seconds.
CONSTRUCTORS
new
Objects here come from the methods above, so there is no need to call new directly.
LICENSE
Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.