Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Call Data Resources

The event log provides events on any state change transitions that occur during a call, warnings seen on deteriorating network quality or audio equipment malfunction, and the events raised when the feedback submitted by the end user. At this time only Client Insights information is accessible via the API.

Get Call Events

The event log provides events on any state change transitions that occur during a call, warnings seen on deteriorating network quality or audio equipment malfunction, and the events raised when feedback submitted by the end user. You can get this event log with a GET request to the Events resource URI.

GET /Calls/{Call SID}/Events
        
        
        
        

        Query Parameters

        Parameter Description
        Level Filter event list for INFO, DEBUG, WARNING, and ERROR level events.
        Group Filter event list for events from specific groups.

        Resource Properties

        Event Properties Description
        group The group to which this event belongs. The group values can be: network-quality-warning-raised, network-quality-warning-cleared,audio-quality-warning-raised,audio-quality-warning-cleared, ice-connection-state, signaling-state, connection, feedback.
        name An identifier for the event.
        level Depending on the severity of the event, level can be: INFO, DEBUG, WARNING, or ERROR.
        timestamp Timestamp at which this event was logged on the client.
        account_sid AccountSid which was used to make this call.
        payload_type Payload type is application/JSON
        payload Payload that contains event specific data.
        sid The unique identifier for this event.
        account_friendly_name Name for the account that was used to make this call.
        parent_account_friendly_name Name for the parent account.
        parent_account_sid Account Sid of the parent account.
        publisher Name of the SDK/Server that published this event. This can be twilio-client-js, twilio-client-ios, twilio-client-android, or twilio-server.
        publisher_metadata This is an object that contains the characteristics of the publisher of this event.

        Publisher Metadata

        Property Description
        city City from which this client call was made to/answered.
        cpu_architecture CPU Architecture of the device that made/received this call (if available)
        engine_name Engine software rendering the web pages (ex. Gecko, Webkit, etc.)
        location.lat Latitude of the location where the client endpoint is located.
        location.lon Longitude of the location where the client endpoint is located.
        os_version Version number of the Operating System being used.
        device_model Model of the device being used with this client.
        os_name Operating System name being used for this client.
        country_iso_code Two letter ISO code representing the country.
        country Name of the country where the client is located.
        user_agent The raw user agent string that was extracted from the event publisher.
        device_type Device type (mobile/laptop/desktop)
        browser_major Major version number of the browser used to make the call.
        engine_version Version number of the engine software used to render web pages.
        device_vendor The manufacturer of the device. Typically null for JS.
        browser_version Major version number of the browser used to make the call.
        client_address IP Address of the client that made this call.
        browser_name Name of the browser that made the call.
        specific_subdivision Name of the location from which the call was made.

        Payload

        Property Description
        client_name Name of the Client as given by the developer.
        direction Outbound or Inbound as seen by Twilio.
        gateway AWS gateway through which the call is routed.
        temp_call_sid Temporary call Sid that was used while the call was being connected.
        selected_region The region selected by you. Default is GLL.
        region Region through which this call was routed.
        sdk_version Twilio Client SDK Version that was used to make this call.
        platform Underlying platform used by the client (WebRTC/ORTC/iOS)
        audio_constraints AudioConstraints parameters: Twilio Client’s audioConstraints parameter now allows you to enable or disable features like AGC by passing audio constraints directly to the underlying call to getUserMedia.
        timestamp_ms Timestamp to millisecond accuracy.
        data Data object contains additional information specific to the event payload.

        Get Call Metrics

        To measure the quality of network the Twilio client sensor library samples quality metrics every second throughout the lifecycle of a call. These metrics are sent every 10 seconds to the Twilio Insights backend. You can get the metrics data for a call with a GET request to the Metrics resource.

        GET /Calls/{Call SID}/Metrics
              
              
              
              

              Resource Properties

              Property Description
              call_sid Call Sid is the unique identifier for this call.
              timestamp Timestamp at which this metric payload was recorded.
              timestamp_ms Timestamp with millisecond accuracy.
              jitter Jitter is the measure of variability in RTT. This is measured in milliseconds. High jitter correlates with poor call quality.
              mos Mean Opinion Score. This is a score from 1 - 4.5 that represents the overall network quality.
              rtt Round trip time recorded this sample. (milliseconds)
              audio_level_out Audio output level measured at the client.
              audio_level_in Audio input level measured at the client. This will be zero if microphone is muted.
              packets_received Number of packets received in this sample.
              packets_lost Number of packets lost this sample.
              packets_lost_fraction Fraction of packets lost this sample.
              total_packets_received Cumulative number of packets received so far during the call.
              total_packets_lost Number of packets lost in this sample.
              total_bytes_sent Cumulative number of bytes sent so far during the call.
              total_bytes_received Cumulative number of bytes sent so far during the call.
              total_packets_sent Cumulative number of packets sent during the call.

              Get Call Summary

              The call summary resource provides both the event logs and metrics for a call in a single request.

              GET /Calls/{Call SID}/Summary
                    
                    
                    
                    

                    Resource Properties

                    Property Description
                    account_friendly_name Name for the account that was used to make this call.
                    parent_account_friendly_name Name for the parent account.
                    parent_account_sid Account Sid of the parent account
                    call_sid Call Sid is the unique identifier for this call.
                    parent_call_sid Call Sid of the parent call.
                    summary Summary object contains summaries of events and metrics. Summary properties are defined below.

                    Summary object properties

                    Property Description
                    publisher_metadata Same as the publisher metadata object specified above.
                    events Contains counts of events for each group and level.
                    metrics Metrics summary contains statistics on Jitter, MoS, RTT, AudioLevelOut, AudioLevelIn, PacketsLost, PacketsReceived, PacketsSent.
                    client_metadata Client Metadata contains information such as client name, SDK version, region, selected region and who hung up the call.

                    Disconnected By object properties

                    Property Description
                    local Twilio Client initiated a disconnect. The event "disconnected-by-local" is logged in the event log.
                    remote The client received a disconnect event from the server. The event “disconnected-by-remote” is logged in the event log.
                    na A disconnect event was not generated. This could be due to multiple reasons: computer crashes, network issues, the browser being closed or crashing while the call was in progress, the client object being destroyed before the event could be sent to Twilio Insights, or any other behavior that results in Twilio not receiving the final events from the SDK unexpectedly. These will appear as "disconnected by: unknown" when viewing Insights data in Console and aggregate reports.
                    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 browsing the Twilio tag on Stack Overflow.