{"$id":"https://events-schemas.twilio.com/VoiceInsights.CallMetric/2","$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"definitions":{"Browser":{"additionalProperties":false,"description":"The browser information of the client","properties":{"major":{"default":"","description":"The major version of the browser","type":"string"},"name":{"default":"","description":"The name of the browser","type":"string"},"version":{"default":"","description":"The full version of the browser","type":"string"}},"required":["name","major","version"],"type":"object"},"ClientMetadata":{"additionalProperties":false,"description":"The client metadata for the call","properties":{"city":{"default":"","description":"The city of the client's location","type":"string"},"client_name":{"default":"","description":"The name of the client application using the SDK","type":"string"},"country_code":{"default":"","description":"The ISO 3166-1 alpha-2 country code of the client's location","type":"string"},"country_subdivision":{"default":"","description":"The subdivision (state, province, etc.) of the client's location","type":"string"},"ip_address":{"default":"","description":"The IP address of the client","type":"string"},"location":{"$ref":"#/definitions/Location"},"sdk":{"$ref":"#/definitions/TwilioSDK"}},"required":["client_name","city","country_code","country_subdivision","ip_address"],"type":"object"},"ClientMetrics":{"additionalProperties":false,"description":"The client metrics for the call","properties":{"codec":{"description":"The codec used for the call, represented as an integer payload type","maximum":2147483647,"minimum":-2147483648,"type":"integer"},"codec_name":{"default":"unknown_codec_name","description":"The name of the codec used for the call","type":"string"},"cumulative":{"$ref":"#/definitions/Metrics"},"interval":{"$ref":"#/definitions/Metrics"},"metadata":{"$ref":"#/definitions/ClientMetadata"}},"required":["codec_name"],"type":"object"},"Device":{"additionalProperties":false,"description":"The device information of the client","properties":{"arch":{"default":"","description":"The architecture of the device","type":"string"},"model":{"default":"","description":"The model of the device","type":"string"},"type":{"default":"","description":"The type of the device","type":"string"},"vendor":{"default":"","description":"The vendor of the device","type":"string"}},"required":["model","type","vendor","arch"],"type":"object"},"Engine":{"additionalProperties":false,"description":"The engine information of the client","properties":{"name":{"default":"","description":"The name of the engine","type":"string"},"version":{"default":"","description":"The version of the engine","type":"string"}},"required":["name","version"],"type":"object"},"GatewayMetadata":{"additionalProperties":false,"description":"The gateway metadata for the call","properties":{"edge_location":{"default":"","description":"The Twilio edge location the gateway is using","type":"string"},"external_ip":{"default":"","description":"The external IP address the gateway is using","type":"string"},"region":{"default":"unknown_realm","description":"The Twilio region the gateway is located in. For a list of regions, see https://www.twilio.com/docs/voice/regions","type":"string"},"twilio_ip":{"default":"","description":"The Twilio IP address the gateway is using","type":"string"}},"required":["region","twilio_ip","external_ip","edge_location"],"type":"object"},"GatewayMetrics":{"additionalProperties":false,"description":"The gateway metrics for the call","properties":{"codec":{"description":"The codec used for the call, represented as an integer payload type","maximum":2147483647,"minimum":-2147483648,"type":"integer"},"codec_name":{"default":"unknown_codec_name","description":"The name of the codec used for the call","type":"string"},"cumulative":{"$ref":"#/definitions/Metrics"},"interval":{"$ref":"#/definitions/Metrics"},"metadata":{"$ref":"#/definitions/GatewayMetadata"}},"required":["codec_name"],"type":"object"},"Location":{"additionalProperties":false,"description":"The location of the client","properties":{"lat":{"description":"The latitude of the client's location.","type":"number"},"lon":{"description":"The longitude of the client's location.","type":"number"}},"required":["lat","lon"],"type":"object"},"Metrics":{"additionalProperties":false,"description":"The metrics for the call","properties":{"audio_in":{"$ref":"#/definitions/Stats"},"audio_out":{"$ref":"#/definitions/Stats"},"bytes_received":{"description":"The number of bytes received during the call","maximum":2147483647,"minimum":-2147483648,"type":"integer"},"bytes_sent":{"description":"The number of bytes sent during the call","maximum":2147483647,"minimum":-2147483648,"type":"integer"},"codec":{"description":"The codec used for the call, represented as an integer payload type","maximum":2147483647,"minimum":-2147483648,"type":"integer"},"codec_name":{"default":"unknown_codec_name","description":"The name of the codec used for the call","type":"string"},"jitter":{"$ref":"#/definitions/Stats"},"latency":{"$ref":"#/definitions/Stats"},"mos":{"$ref":"#/definitions/Stats"},"packet_delay_variation":{"$ref":"#/definitions/PacketDelayVariation"},"packets_loss_percentage":{"description":"The percentage of packets lost during the call","type":"number"},"packets_lost":{"description":"The number of packets lost during the call","maximum":2147483647,"minimum":-2147483648,"type":"integer"},"packets_received":{"description":"The number of packets received during the call","maximum":2147483647,"minimum":-2147483648,"type":"integer"},"packets_sent":{"description":"The number of packets sent during the call","maximum":2147483647,"minimum":-2147483648,"type":"integer"},"rtt":{"$ref":"#/definitions/Stats"}},"required":["codec_name"],"type":"object"},"Os":{"additionalProperties":false,"description":"The operating system information of the client","properties":{"name":{"default":"","description":"The name of the operating system","type":"string"},"version":{"default":"","description":"The version of the operating system","type":"string"}},"required":["name","version"],"type":"object"},"PacketDelayVariation":{"additionalProperties":false,"description":"The PacketDelayVariation object represents the distribution of packet delay variations (PDV) in milliseconds, providing insights into the variability of packet arrival times during a VoIP call. PDV is a critical metric for assessing the quality of real-time communications, as high variability can lead to issues such as jitter and degraded audio quality.","properties":{"d120":{"default":0,"description":"The 120th percentile of packet delay variation (PDV) in milliseconds, indicating that 120% of packets experienced a delay variation less than or equal to this value","type":"integer"},"d150":{"default":0,"description":"The 150th percentile of packet delay variation (PDV) in milliseconds, indicating that 150% of packets experienced a delay variation less than or equal to this value","type":"integer"},"d200":{"default":0,"description":"The 200th percentile of packet delay variation (PDV) in milliseconds, indicating that 200% of packets experienced a delay variation less than or equal to this value","type":"integer"},"d300":{"default":0,"description":"The 300th percentile of packet delay variation (PDV) in milliseconds, indicating that 300% of packets experienced a delay variation less than or equal to this value","type":"integer"},"d50":{"default":0,"description":"The 50th percentile of packet delay variation (PDV) in milliseconds, indicating that 50% of packets experienced a delay variation less than or equal to this value","type":"integer"},"d70":{"default":0,"description":"The 70th percentile of packet delay variation (PDV) in milliseconds, indicating that 70% of packets experienced a delay variation less than or equal to this value","type":"integer"},"d90":{"default":0,"description":"The 90th percentile of packet delay variation (PDV) in milliseconds, indicating that 90% of packets experienced a delay variation less than or equal to this value","type":"integer"}},"required":["d50","d70","d90","d120","d150","d200","d300"],"type":"object"},"Stats":{"additionalProperties":false,"description":"The Stats object represents statistical data related to a specific metric, providing insights into its distribution and central tendencies. It includes key statistical measures such as minimum, maximum, and average values","properties":{"avg":{"default":0,"description":"The average (mean) value of the metric calculated over the measurement period.","type":"number"},"max":{"default":0,"description":"The maximum value observed for the metric during the measurement period.","type":"number"},"min":{"default":0,"description":"The minimum value observed for the metric during the measurement period.","type":"number"},"value":{"description":"The current value of the metric at the time of measurement.","type":"number"}},"required":["min","max","avg"],"type":"object"},"TwilioSDK":{"additionalProperties":false,"description":"The Twilio SDK information of the client","properties":{"browser":{"$ref":"#/definitions/Browser"},"device":{"$ref":"#/definitions/Device"},"edge_location":{"default":"","description":"The Twilio edge location the SDK is connected to","type":"string"},"engine":{"$ref":"#/definitions/Engine"},"os":{"$ref":"#/definitions/Os"},"platform":{"default":"","description":"The platform on which the Twilio SDK is running (e.g., 'web', 'ios', 'android').","type":"string"},"region":{"default":"unknown_realm","description":"The region the SDK is configured to use. For a list of regions, see https://www.twilio.com/docs/voice/regions","type":"string"},"selected_region":{"default":"","description":"The actual region the SDK selected to connect to. For a list of regions, see https://www.twilio.com/docs/voice/regions","type":"string"},"type":{"default":"","description":"The type of Twilio SDK used (e.g., 'twilio.js' for the Twilio JavaScript SDK).","type":"string"},"version":{"default":"","description":"The version of the Twilio SDK being used.","type":"string"}},"required":["type","version","platform","region","selected_region","edge_location"],"type":"object"}},"description":"The Call Metrics resource represents the real-time and cumulative media quality metrics for a call leg in a Voice over IP (VoIP) call. These metrics provide insights into the performance and quality of the call, including information about packet loss, jitter, latency, and other key indicators of call quality. The Call Metrics resource is part of Twilio's Voice Insights, which helps developers monitor and improve the quality of their voice applications.","examples":[{"account_sid":"AC0000000000000000000000000000001","call_sid":"CA0000000000000000000000000000001","carrier_edge":{"codec":0,"codec_name":"pcmu","cumulative":{"audio_in":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"audio_out":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"bytes_received":0,"bytes_sent":0,"codec":0,"codec_name":"pcmu","jitter":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"latency":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"mos":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"packet_delay_variation":{"d120":70,"d150":90,"d200":110,"d300":150,"d50":20,"d70":30,"d90":50},"packets_loss_percentage":0.0,"packets_lost":0,"packets_received":0,"packets_sent":0,"rtt":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0}},"interval":{"audio_in":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"audio_out":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"bytes_received":0,"bytes_sent":0,"codec":0,"codec_name":"pcmu","jitter":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"latency":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"mos":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"packet_delay_variation":{"d120":70,"d150":90,"d200":110,"d300":150,"d50":20,"d70":30,"d90":50},"packets_loss_percentage":0.0,"packets_lost":0,"packets_received":0,"packets_sent":0,"rtt":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0}},"metadata":{"edge_location":"ashburn","external_ip":"172.0.0.130","region":"us1","twilio_ip":"172.0.0.130"}},"client_edge":{"codec":0,"codec_name":"pcmu","cumulative":{"audio_in":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"audio_out":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"bytes_received":0,"bytes_sent":0,"codec":0,"codec_name":"pcmu","jitter":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"latency":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"mos":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"packet_delay_variation":{"d120":70,"d150":90,"d200":110,"d300":150,"d50":20,"d70":30,"d90":50},"packets_loss_percentage":0.0,"packets_lost":0,"packets_received":0,"packets_sent":0,"rtt":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0}},"interval":{"audio_in":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"audio_out":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"bytes_received":0,"bytes_sent":0,"codec":0,"codec_name":"pcmu","jitter":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"latency":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"mos":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"packet_delay_variation":{"d120":70,"d150":90,"d200":110,"d300":150,"d50":20,"d70":30,"d90":50},"packets_loss_percentage":0.0,"packets_lost":0,"packets_received":0,"packets_sent":0,"rtt":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0}},"metadata":{"edge_location":"ashburn","external_ip":"172.0.0.130","region":"us1","twilio_ip":"172.0.0.130"}},"direction":"inbound","edge":"unknown_edge","sdk_edge":{"codec":0,"codec_name":"pcmu","cumulative":{"audio_in":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"audio_out":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"bytes_received":0,"bytes_sent":0,"codec":0,"codec_name":"pcmu","jitter":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"latency":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"mos":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"packet_delay_variation":{"d120":70,"d150":90,"d200":110,"d300":150,"d50":20,"d70":30,"d90":50},"packets_loss_percentage":0.0,"packets_lost":0,"packets_received":0,"packets_sent":0,"rtt":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0}},"interval":{"audio_in":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"audio_out":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"bytes_received":0,"bytes_sent":0,"codec":0,"codec_name":"pcmu","jitter":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"latency":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"mos":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"packet_delay_variation":{"d120":70,"d150":90,"d200":110,"d300":150,"d50":20,"d70":30,"d90":50},"packets_loss_percentage":0.0,"packets_lost":0,"packets_received":0,"packets_sent":0,"rtt":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0}},"metadata":{"city":"Honolulu","client_name":"my_app","country_code":"US","country_subdivision":"HI","ip_address":"172.0.0.130","location":{"lat":20.956036,"lon":-157.23793},"sdk":{"browser":{"major":"89","name":"chrome","version":"89.0.4389.90"},"device":{"arch":"arm","model":"iphone","type":"mobile","vendor":"apple"},"edge_location":"ashburn","engine":{"name":"webkit","version":"537.36"},"os":{"name":"windows","version":"10"},"platform":"web","region":"us1","selected_region":"us1","type":"twilio.js","version":"1.2.3"}}},"sip_edge":{"codec":0,"codec_name":"pcmu","cumulative":{"audio_in":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"audio_out":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"bytes_received":0,"bytes_sent":0,"codec":0,"codec_name":"pcmu","jitter":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"latency":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"mos":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"packet_delay_variation":{"d120":70,"d150":90,"d200":110,"d300":150,"d50":20,"d70":30,"d90":50},"packets_loss_percentage":0.0,"packets_lost":0,"packets_received":0,"packets_sent":0,"rtt":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0}},"interval":{"audio_in":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"audio_out":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"bytes_received":0,"bytes_sent":0,"codec":0,"codec_name":"pcmu","jitter":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"latency":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"mos":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0},"packet_delay_variation":{"d120":70,"d150":90,"d200":110,"d300":150,"d50":20,"d70":30,"d90":50},"packets_loss_percentage":0.0,"packets_lost":0,"packets_received":0,"packets_sent":0,"rtt":{"avg":5.0,"max":10.0,"min":0.0,"value":3.0}},"metadata":{"edge_location":"ashburn","external_ip":"172.0.0.130","region":"us1","twilio_ip":"172.0.0.130"}},"timestamp":"2023-10-05T14:48:00.000Z"}],"properties":{"account_sid":{"description":"The unique SID identifier of the Account","type":"string"},"call_sid":{"description":"The unique SID identifier of the Call","type":"string"},"carrier_edge":{"$ref":"#/definitions/GatewayMetrics"},"client_edge":{"$ref":"#/definitions/GatewayMetrics"},"direction":{"description":"The Direction of the media stream from the perspective of the Twilio media edge","type":"string"},"edge":{"description":"The Twilio media edge this Metric was captured on.","type":"string"},"sdk_edge":{"$ref":"#/definitions/ClientMetrics"},"sip_edge":{"$ref":"#/definitions/GatewayMetrics"},"timestamp":{"description":"Timestamp of metric sample. Samples are taken every 10 seconds and contain the metrics for the previous 10 seconds.","format":"date-time","type":"string"}},"required":["timestamp","call_sid","account_sid","edge","direction"],"title":"CallMetrics","type":"object"}